PHP Classes

File: README.md

Recommend this page to a friend!
  Classes of Muhammad Umer Farooq  >  Whoops  >  README.md  >  Download  
File: README.md
Role: Example script
Content type: text/markdown
Description: Example script
Class: Whoops
Handle PHP errors integrating with code editors
Author: By
Last change:
Date: 2 years ago
Size: 2,109 bytes
 

Contents

Class file image Download

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:


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

- [x] Bootstrap 4 ready.	 
- [x]   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.
For more information send a message to info at phpclasses dot org.