Download the PHP package yggverse/gemini without Composer
On this page you can find all versions of the php package yggverse/gemini. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package gemini
gemini-php
PHP 8 Library for Gemini Protocol
Usage
Client
PHP interface for Gemini protocol queries by TLS socket connection
Request
Resolved request (SNI)
For direct connection provide resolved IP as the second argument
Alternatively, use setResolvedHost
method of Request
object before getResponse
Request::setResolvedHost
- to resolve network address with PHP, take a look on the net-php library!
Request::getResolvedHost
Get resolved host back
Request::setHost
Request::getHost
Request::setPort
Request::getPort
Request::setPath
Request::getPath
Request::setQuery
Request::getQuery
Request::getResponse
Execute requested URL and return raw response
Request::getOptions
Request::setOptions
Response
This class provides additional features for the raw response operations
Response::setCode
Response::getCode
Response::setMeta
Response::getMeta
Response::setBody
Response::getBody
Gemtext
Object-oriented API for Gemtext
Body
Basic methods to work with text/gemini
documents
Body::getLines
Body::getLine
Body::getH1
Body::getH2
Body::getH3
Body::getQuote
Body::getCode
Body::getLinks
Body::findLinks
Find context links by protocol as argument, gemini
by default
Body::skipTags
Strip gemini tags from Gemini document
Link
Inline links parser.
Allows to extract address, date with timestamp and alt text from link line given
Link::getAddress
Link::getDate
This method also validates time format and returns the unix timestamp as linked argument
Link::getAlt
GTK3
Pango
Converter to GTK3-compatible Pango format
Pango::fromGemtext
Pango::fromGemtextBody
DokuWiki
Toolkit provides DokuWiki API for Gemini.
Allows to simple deploy new apps or make existing website mirror
Examples
- β-Doku - DokuWiki Satellite for Gemini Protocol
Reader
Read DokuWiki and convert to Gemini
Reader::getRules
Reader::setRules
Reader::getRule
Reader::setRule
Get or change existing regex rule (or just skip by using build-in set)
Reader::getMacroses
Reader::setMacroses
Reader::getMacros
Reader::setMacros
Reader::toGemini
Convert DokuWiki text to Gemini markup
As wiki has lot of inline links, to make converted document well-readable, this method does not replace links with new line =>
macros, but uses inline context: Name ( URL )
. This model useful with Reader::getLinks
method, that for example appends all those related links to the document footer.
If you don't like this implementation, feel free to change it by Reader::setRule
method!
Reader::getH1
Get document title
Reader::getLinks
Get document links
Filesystem
Provides methods for simple and secure interaction with DokuWiki file storage
Filesystem::getList
Return simple array of all files in storage
Filesystem::getTree
Return all files under the storage folder in tree format
Filesystem::getPagePathsByPath
Return pages under the given data directory
Filesystem::getDirectoryPathByUri
Filesystem::getPagePathByUri
Return absolute path to stored page file
Filesystem::getDirectoryUriByPath
Filesystem::getPageUriByPath
Return page URI in dokuwiki:format
Filesystem::getMediaPathByUri
Return absolute path to stored media file
Filesystem::getMimeByPath
Return file MIME if path match storage item
Filesystem::getDataByPath
Return file content if path match storage item
Filesystem::isPath
Check path exist and match storage item
Helper
Useful methods to minify controller codebase
Helper::getChildrenSectionLinksByUri
Return simple array of children section links in Gemini format
Helper::getChildrenPageLinksByUri
Return simple array of children page links in Gemini format
Helper::getPageLinkByPath
Return page link (that contain document name) in Gemini format