Skip to content

lablnet/Whoops

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Whoops

[READ ONLY] Subtree split of the Zest Whoop component (see https://github.com/zestframework/Zest_Framework)

usage

Whoops is a PHP library for handling exceptions and errors.

Requirement

  • PHP
  • Composer

Features

  • Flexible, stack-based error handling.
  • Stand-alone library with (currently) no required dependencies.
  • Highlight the error line with red color.
  • Show preview code in browser.
  • Clean, well-structured & tested code-base.
  • Includes the ability to open referenced files directly in your editor and IDE

Insallation

Installing this package is very simple, first ensure you have the right PHP version and composer installed then in your terminal/(command prompt) run: composer require zest/whoops

Register the handler in your code

<?php
$whoops = new Whoops();

usage

Example:

<?php 
use Zest\Whoops;
require '../vendor/autoload.php';
$whoops = new Whoops();
$a = 10;
echo "The value of a is ".valueOfA();

/*Rest of code*/
echo "This is rest of code";

Output

image image

Open Files In An Editor

Whoops comes with the ability to open referenced files directly in your IDE or editor. This feature only works in case your php-source files are locally accessible to the machine on which the editor is installed.

<?php
$whoops = new Whoops();
$whoops->setEditor('sublime');
//Rest of code....

The following editors are currently supported by default.

  • sublime Sublime editor

Append your own/custom editor

<?php
$whoops = new Whoops();
$whoops->appendEditor("myeditor" , "myeditor://open?url=file://::file&line=::line",)

TODO

  • Bootstrap 4 ready.
  • Includes the ability to open referenced files directly in your editor and IDE]
  • Should add more IDE\Editor support.
  • Add new feature to show Enviroment details.

About

[READ ONLY] Subtree split of the Zest Whoop component (see https://github.com/zestframework/Zest_Framework)

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages