PHP Class Phrocco\Pygment

This class simply proxies to two possible handlers, a local install of the Pygmentize gem or a remote webservice. If the command line option is unavailable then it gets delegated to a web service. Obviously using the web service will require a net connection and may slow down the processing time.
Author: Ross Riley
Afficher le fichier Open project: rossriley/phrocco Class Usage Examples

Méthodes publiques

Méthode Description
local_pygment ( $language, $code ) : `string` ### Use Local Gem If the pygmentize gem is available locally then we use this to parse the code.
pygmentize ( `string` $language, `string` $code ) : `void` This is the main method that returns the processed code, and decides whether to use a local gem or a remote web service.
webservice ( $language, $code ) : `string` ### Use Web Service If the pygmentize gem is not available locally then we use a remote web serivce as a fallback.

Method Details

local_pygment() public méthode

### Use Local Gem If the pygmentize gem is available locally then we use this to parse the code.
public local_pygment ( $language, $code ) : `string`
Résultat `string`

pygmentize() public méthode

This is the main method that returns the processed code, and decides whether to use a local gem or a remote web service.
public pygmentize ( `string` $language, `string` $code ) : `void`
$language `string`
$code `string`
Résultat `void`

webservice() public méthode

### Use Web Service If the pygmentize gem is not available locally then we use a remote web serivce as a fallback.
public webservice ( $language, $code ) : `string`
Résultat `string`