Coder Social home page Coder Social logo

iter8-au / php-console-silex Goto Github PK

View Code? Open in Web Editor NEW

This project forked from websoftix/php-console-silex

0.0 3.0 0.0 12 KB

Silex service provider to handle PHP errors, dump variables, execute PHP code remotely in Google Chrome

Home Page: https://chrome.google.com/webstore/detail/php-console/nfhmhhlpfleoednkpnnnkolmclajemef

License: Other

PHP 100.00%

php-console-silex's Introduction

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

  1. Install Google Chrome extension PHP Console.
  2. Add "php-console/silex-service-provider": "1.*" package in Silex project composer.json and run composer 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');

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.