Download the PHP package php-console/silex-service-provider without Composer
On this page you can find all versions of the php package php-console/silex-service-provider. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download php-console/silex-service-provider
More information about php-console/silex-service-provider
Files in php-console/silex-service-provider
Package silex-service-provider
Short Description Silex service provider to handle PHP errors, dump variables, execute PHP code remotely in Google Chrome
License BSD 3-Clause
Homepage https://github.com/barbushin/php-console-silex
Informations about the package silex-service-provider
PHP Console service provider
PHP Console allows you to handle PHP errors & exceptions, dump variables, execute PHP code remotely and many other things using Google Chrome extension PHP Console and PhpConsole server library.
This packages integrates PHP Console server library with Silex as configurable service provider.
Installation
- Install Google Chrome extension PHP Console.
- Add
"php-console/silex-service-provider": "1.*"
package in Silex projectcomposer.json
and runcomposer update
.
Configuration
To handle errors occurred on Silex initialization PhpConsole service provider should be initialized right after Silex\Application
:
$app = new Silex\Application();
// All settings are optional, so you can remove any key in this array
$app['php-console.settings'] = array(
'sourcesBasePath' => dirname(__DIR__),
'serverEncoding' => null,
'headersLimit' => null,
'password' => null,
'enableSslOnlyMode' => false,
'ipMasks' => array(),
'isEvalEnabled' => false,
'dumperLevelLimit' => 5,
'dumperItemsCountLimit' => 100,
'dumperItemSizeLimit' => 5000,
'dumperDumpSizeLimit' => 500000,
'dumperDetectCallbacks' => true,
'detectDumpTraceAndSource' => false,
);
$app->register(new PhpConsole\Silex\ServiceProvider($app,
new \PhpConsole\Storage\File(sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'php-console.data') // any writable path
));
See PhpConsole\Silex\ServiceProvider for detailed settings description.
Usage
When PhpConsole service provider is registered all errors and exceptions will be handled automatically.
Now you can debug vars using PhpConsole global helper class PC
:
PC::debug($var, 'tags');
Also you can extended Silex\Application
class with use PhpConsole\Silex\ApplicationHelperTrait
and debug using:
$app->pc($var, 'tags');