Recommend this page to a friend! |
![]() |
Info | Documentation | Screenshots | ![]() |
![]() |
![]() |
Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not yet rated by the users | Total: 56 | All time: 10,587 This week: 560![]() |
Version | License | PHP version | Categories | |||
quantumphp 1.0.11 | BSD License | 5 | PHP 5, Debug, Tools, Logging |
Description | Author | ||||||||
This class can output log messages to show in browser console. |
|
QuantumPHP is a PHP and JavaScript library that can log server side variables directly to the developer tools console in various browsers like Firefox Quantum, with or without the use of a browser extension or add-on.
a) composer require frankforte/quantumphp
or
b) git clone https://github.com/frankforte/quantumphp.git vendor/frankforte/quantumphp
https://addons.mozilla.org/en-US/firefox/addon/quantumphp/
or
https://chrome.google.com/extensions/detail/noaneddfkdjfnfdakjjmocngnfkfehhd
More information can be found here: http://www.chromelogger.com
or
for example:
cp vendor/frankforte/quantumphp/QuantumPHP.js public_html/js/QuantumPHP.js
Then add the file to the HTML template
<script src="/js/QuantumPHP.js"></script>
Add this to your PHP file. The 'add' method will add rich information to the logs in a table format.
Note: objects and arrays should be logged with the "add" method: QuantumPHP::add($object);
<?php
// Optional if you do not have an autoloader
include 'QuantumPHP.php';
/
* Optional debugging mode
* mode = 1 for Chrome and Firefox
* mode 2 for just Firefox
* mode 3 for just Chrome
* mode 0 when you have a HUGE-MONGOUS log, and
* HTTP headers break the server or browser...
* WARNING: mode 0 will echo the log in an HTML comment, so
* no more http headers can be sent once you call QuantumPHP::send()
* (unless you use output buffering)
* defaults to mode 2
*/
QuantumPHP::$MODE = 2;
// Optional debug size. Defaults to 5kB
QuantumPHP::$HEADER_LIMIT = 16000;
// Logging strings
QuantumPHP::log('Regular log');
QuantumPHP::warn('Regular warn');
QuantumPHP::error('Regular error');
// Logging strings, objects, or arrays
QuantumPHP::add('Hello console table!');
QuantumPHP::add('Something Bad','error');
QuantumPHP::add('Something Really Bad','critical');
// QuantumPHP::log($_SERVER); // you will need mode 0 for this!
try
{
throw new Exception('Something Bad!!');
}
catch(Exception $e)
{
\QuantumPHP::add('test','warning',$e);
}
QuantumPHP::send();
Finally, hit F12 in your browser to open developer tools, and view the output under the "console" tab.
Please submit any issues you have: https://github.com/frankforte/quantumphp/issues
Screenshots (1) | ||
![]() |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Class | Class source | ||
![]() ![]() |
Doc. | Documentation |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
![]() |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
83% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.