2017 © Pedro Peláez
 

library pretty-exceptions

beauty-exceptions plugin for Phalcon

image

getsky/pretty-exceptions

beauty-exceptions plugin for Phalcon

  • Sunday, November 2, 2014
  • by JimmDiGrizli
  • Repository
  • 1 Watchers
  • 0 Stars
  • 61 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 23 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Pretty Exceptions

Pretty-Exceptions, (*1)

Phalcon is a web framework delivered as a C extension providing high performance and lower resource consumption., (*2)

Pretty Exceptions is an utility to show exceptions/errors/warnings/notices using a nicely visualization., (*3)

This utility is not intended to be used in a production stage., (*4)

This utility catches uncatched exceptions, remember to remove any try/catch that avoid the utility can work., (*5)

The code in this repository is written in PHP., (*6)

Automatic Usage

The easiest way to use this utility is call static methods:, (*7)


GetSky\Phalcon\Utils\PrettyExceptions::listenException(); GetSky\Phalcon\Utils\PrettyExceptions::listenError();

Manual Usage

Listen for exceptions:, (*8)


set_exception_handler(function($e) { $p = new GetSky\Phalcon\Utils\PrettyExceptions(); return $p->handle($e); });

Listen for user errors/warnings/notices:, (*9)


set_error_handler(function($errorCode, $errorMessage, $errorFile, $errorLine) { $p = new GetSky\Phalcon\Utils\PrettyExceptions(); return $p->handleError($errorCode, $errorMessage, $errorFile, $errorLine); });

Options

The following is the way to configure the utility:, (*10)


$p = new GetSky\Phalcon\Utils\PrettyExceptions(); //Change the base uri for static resources $p->setBaseUri('/'); //Set if the backtrace must be shown $p->showBacktrace(true); //Set whether if open the user files and show its code $p->showFiles(true); //Set whether show the complete file or just the relevant fragment $p->showFileFragment(true); /** * Set whether show human readable dump of current Phalcon application instance * Can optionally pass a Phalcon application instance as a prameter in the * constructor, or as the last parameter of PrettyExceptions::handle() and * PrettyExceptions::handleError() */ $p->showApplicationDump(true); //Change the CSS theme (default, night or minimalist) $p->setTheme('default'); //Handle the error/exception //...

Live Demo

A live demo is available here and here, (*11)

The Versions

02/11 2014

dev-master

9999999-dev http://phalconphp.com

beauty-exceptions plugin for Phalcon

  Sources   Download

BSD-3

The Requires

  • php >=5.3.6
  • ext-phalcon >=1.2.4

 

framework exceptions phalcon