PHP Класс 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.
Показать файл
Открыть проект
Примеры использования класса
Открытые методы
Метод |
Описание |
|
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. |
|
Описание методов
local_pygment()
публичный Метод
### Use Local Gem
If the pygmentize gem is available locally then we use this to parse the code.
public local_pygment ( $language, $code ) : `string` |
Результат |
`string` |
|
pygmentize()
публичный Метод
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` |
|
Результат |
`void` |
|
webservice()
публичный Метод
### 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` |
Результат |
`string` |
|