Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX for "mb_detect_encoding() expects parameter 1 to be string, resource given" #13

Open
wants to merge 182 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
182 commits
Select commit Hold shift + click to select a range
7574f5e
initial commit
cadorn Oct 27, 2009
f4aee84
imported existing FirePHPCore lib
cadorn Oct 27, 2009
61c63a0
added client tests
cadorn Mar 5, 2010
26c0e0d
ported to new pinf
cadorn Mar 5, 2010
e77637b
renamed package
cadorn Mar 5, 2010
4b93dd4
registered package
cadorn Mar 5, 2010
46efdef
reorganized client tests; updated copyright year
cadorn Mar 5, 2010
509947e
normalized indenting
cadorn Mar 5, 2010
4d960f8
declared test runner
cadorn Mar 5, 2010
71eaf47
client test runner fixes
cadorn Mar 5, 2010
100a351
Various fixes
cadorn Mar 5, 2010
af891bc
- (Issue 117) dump() method argument validation
cadorn Mar 5, 2010
6114d4e
updated docs; minor fix
cadorn Mar 5, 2010
c10bc02
updated docs; minor fix
cadorn Mar 5, 2010
de155a8
(Issue 123) registerErrorHandler(false) by default; added setOption()…
cadorn Mar 5, 2010
3a961df
(Issue 122) Filter objectStack property of FirePHP class
cadorn Mar 5, 2010
0042173
removed custom request processor client tests
cadorn Mar 5, 2010
f2c0313
(Issue 114) Allow options to be passed on to basic logging wrappers
cadorn Mar 5, 2010
9c756c8
recursion test
cadorn Mar 5, 2010
c7be0ef
set rc release version
cadorn Mar 6, 2010
f143efb
added new insight package and program
cadorn Apr 21, 2010
b9c47bf
new standalone program
cadorn May 27, 2010
5a4b80c
Moved tests into examples; new insight package
cadorn Jun 21, 2010
6c1b9de
Build cleanup
cadorn Jun 21, 2010
3507783
Wrapper for insight API; meta fixes
cadorn Jun 21, 2010
0f4ac15
Standalone program for FirePHP; examples and tests
cadorn Jun 21, 2010
adef7f9
Added @pinf annotation to replace version
cadorn Jul 16, 2010
6fdf923
Set lib version
cadorn Jul 16, 2010
083238a
Added changelog
cadorn Jul 16, 2010
eec2241
Bugfix: Append libs to include path when calling FirePHP/Init.php
cadorn Jul 18, 2010
dc4fb72
Fixed code indentation
cadorn Jul 19, 2010
c1358fe
- (Issue 145) maxDepth option
cadorn Jul 19, 2010
0d5a114
Added redirect test
cadorn Jul 19, 2010
023aef3
Incremented version
cadorn Jul 19, 2010
6cb4542
Incremented version
cadorn Jul 19, 2010
9157b78
- Fixed FirePHP/Init.php inclusion logic
cadorn Jul 19, 2010
3bdc2b2
* Added redirect test for traditional and insight API
cadorn Jul 23, 2010
5a9be59
Added selective logging test
cadorn Jul 23, 2010
b084657
* Enhancement: Redirect traditional API calls to insight via setLogTo…
cadorn Jul 27, 2010
4f2d258
Selective logging test
cadorn Jul 29, 2010
c05bdc5
* Bugfix: Don't use __DIR__ as it is missing in some environments
cadorn Jul 29, 2010
ff6e347
* Forgot files
cadorn Jul 29, 2010
f1c9f5b
Renamed selective logging to conditional logging
cadorn Aug 2, 2010
46c5d21
* Enhancement: Show payload in tests
cadorn Aug 3, 2010
30a5a79
* Enhancement: Minimal install method
cadorn Aug 19, 2010
9934ce3
* Enhancement: Added recordEnvironment() to FirePHP engine
cadorn Aug 20, 2010
f65438e
Added insight line markers to FeedCache example
cadorn Aug 21, 2010
56e3038
Bugfix: Avoid globals pollution during initialization
cadorn Aug 29, 2010
162ebb7
Bugfix: Suppress error logging for FirePHP engine plugin if @ used
cadorn Aug 29, 2010
6c4dafc
Enhancement: More comprehensive recordEnvironment() for FirePHP plugin
cadorn Aug 29, 2010
7ac07d5
Misc
cadorn Aug 29, 2010
9ee6de6
added ignore file
cadorn Aug 29, 2010
253e602
- Trigger upgrade message if part of FirePHP 1.0
cadorn Oct 9, 2010
ec79f90
- Removed FirePHP/Init.php inclusion logic and only load FirePHP.clas…
cadorn Oct 9, 2010
7b358a0
Incremented version to: 2010-10-08 - Release Version: 0.3.2rc4
cadorn Oct 9, 2010
37fb8bd
* Enhancement: Provide procedural API via FirePHP/fb.php [5m]
cadorn Oct 9, 2010
8d4b757
Updated docs in examples
cadorn Oct 9, 2010
a3a89e2
* Enhancement: Implement FIREPHP_ACTIVATED constant to force-deactiva…
cadorn Oct 9, 2010
930ac9c
* Bugfix: FirePHP constants when deactivated
cadorn Oct 9, 2010
9a9e1dd
* Enhancement: Upgrade message when using FirePHP Extension
cadorn Oct 9, 2010
72e271d
* Enhancement: Discard duplicate errors and trim backtraces for certa…
cadorn Oct 9, 2010
8410452
Various new tests
cadorn Oct 9, 2010
d1fefe2
jQuery for TestRunner
cadorn Oct 9, 2010
b5cd7b6
updated changelog
cadorn Oct 9, 2010
b2a84a9
- (Issue 153) FirePHP incorrectly double-encodes UTF8 when mbstring.f…
cadorn Oct 10, 2010
425fcef
* Enhancement: Added Zend Framework example (shows if ZF is found)
cadorn Oct 10, 2010
6b98d91
Incremented version to 2010-10-09 - Release Version: 0.3.2rc5
cadorn Oct 10, 2010
e39803c
* Enhancement: Added Error Reporting levels to FirePHP_Plugin_FirePHP…
cadorn Oct 12, 2010
5bb0d28
* Bugfix: Use 'instanceof' instead of is_a() [4m]
cadorn Oct 12, 2010
1d3bd75
- (Issue 154) getRequestHeader uses "getallheaders" even though it do…
cadorn Oct 12, 2010
89a05d2
Incremented version to: 2010-10-12 - Release Version: 0.3.2rc6
cadorn Oct 12, 2010
1cd072d
New tests for viewer in firebug insight panel
cadorn Oct 16, 2010
e204ded
Various test changes
cadorn Oct 16, 2010
a354c39
Updated lib id
cadorn Oct 20, 2010
0652716
Updated encoder option names
cadorn Oct 20, 2010
52f2bb3
New tests and updated changelog
cadorn Oct 20, 2010
fd6b470
Log to page context by default
cadorn Oct 21, 2010
8f080a1
* Docs: Log to page or request context based on drop-down
cadorn Oct 21, 2010
627ff60
* Enhancement: Update quickstart examples to log to Firebug Console […
cadorn Oct 25, 2010
578cb2d
* Bugfix: Use Zend_Json when json_* not available [30m]
cadorn Oct 25, 2010
43c127a
Fixed quickstart for PHP 5.1
cadorn Oct 26, 2010
702d669
Incremented version to 0.3.2 for FirePHPCore
cadorn Oct 26, 2010
80a893b
* Enhancement: $console->option('encoder.trace.offsetAdjustment', <…
cadorn Nov 9, 2010
02a0267
* Bugfix: Write errors to error log (when trapping via engine plugi…
cadorn Nov 9, 2010
d114ca1
Various changes
cadorn Nov 9, 2010
000871d
* Enhancement: Added FirePHP::plugin("firephp")->logVersion() [4m]
cadorn Nov 10, 2010
67d9d0b
More tests
cadorn Nov 10, 2010
bd5b6f2
Test changes
cadorn Nov 12, 2010
3a7667e
* Enhancement: Added FB::setLogToInsightConsole() [10m]
cadorn Nov 12, 2010
4c95a22
* Enhancement: FirePHP::plugin("firephp")->declareP() & p() [17m]
cadorn Nov 12, 2010
50ff538
New test
cadorn Nov 12, 2010
742dc0a
Updated changelog
cadorn Nov 12, 2010
c5832ff
Only trigger inspect for p() if not logging to page context
cadorn Nov 12, 2010
7306a64
New TODO
cadorn Nov 12, 2010
8c30ae9
p() file and line fix
cadorn Nov 12, 2010
168d59a
UI Plugin tests
cadorn Dec 2, 2010
c9efd24
* Bugfix: Fatal error when using FirePHP::plugin() with no client on …
cadorn Dec 2, 2010
43e3649
Do not overwrite insight config in globals
cadorn Dec 2, 2010
37e18e9
Updated changelog
cadorn Dec 2, 2010
c0bb94f
* Tests
cadorn Dec 3, 2010
c3c559c
* Bugfix: Set FIREPHP_ACTIVATED constant to FALSE if not enabled [5m]
cadorn Dec 4, 2010
285da91
Changes to tests
cadorn Dec 9, 2010
12d111b
CLI Test
cadorn Dec 9, 2010
9194083
New Tests
cadorn Dec 9, 2010
5f8d1bf
Updated changelog
cadorn Dec 9, 2010
e55d3cf
refactor
cadorn Dec 10, 2010
fadc77c
Show UI plugins for reference (HACK)
cadorn Dec 10, 2010
1df034e
* Enhancement: API to add quicklinks
cadorn Dec 10, 2010
852b669
Quicklinks test
cadorn Dec 10, 2010
3882094
updated changelog
cadorn Dec 14, 2010
e8ccc30
changelog
cadorn Dec 17, 2010
db9cedf
* Bugfix: Set second arg FALSE for class_exists() to bypass autoloaders
cadorn Jan 4, 2011
8cab070
Added label to package descriptor
cadorn Jan 31, 2011
3de45a4
Updated copyright
cadorn Jan 31, 2011
91cc4ce
More tests
cadorn Jan 31, 2011
814490a
Docs
cadorn Jan 31, 2011
fa59fd9
Cleanup codestyle =)
qbbr Feb 21, 2011
5d81d0a
rm comment
qbbr Feb 21, 2011
09eaf31
add info
qbbr Feb 24, 2011
e09b7d8
more encoding tests
cadorn Feb 25, 2011
c0b5747
Merge branch 'master' of https://github.com/qbbr/firephp-libs into qb…
cadorn Feb 25, 2011
4ff4dba
license info in files
cadorn Feb 25, 2011
1793c44
* Bugfix: More reliable string encoding detection (Issue 166)
cadorn Mar 4, 2011
5df6068
changelog
cadorn Mar 4, 2011
68ba426
* Bugfix: Depth trimming [1h30m]
cadorn Mar 11, 2011
d545b23
Include FirePHP for TestRunner home page
cadorn Apr 29, 2011
787e87c
More tests
cadorn Apr 29, 2011
e605c29
changelog
cadorn Apr 29, 2011
81f1e99
Test expand()
cadorn May 1, 2011
d38ce46
changelog
cadorn May 1, 2011
7086e09
changelog
cadorn May 10, 2011
55ae4c7
expanded group test
cadorn May 10, 2011
4a35e97
updated test runner
cadorn May 10, 2011
6d151d7
* Change: Deprecated FirePHP_Plugin_FirePHP::trapProblems()
cadorn May 14, 2011
a81c27d
better deprecated message; more tests
cadorn May 14, 2011
99ec4ea
better error message
cadorn May 15, 2011
6667ad1
* Bugfix: Ensure JSON keys are never NULL (due to NULL key in some ar…
cadorn May 16, 2011
4774ce8
more tests
cadorn May 16, 2011
d4b2835
changelogs
cadorn May 16, 2011
a56fa34
revert null key fix
cadorn May 18, 2011
993e092
more tests
cadorn May 19, 2011
a977127
notes
cadorn May 19, 2011
aff2580
test correction
cadorn May 24, 2011
444a83b
test adjustments
cadorn May 26, 2011
3015ffb
changelog
cadorn May 26, 2011
6395538
* Bugfix: Better UTF-8 encoding detection
cadorn May 26, 2011
d00ae35
tests
cadorn May 30, 2011
6a68f5f
changelog
cadorn May 30, 2011
27de097
test
cadorn May 30, 2011
03b90b3
error bugfix
cadorn May 30, 2011
3be5365
* Enhancement: Conditional logging of all PHP errors
cadorn May 30, 2011
e83a40b
changelog
cadorn May 30, 2011
4cb7c44
changelog
cadorn May 31, 2011
ed0347c
test adjustments
cadorn Jun 2, 2011
5d99946
* Bugfix: FB::error() using deprecated method under the hood
cadorn Jun 2, 2011
0d2b606
* Refactor: Use autoloader instead of require() calls
cadorn Jun 2, 2011
43e23ae
changelog
cadorn Jun 2, 2011
806136d
changelog
cadorn Jun 2, 2011
93b6624
Code style clean up =)
qbbr Jun 7, 2011
ea7193b
Merge pull request #10 from qbbr/master
cadorn Jun 10, 2011
32981c8
removed insight lib
cadorn Jul 18, 2011
fcd718a
removed test program
cadorn Jul 18, 2011
75e19a2
moved cor sub package to top-level
cadorn Jul 18, 2011
ff3bdcc
fixed uid
cadorn Jul 19, 2011
7deaf2c
repository restructuring; new build and publish scripts
cadorn Jul 20, 2011
137f3d5
lib path when imported to firephp project
cadorn Jul 20, 2011
00c485c
build fixes
cadorn Jul 22, 2011
c49a7dd
misc build fixes
cadorn Mar 10, 2012
7826108
newlines test
cadorn Apr 6, 2012
c26d972
Add Composer support to FirePHP Core
RobLoach May 29, 2012
e6cbdae
Merge pull request #6 from RobLoach/master
cadorn Jan 19, 2013
8b95809
Fix homepage url
Seldaek Jan 19, 2013
f60753a
Merge pull request #7 from Seldaek/patch-1
cadorn Jan 19, 2013
fabad0f
tag 0.4.0
cadorn Apr 23, 2013
56494f8
Add "files" option to composer.json file to load the global functions…
Nov 6, 2013
72493df
Merge pull request #14 from gpascual/master
cadorn Nov 6, 2013
ff8a595
PHPUnit: moved to standardized file format
Feb 10, 2014
d7de3f4
Merge pull request #15 from bryanlatten/feature-phpunit-default
cadorn Feb 10, 2014
edb6da0
Fixes #16
Feb 26, 2014
bb0af2a
Merge pull request #17 from raulferras/fix-includeLineNumbers
cadorn Feb 26, 2014
d51a06f
- FIX is_resource() bug in PHP (http://php.net/manual/en/function.is-…
Feb 28, 2014
299ddd6
Merge branch 'master' of https://github.com:443/spidgorny/firephp
Mar 17, 2014
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified CHANGELOG.md
100755 → 100644
Empty file.
29 changes: 29 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "firephp/firephp-core",
"description": "Traditional FirePHPCore library for sending PHP variables to the browser.",
"type": "library",
"homepage": "https://github.com/firephp/firephp-core",
"license": "MIT",
"authors": [
{
"name": "Christoph Dorn",
"email": "[email protected]",
"homepage": "http://christophdorn.com"
}
],
"support": {
"forum": "http://groups.google.com/group/firephp-dev",
"issues": "https://github.com/firephp/firephp-core/issues",
"source": "https://github.com/firephp/firephp-core"
},
"autoload": {
"classmap": [
"lib/FirePHPCore/FirePHP.class.php",
"lib/FirePHPCore/fb.php"
],
"files": [
"lib/FirePHPCore/fb.php"
]
}
}

82 changes: 82 additions & 0 deletions examples/oo.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<?php
// Authors:
// - cadorn, Christoph Dorn <[email protected]>, Copyright 2007, New BSD License
// - cadorn, Christoph Dorn <[email protected]>, Copyright 2011, MIT License

/* *** BEGIN LICENSE BLOCK *****
*
* [MIT License](http://www.opensource.org/licenses/mit-license.php)
*
* Copyright (c) 2007+ [Christoph Dorn](http://www.christophdorn.com/)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* ***** END LICENSE BLOCK ***** */


/* NOTE: You must have the FirePHPCore library in your include path */

set_include_path(dirname(dirname(__FILE__)).'/lib'.PATH_SEPARATOR.get_include_path());


require('FirePHPCore/FirePHP.class.php');

/* NOTE: You must have Output Buffering enabled via
ob_start() or output_buffering ini directive. */


$firephp = FirePHP::getInstance(true);


$firephp->fb('Hello World'); /* Defaults to FirePHP::LOG */

$firephp->fb('Log message' ,FirePHP::LOG);
$firephp->fb('Info message' ,FirePHP::INFO);
$firephp->fb('Warn message' ,FirePHP::WARN);
$firephp->fb('Error message',FirePHP::ERROR);

$firephp->fb('Message with label','Label',FirePHP::LOG);

$firephp->fb(array('key1'=>'val1',
'key2'=>array(array('v1','v2'),'v3')),
'TestArray',FirePHP::LOG);

function test($Arg1) {
throw new Exception('Test Exception');
}
try {
test(array('Hello'=>'World'));
} catch(Exception $e) {
/* Log exception including stack trace & variables */
$firephp->fb($e);
}

$firephp->fb('Backtrace to here',FirePHP::TRACE);

$firephp->fb(array('2 SQL queries took 0.06 seconds',array(
array('SQL Statement','Time','Result'),
array('SELECT * FROM Foo','0.02',array('row1','row2')),
array('SELECT * FROM Bar','0.04',array('row1','row2'))
)),FirePHP::TABLE);

/* Will show only in "Server" tab for the request */
$firephp->fb(apache_request_headers(),'RequestHeaders',FirePHP::DUMP);


print 'Hello World';
72 changes: 72 additions & 0 deletions examples/oo.php4
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?php
// Authors:
// - cadorn, Christoph Dorn <[email protected]>, Copyright 2007, New BSD License
// - cadorn, Christoph Dorn <[email protected]>, Copyright 2011, MIT License

/* *** BEGIN LICENSE BLOCK *****
*
* [MIT License](http://www.opensource.org/licenses/mit-license.php)
*
* Copyright (c) 2007+ [Christoph Dorn](http://www.christophdorn.com/)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* ***** END LICENSE BLOCK ***** */


/* NOTE: You must have the FirePHPCore library in your include path */

set_include_path(dirname(dirname(__FILE__)).'/lib'.PATH_SEPARATOR.get_include_path());


require('FirePHPCore/FirePHP.class.php4');

/* NOTE: You must have Output Buffering enabled via
ob_start() or output_buffering ini directive. */


$firephp =& FirePHP::getInstance(true);


$firephp->fb('Hello World'); /* Defaults to FirePHP::LOG */

$firephp->fb('Log message' ,FirePHP_LOG);
$firephp->fb('Info message' ,FirePHP_INFO);
$firephp->fb('Warn message' ,FirePHP_WARN);
$firephp->fb('Error message',FirePHP_ERROR);

$firephp->fb('Message with label','Label',FirePHP_LOG);

$firephp->fb(array('key1'=>'val1',
'key2'=>array(array('v1','v2'),'v3')),
'TestArray',FirePHP_LOG);

$firephp->fb('Backtrace to here',FirePHP_TRACE);

$firephp->fb(array('2 SQL queries took 0.06 seconds',array(
array('SQL Statement','Time','Result'),
array('SELECT * FROM Foo','0.02',array('row1','row2')),
array('SELECT * FROM Bar','0.04',array('row1','row2'))
)),FirePHP_TABLE);

/* Will show only in "Server" tab for the request */
$firephp->fb(apache_request_headers(),'RequestHeaders',FirePHP_DUMP);


print 'Hello World';
79 changes: 79 additions & 0 deletions examples/procedural.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?php
// Authors:
// - cadorn, Christoph Dorn <[email protected]>, Copyright 2007, New BSD License
// - cadorn, Christoph Dorn <[email protected]>, Copyright 2011, MIT License

/* *** BEGIN LICENSE BLOCK *****
*
* [MIT License](http://www.opensource.org/licenses/mit-license.php)
*
* Copyright (c) 2007+ [Christoph Dorn](http://www.christophdorn.com/)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* ***** END LICENSE BLOCK ***** */


/* NOTE: You must have the FirePHPCore library in your include path */

set_include_path(dirname(dirname(__FILE__)).'/lib'.PATH_SEPARATOR.get_include_path());


require('FirePHPCore/fb.php');

/* NOTE: You must have Output Buffering enabled via
ob_start() or output_buffering ini directive. */

fb('Hello World'); /* Defaults to FirePHP::LOG */

fb('Log message' ,FirePHP::LOG);
fb('Info message' ,FirePHP::INFO);
fb('Warn message' ,FirePHP::WARN);
fb('Error message',FirePHP::ERROR);

fb('Message with label','Label',FirePHP::LOG);

fb(array('key1'=>'val1',
'key2'=>array(array('v1','v2'),'v3')),
'TestArray',FirePHP::LOG);

function test($Arg1) {
throw new Exception('Test Exception');
}
try {
test(array('Hello'=>'World'));
} catch(Exception $e) {
/* Log exception including stack trace & variables */
fb($e);
}

fb('Backtrace to here',FirePHP::TRACE);

fb(array('2 SQL queries took 0.06 seconds',array(
array('SQL Statement','Time','Result'),
array('SELECT * FROM Foo','0.02',array('row1','row2')),
array('SELECT * FROM Bar','0.04',array('row1','row2'))
)),FirePHP::TABLE);

/* Will show only in "Server" tab for the request */
fb(apache_request_headers(),'RequestHeaders',FirePHP::DUMP);


print 'Hello World';

69 changes: 69 additions & 0 deletions examples/procedural.php4
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?php
// Authors:
// - cadorn, Christoph Dorn <[email protected]>, Copyright 2007, New BSD License
// - cadorn, Christoph Dorn <[email protected]>, Copyright 2011, MIT License

/* *** BEGIN LICENSE BLOCK *****
*
* [MIT License](http://www.opensource.org/licenses/mit-license.php)
*
* Copyright (c) 2007+ [Christoph Dorn](http://www.christophdorn.com/)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* ***** END LICENSE BLOCK ***** */


/* NOTE: You must have the FirePHPCore library in your include path */

set_include_path(dirname(dirname(__FILE__)).'/lib'.PATH_SEPARATOR.get_include_path());


require('FirePHPCore/fb.php');

/* NOTE: You must have Output Buffering enabled via
ob_start() or output_buffering ini directive. */

fb('Hello World'); /* Defaults to FirePHP::LOG */

fb('Log message' ,FirePHP_LOG);
fb('Info message' ,FirePHP_INFO);
fb('Warn message' ,FirePHP_WARN);
fb('Error message',FirePHP_ERROR);

fb('Message with label','Label',FirePHP_LOG);

fb(array('key1'=>'val1',
'key2'=>array(array('v1','v2'),'v3')),
'TestArray',FirePHP_LOG);

fb('Backtrace to here',FirePHP_TRACE);

fb(array('2 SQL queries took 0.06 seconds',array(
array('SQL Statement','Time','Result'),
array('SELECT * FROM Foo','0.02',array('row1','row2')),
array('SELECT * FROM Bar','0.04',array('row1','row2'))
)),FirePHP_TABLE);

/* Will show only in "Server" tab for the request */
fb(apache_request_headers(),'RequestHeaders',FirePHP_DUMP);


print 'Hello World';

Loading