From 3363b547d550fd034180fa9af9831de898b58789 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 24 Mar 2018 16:59:04 +0900 Subject: [PATCH] =?UTF-8?q?firephp=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.json | 3 +- composer.lock | 38 +++- vendor/composer/autoload_classmap.php | 2 + vendor/composer/autoload_static.php | 2 + vendor/composer/installed.json | 38 ++++ vendor/firephp/firephp-core/.gitignore | 1 + vendor/firephp/firephp-core/CHANGELOG.md | 171 +++++++++++++++++ vendor/firephp/firephp-core/README.md | 75 ++++++++ vendor/firephp/firephp-core/composer.json | 26 +++ vendor/firephp/firephp-core/examples/oo.php | 82 ++++++++ vendor/firephp/firephp-core/examples/oo.php4 | 72 +++++++ .../firephp-core/examples/procedural.php | 79 ++++++++ .../firephp-core/examples/procedural.php4 | 69 +++++++ vendor/firephp/firephp-core/package.json | 43 +++++ vendor/firephp/firephp-core/program.json | 5 + .../firephp-core/tests/API/newlines.php | 12 ++ .../tests/FirePHPCore/FirePHPTest.php | 181 ++++++++++++++++++ .../firephp/firephp-core/tests/TestHelper.php | 55 ++++++ vendor/firephp/firephp-core/tests/phpunit.xml | 2 + .../firephp/firephp-core/workspace/README.md | 19 ++ .../firephp-core/workspace/package.json | 28 +++ .../firephp-core/workspace/program.json | 78 ++++++++ .../firephp-core/workspace/scripts/build.js | 164 ++++++++++++++++ .../firephp-core/workspace/scripts/publish.js | 65 +++++++ .../firephp-core/workspace/tpl/license.tpl.md | 21 ++ .../workspace/tpl/pear.package.tpl.xml | 61 ++++++ .../firephp-core/workspace/tpl/readme.tpl.md | 17 ++ 27 files changed, 1407 insertions(+), 2 deletions(-) create mode 100644 vendor/firephp/firephp-core/.gitignore create mode 100644 vendor/firephp/firephp-core/CHANGELOG.md create mode 100644 vendor/firephp/firephp-core/README.md create mode 100644 vendor/firephp/firephp-core/composer.json create mode 100644 vendor/firephp/firephp-core/examples/oo.php create mode 100644 vendor/firephp/firephp-core/examples/oo.php4 create mode 100644 vendor/firephp/firephp-core/examples/procedural.php create mode 100644 vendor/firephp/firephp-core/examples/procedural.php4 create mode 100644 vendor/firephp/firephp-core/package.json create mode 100644 vendor/firephp/firephp-core/program.json create mode 100644 vendor/firephp/firephp-core/tests/API/newlines.php create mode 100644 vendor/firephp/firephp-core/tests/FirePHPCore/FirePHPTest.php create mode 100644 vendor/firephp/firephp-core/tests/TestHelper.php create mode 100644 vendor/firephp/firephp-core/tests/phpunit.xml create mode 100644 vendor/firephp/firephp-core/workspace/README.md create mode 100644 vendor/firephp/firephp-core/workspace/package.json create mode 100644 vendor/firephp/firephp-core/workspace/program.json create mode 100644 vendor/firephp/firephp-core/workspace/scripts/build.js create mode 100644 vendor/firephp/firephp-core/workspace/scripts/publish.js create mode 100644 vendor/firephp/firephp-core/workspace/tpl/license.tpl.md create mode 100644 vendor/firephp/firephp-core/workspace/tpl/pear.package.tpl.xml create mode 100644 vendor/firephp/firephp-core/workspace/tpl/readme.tpl.md diff --git a/composer.json b/composer.json index 2a4de02c..00f7992c 100644 --- a/composer.json +++ b/composer.json @@ -5,6 +5,7 @@ "league/plates": "^3.3", "guzzlehttp/guzzle": "^6.3", "leafo/scssphp": "^0.7.5", - "monolog/monolog": "^1.23" + "monolog/monolog": "^1.23", + "firephp/firephp-core": "^0.4.0" } } diff --git a/composer.lock b/composer.lock index 03241a67..176e7978 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "d677eea2043ecf409cedbd823caa9302", + "content-hash": "9f2a8e0b8a175d3788e6679dea1d18ff", "packages": [ { "name": "brandonwamboldt/utilphp", @@ -52,6 +52,42 @@ ], "time": "2015-02-02T17:56:14+00:00" }, + { + "name": "firephp/firephp-core", + "version": "v0.4.0", + "source": { + "type": "git", + "url": "https://github.com/firephp/firephp-core.git", + "reference": "fabad0f2503f9577fe8dd2cb1d1c7cd73ed2aacf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/firephp/firephp-core/zipball/fabad0f2503f9577fe8dd2cb1d1c7cd73ed2aacf", + "reference": "fabad0f2503f9577fe8dd2cb1d1c7cd73ed2aacf", + "shasum": "" + }, + "type": "library", + "autoload": { + "classmap": [ + "lib/FirePHPCore/FirePHP.class.php", + "lib/FirePHPCore/fb.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christoph Dorn", + "email": "christoph@christophdorn.com", + "homepage": "http://christophdorn.com" + } + ], + "description": "Traditional FirePHPCore library for sending PHP variables to the browser.", + "homepage": "https://github.com/firephp/firephp-core", + "time": "2013-04-23T15:28:20+00:00" + }, { "name": "guzzlehttp/guzzle", "version": "6.3.0", diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index af2fd3b1..05ac42e4 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -9,6 +9,8 @@ return array( 'DB' => $vendorDir . '/sergeytsalkov/meekrodb/db.class.php', 'DBHelper' => $vendorDir . '/sergeytsalkov/meekrodb/db.class.php', 'DBTransaction' => $vendorDir . '/sergeytsalkov/meekrodb/db.class.php', + 'FB' => $vendorDir . '/firephp/firephp-core/lib/FirePHPCore/fb.php', + 'FirePHP' => $vendorDir . '/firephp/firephp-core/lib/FirePHPCore/FirePHP.class.php', 'MeekroDB' => $vendorDir . '/sergeytsalkov/meekrodb/db.class.php', 'MeekroDBEval' => $vendorDir . '/sergeytsalkov/meekrodb/db.class.php', 'MeekroDBException' => $vendorDir . '/sergeytsalkov/meekrodb/db.class.php', diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 4d27ddf4..2dacdbbf 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -84,6 +84,8 @@ class ComposerStaticInit67b09c83b85c3bc0027caefe5bba171a 'DB' => __DIR__ . '/..' . '/sergeytsalkov/meekrodb/db.class.php', 'DBHelper' => __DIR__ . '/..' . '/sergeytsalkov/meekrodb/db.class.php', 'DBTransaction' => __DIR__ . '/..' . '/sergeytsalkov/meekrodb/db.class.php', + 'FB' => __DIR__ . '/..' . '/firephp/firephp-core/lib/FirePHPCore/fb.php', + 'FirePHP' => __DIR__ . '/..' . '/firephp/firephp-core/lib/FirePHPCore/FirePHP.class.php', 'MeekroDB' => __DIR__ . '/..' . '/sergeytsalkov/meekrodb/db.class.php', 'MeekroDBEval' => __DIR__ . '/..' . '/sergeytsalkov/meekrodb/db.class.php', 'MeekroDBException' => __DIR__ . '/..' . '/sergeytsalkov/meekrodb/db.class.php', diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 54ff0845..bb2e8a00 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -47,6 +47,44 @@ "utility" ] }, + { + "name": "firephp/firephp-core", + "version": "v0.4.0", + "version_normalized": "0.4.0.0", + "source": { + "type": "git", + "url": "https://github.com/firephp/firephp-core.git", + "reference": "fabad0f2503f9577fe8dd2cb1d1c7cd73ed2aacf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/firephp/firephp-core/zipball/fabad0f2503f9577fe8dd2cb1d1c7cd73ed2aacf", + "reference": "fabad0f2503f9577fe8dd2cb1d1c7cd73ed2aacf", + "shasum": "" + }, + "time": "2013-04-23T15:28:20+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "classmap": [ + "lib/FirePHPCore/FirePHP.class.php", + "lib/FirePHPCore/fb.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christoph Dorn", + "email": "christoph@christophdorn.com", + "homepage": "http://christophdorn.com" + } + ], + "description": "Traditional FirePHPCore library for sending PHP variables to the browser.", + "homepage": "https://github.com/firephp/firephp-core" + }, { "name": "guzzlehttp/guzzle", "version": "6.3.0", diff --git a/vendor/firephp/firephp-core/.gitignore b/vendor/firephp/firephp-core/.gitignore new file mode 100644 index 00000000..d1638636 --- /dev/null +++ b/vendor/firephp/firephp-core/.gitignore @@ -0,0 +1 @@ +build/ \ No newline at end of file diff --git a/vendor/firephp/firephp-core/CHANGELOG.md b/vendor/firephp/firephp-core/CHANGELOG.md new file mode 100644 index 00000000..d8b0f86d --- /dev/null +++ b/vendor/firephp/firephp-core/CHANGELOG.md @@ -0,0 +1,171 @@ + +TODO: + + * Fix code indenting in PHP 4 code + * Port maxDepth option to PHP 4 code + +2013-04-23 - Release Version: 0.4.0 + + * No changes + +2011-06-22 - Release Version: 0.4.0rc3 + + * Build fixes + +2011-06-20 - Release Version: 0.4.0rc1 + + * (Issue 163) PHP5 class_exists() throws Exception without second parameter + * (Issue 166) Non-utf8 array values replaced with null + * Cleaned up code formatting [sokolov.innokenty@gmail.com] + * Ensure JSON keys are never NULL (due to NULL key in some arrays) + * Better UTF-8 encoding detection + * Code style cleanup (qbbr) + * Changed license to MIT + * Refactored project + +2010-10-26 - Release Version: 0.3.2 + +2010-10-12 - Release Version: 0.3.2rc6 + + * (Issue 154) getRequestHeader uses "getallheaders" even though it doesn't always exist. [25m] + +2010-10-09 - Release Version: 0.3.2rc5 + + * (Issue 153) FirePHP incorrectly double-encodes UTF8 when mbstring.func_overload is enabled + +2010-10-08 - Release Version: 0.3.2rc4 + + * Trigger upgrade message if part of FirePHP 1.0 + * Removed FirePHP/Init.php inclusion logic and only load FirePHP.class.php if not already loaded + +2010-07-19 - Release Version: 0.3.2rc3 + + * Fixed FirePHP/Init.php inclusion logic + +2010-07-19 - Release Version: 0.3.2rc2 + + * (Issue 145) maxDepth option + * Changed maxObjectDepth and maxArrayDepth option defaults to 5 + * Fixed code indentation + +2010-03-05 - Release Version: 0.3.2rc1 + + * (Issue 114) Allow options to be passed on to basic logging wrappers + * (Issue 122) Filter objectStack property of FirePHP class + * (Issue 123) registerErrorHandler(false) by default + * Added setOption() and getOption() methods + * (Issue 117) dump() method argument validation + * Started adding PHPUnit tests + * Some refactoring to support unit testing + * Deprecated setProcessorUrl() and setRendererUrl() + * Check User-Agent and X-FirePHP-Version header to detect FirePHP on client + * (Issue 135) FirePHP 0.4.3 with Firebug 1.5 changes user agent on the fly + * (Issue 112) Error Predefined Constants Not available for PHP 5.x versions + +2008-06-14 - Release Version: 0.3.1 + + * (Issue 108) ignore class name case in object filter + +2009-05-11 - Release Version: 0.3 +2009-05-01 - Release Version: 0.3.rc.1 + + * (Issue 90) PHP4 compatible version of FirePHPCore + * (Issue 98) Thrown exceptions don't send an HTTP 500 if the FirePHP exception handler is enabled + * (Issue 85) Support associative arrays in encodeTable method in FirePHP.class.php + * (Issue 66) Add a new getOptions() public method in API + * (Issue 82) Define $this->options outside of __construct + * (Issue 72) Message error if group name is null + * (Issue 68) registerErrorHandler() and registerExceptionHandler() should returns previous handlers defined + * (Issue 69) Add the missing register handler in the triumvirate (error, exception, assert) + * (Issue 75) [Error & Exception Handling] Option to not exit script execution + * (Issue 83) Exception handler can't throw exceptions + * (Issue 80) Auto/Pre collapsing groups AND Custom group row colors + +2008-11-09 - Release Version: 0.2.1 + + * (Issue 70) Problem when logging resources + +2008-10-21 - Release Version: 0.2.0 + + * Updated version to 0.2.0 + * Switched to using __sleep instead of __wakeup + * Added support to exclude object members when encoding + * Add support to enable/disable logging + +2008-10-17 - Release Version: 0.2.b.8 + + * New implementation for is_utf8() + * (Issue 55) maxObjectDepth Option not working correctly when using TABLE and EXCEPTION Type + * Bugfix for max[Object|Array]Depth when encoding nested array/object graphs + * Bugfix for FB::setOptions() + +2008-10-16 - Release Version: 0.2.b.7 + + * (Issue 45) Truncate dump when string have non utf8 cars + * (Issue 52) logging will not work when firephp object gets stored in the session. + +2008-10-16 - Release Version: 0.2.b.6 + + * (Issue 37) Display file and line information for each log message + * (Issue 51) Limit output of object graphs + * Bugfix for encoding object members set to NULL|false|'' + +2008-10-14 - Release Version: 0.2.b.5 + + * Updated JsonStream wildfire protocol to be more robust + * (Issue 33) PHP error notices running demos + * (Issue 48) Warning: ReflectionProperty::getValue() expects exactly 1 parameter, 0 given + +2008-10-08 - Release Version: 0.2.b.4 + + * Bugfix for logging objects with recursion + +2008-10-08 - Release Version: 0.2.b.3 + + * (Issue 43) Notice message in 0.2b2 + * Added support for PHP's native json_encode() if available + * Revised object encoder to detect object recursion + +2008-10-07 - Release Version: 0.2.b.2 + + * (Issue 28) Need solution for logging private and protected object variables + * Added trace() and table() aliases in FirePHP class + * (Issue 41) Use PHP doc in FirePHP + * (Issue 39) Static logging method for object oriented API + +2008-10-01 - Release Version: 0.2.b.1 + + * Added support for error and exception handling + * Updated min PHP version for PEAR package to 5.2 + * Added version constant for library + * Gave server library it's own wildfire plugin namespace + * Migrated communication protocol to Wildfire JsonStream + * Added support for console groups using "group" and "groupEnd" + * Added support for log, info, warn and error logging aliases + * (Issue 29) problem with TRACE when using with error_handler + * (Issue 33) PHP error notices running demos + * (Issue 12) undefined index php notice + * Removed closing ?> php tags + * (Issue 13) the code in the fb() function has a second return statement that will never be reached + +2008-07-30 - Release Version: 0.1.1.3 + + * Include __className property in JSON string if variable was an object + * Bugfix - Mis-spelt "Exception" in JSON encoding code + +2008-06-13 - Release Version: 0.1.1.1 + + * Bugfix - Standardize windows paths in stack traces + * Bugfix - Display correct stack trace info in windows environments + * Bugfix - Check $_SERVER['HTTP_USER_AGENT'] before returning + +2008-06-13 - Release Version: 0.1.1 + + * Added support for FirePHP::TRACE log style + * Changed license to New BSD License + +2008-06-06 - Release Version: 0.0.2 + + * Bugfix - Added usleep() to header writing loop to ensure unique index + * Bugfix - Ensure chunk_split does not generate trailing "\n" with empty data header + * Added support for FirePHP::TABLE log style diff --git a/vendor/firephp/firephp-core/README.md b/vendor/firephp/firephp-core/README.md new file mode 100644 index 00000000..b1b32f84 --- /dev/null +++ b/vendor/firephp/firephp-core/README.md @@ -0,0 +1,75 @@ +FirePHPCore +=========== + +**Status: stable** + +> **FirePHP is an advanced logging system that can display PHP variables in the browser as an application is navigated.** +> All communication is out of band to the application meaning that the logging data will not interfere with the normal functioning of the application. + +This project contains the *FirePHPCore* PHP server library and provides a development environment (see `./workspace/`) for working on *FirePHPCore*. + + +Usage +===== + +See [Install/Traditional: FirePHPCore](http://docs.sourcemint.org/firephp.org/firephp/1/-docs/Configuration/Traditional) in the +[FirePHP 1.0 Documentation](http://docs.sourcemint.org/firephp.org/firephp/1/-docs/). + + +Testing +======= + + cd tests + phpunit . + + +Support & Feedback +================== + +See [Support](http://docs.sourcemint.org/firephp.org/firephp/1/-docs/OpenSource#support) in the [FirePHP 1.0 Documentation](http://docs.sourcemint.org/firephp.org/firephp/1/-docs/). + + +Contribute +========== + +See [Contribute](http://docs.sourcemint.org/firephp.org/firephp/1/-docs/OpenSource#contribute) in the [FirePHP 1.0 Documentation](http://docs.sourcemint.org/firephp.org/firephp/1/-docs/). + + +Author +====== + +This project is authored and maintained by [Christoph Dorn](http://www.christophdorn.com/). + + +Documentation License +===================== + +[Creative Commons Attribution-NonCommercial-ShareAlike 3.0](http://creativecommons.org/licenses/by-nc-sa/3.0/) + +Copyright (c) 2007+ [Christoph Dorn](http://www.christophdorn.com/) + + +Code License +============ + +[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. diff --git a/vendor/firephp/firephp-core/composer.json b/vendor/firephp/firephp-core/composer.json new file mode 100644 index 00000000..7cab85a9 --- /dev/null +++ b/vendor/firephp/firephp-core/composer.json @@ -0,0 +1,26 @@ +{ + "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": "christoph@christophdorn.com", + "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" + ] + } +} + diff --git a/vendor/firephp/firephp-core/examples/oo.php b/vendor/firephp/firephp-core/examples/oo.php new file mode 100644 index 00000000..f5f39875 --- /dev/null +++ b/vendor/firephp/firephp-core/examples/oo.php @@ -0,0 +1,82 @@ +, Copyright 2007, New BSD License +// - cadorn, Christoph Dorn , 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'; diff --git a/vendor/firephp/firephp-core/examples/oo.php4 b/vendor/firephp/firephp-core/examples/oo.php4 new file mode 100644 index 00000000..75ec1ee3 --- /dev/null +++ b/vendor/firephp/firephp-core/examples/oo.php4 @@ -0,0 +1,72 @@ +, Copyright 2007, New BSD License +// - cadorn, Christoph Dorn , 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'; diff --git a/vendor/firephp/firephp-core/examples/procedural.php b/vendor/firephp/firephp-core/examples/procedural.php new file mode 100644 index 00000000..d1d3920b --- /dev/null +++ b/vendor/firephp/firephp-core/examples/procedural.php @@ -0,0 +1,79 @@ +, Copyright 2007, New BSD License +// - cadorn, Christoph Dorn , 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'; + diff --git a/vendor/firephp/firephp-core/examples/procedural.php4 b/vendor/firephp/firephp-core/examples/procedural.php4 new file mode 100644 index 00000000..28eb7dc1 --- /dev/null +++ b/vendor/firephp/firephp-core/examples/procedural.php4 @@ -0,0 +1,69 @@ +, Copyright 2007, New BSD License +// - cadorn, Christoph Dorn , 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'; + diff --git a/vendor/firephp/firephp-core/package.json b/vendor/firephp/firephp-core/package.json new file mode 100644 index 00000000..291a9202 --- /dev/null +++ b/vendor/firephp/firephp-core/package.json @@ -0,0 +1,43 @@ +{ + "uid": "https://github.com/firephp/firephp-core/", + "name": "firephp-core", + "version": "0.4.0", + "label": "FirePHP Server Library", + "repositories": [ + { + "type": "git", + "url": "git://github.com/firephp/firephp-core.git" + } + ], + "maintainers": [ + { + "name": "Christoph Dorn", + "email": "christoph@christophdorn.com", + "web": "http://www.christophdorn.com/", + "alias": { + "github": "cadorn" + } + } + ], + "contributors": [ + { + "name": "Christoph Dorn", + "email": "christoph@christophdorn.com", + "web": "http://www.christophdorn.com/", + "alias": { + "github": "cadorn" + } + }, + { + "name": "Michael Day", + "email": "manveru.alma@gmail.com" + }, + { + "name": "Sokolov Innokenty", + "email": "sokolov.innokenty@gmail.com", + "alias": { + "github": "qbbr" + } + } + ] +} \ No newline at end of file diff --git a/vendor/firephp/firephp-core/program.json b/vendor/firephp/firephp-core/program.json new file mode 100644 index 00000000..9889e97a --- /dev/null +++ b/vendor/firephp/firephp-core/program.json @@ -0,0 +1,5 @@ +{ + "extends": { + "location": "./workspace/program.json" + } +} \ No newline at end of file diff --git a/vendor/firephp/firephp-core/tests/API/newlines.php b/vendor/firephp/firephp-core/tests/API/newlines.php new file mode 100644 index 00000000..1e5511e5 --- /dev/null +++ b/vendor/firephp/firephp-core/tests/API/newlines.php @@ -0,0 +1,12 @@ +dump("key", "value"); + $headers = $firephp->_getHeaders(); + $this->assertEquals('15|{"key":"value"}|', $headers['X-Wf-1-2-1-1']); + $firephp->_clearHeaders(); + + $caught = false; + try { + $firephp->dump(array(), "value"); + } catch(Exception $e) { + // Key passed to dump() is not a string + $caught = true; + } + if(!$caught) $this->fail('No exception thrown'); + + $caught = false; + try { + $firephp->dump("key \n\r value", "value"); + } catch(Exception $e) { + // Key passed to dump() contains invalid characters [a-zA-Z0-9-_\.:] + $caught = true; + } + if(!$caught) $this->fail('No exception thrown'); + + $caught = false; + try { + $firephp->dump("keykeykeykkeykeykeykkeykeykeykkeykeykeykkeykeykeykkeykeykeykkeykeykeykkeykeykeykkeykeykeykkeykeykeyk1", "value"); + } catch(Exception $e) { + // Key passed to dump() is longer than 100 characters + $caught = true; + } + if(!$caught) $this->fail('No exception thrown'); + } + + /** + * @issue http://code.google.com/p/firephp/issues/detail?id=123 + */ + public function testRegisterErrorHandler() + { + $firephp = new FirePHP_Test_Class(); + $firephp->setOption("maxObjectDepth", 1); + $firephp->setOption("maxArrayDepth", 1); + + $firephp->registerErrorHandler(); + trigger_error("Hello World"); + $headers = $firephp->_getHeaders(); + if(!isset($headers["X-Wf-1-1-1-1"])) { + $this->fail("Error not in headers"); + } + } + + /** + * @issue http://code.google.com/p/firephp/issues/detail?id=122 + */ + public function testFirePHPClassInstanceLogging() + { + $firephp = new FirePHP_Test_Class(); + + $firephp->log($firephp); + $headers = $firephp->_getHeaders(); + if(!preg_match_all('/"protected:objectStack":"\\*\\* Excluded by Filter \\*\\*"/', $headers['X-Wf-1-1-1-1'], $m)) { + $this->fail("objectStack member contains value"); + } + if(!preg_match_all('/"protected:static:instance":"\\*\\* Excluded by Filter \\*\\*"/', $headers['X-Wf-1-1-1-1'], $m)) { + $this->fail("instance member should not be logged"); + } + if(!preg_match_all('/"undeclared:json_objectStack":"\\*\\* Excluded by Filter \\*\\*"/', $headers['X-Wf-1-1-1-1'], $m)) { + $this->fail("json_objectStack member should not be logged"); + } + } + + /** + * @issue http://code.google.com/p/firephp/issues/detail?id=114 + */ + public function testCustomFileLineOptions() + { + $firephp = new FirePHP_Test_Class(); + + $firephp->log("message", "label", array("File"=>"/file/path", "Line"=>"1")); + $firephp->info("message", "label", array("File"=>"/file/path", "Line"=>"1")); + $firephp->warn("message", "label", array("File"=>"/file/path", "Line"=>"1")); + $firephp->error("message", "label", array("File"=>"/file/path", "Line"=>"1")); + $firephp->dump("key", "value", array("File"=>"/file/path", "Line"=>"1")); + $firephp->table("label", array(array("header"),array("cell")), array("File"=>"/file/path", "Line"=>"1")); + + $headers = $firephp->_getHeaders(); + + $this->assertEquals('75|[{"File":"\/file\/path","Line":"1","Type":"LOG","Label":"label"},"message"]|', $headers['X-Wf-1-1-1-1']); + $this->assertEquals('76|[{"File":"\/file\/path","Line":"1","Type":"INFO","Label":"label"},"message"]|', $headers['X-Wf-1-1-1-2']); + $this->assertEquals('76|[{"File":"\/file\/path","Line":"1","Type":"WARN","Label":"label"},"message"]|', $headers['X-Wf-1-1-1-3']); + $this->assertEquals('77|[{"File":"\/file\/path","Line":"1","Type":"ERROR","Label":"label"},"message"]|', $headers['X-Wf-1-1-1-4']); + $this->assertEquals('15|{"key":"value"}|', $headers['X-Wf-1-2-1-5']); + $this->assertEquals('89|[{"File":"\/file\/path","Line":"1","Type":"TABLE","Label":"label"},[["header"],["cell"]]]|', $headers['X-Wf-1-1-1-6']); + } + + public function testRecursiveEncode() + { + $firephp = new FirePHP_Test_Class(); + + $obj = new FirePHPCore_FirePHPTest__TestObject(); + $obj->child = $obj; + + $firephp->log($obj, "label", array("File"=>"/file/path", "Line"=>"1")); + $headers = $firephp->_getHeaders(); + $this->assertEquals('215|[{"File":"\/file\/path","Line":"1","Type":"LOG","Label":"label"},{"__className":"FirePHPCore_FirePHPTest__TestObject","public:var":"value","undeclared:child":"** Recursion (FirePHPCore_FirePHPTest__TestObject) **"}]|', $headers['X-Wf-1-1-1-1']); + } + + public function testOptions() + { + $firephp = new FirePHP_Test_Class(); + + // defaults + $this->assertEquals(5, $firephp->getOption("maxObjectDepth")); + $this->assertEquals(5, $firephp->getOption("maxArrayDepth")); + $this->assertEquals(true, $firephp->getOption("useNativeJsonEncode")); + $this->assertEquals(true, $firephp->getOption("includeLineNumbers")); + + // modify + $firephp->setOption("maxObjectDepth", 1); + $this->assertEquals(1, $firephp->getOption("maxObjectDepth")); + + // invalid + $caught = false; + try { + $firephp->setOption("invalidName", 1); + } catch(Exception $e) { + $caught = true; + } + if(!$caught) $this->fail('No exception thrown'); + + $caught = false; + try { + $firephp->getOption("invalidName"); + } catch(Exception $e) { + $caught = true; + } + if(!$caught) $this->fail('No exception thrown'); + } + + public function testDeprecatedMethods() + { + $firephp = new FirePHP_Test_Class(); + + $caught = false; + try { + $firephp->setProcessorUrl('URL'); + } catch(Exception $e) { + $caught = true; + $this->assertEquals(E_USER_DEPRECATED, $e->getCode()); + $this->assertEquals('The FirePHP::setProcessorUrl() method is no longer supported', $e->getMessage()); + } + if(!$caught) $this->fail('No deprecation error thrown'); + + $caught = false; + try { + $firephp->setRendererUrl('URL'); + } catch(Exception $e) { + $caught = true; + $this->assertEquals(E_USER_DEPRECATED, $e->getCode()); + $this->assertEquals('The FirePHP::setRendererUrl() method is no longer supported', $e->getMessage()); + } + if(!$caught) $this->fail('No deprecation error thrown'); + } + +} + + +class FirePHPCore_FirePHPTest__TestObject +{ + public $var = "value"; +} diff --git a/vendor/firephp/firephp-core/tests/TestHelper.php b/vendor/firephp/firephp-core/tests/TestHelper.php new file mode 100644 index 00000000..bb65e732 --- /dev/null +++ b/vendor/firephp/firephp-core/tests/TestHelper.php @@ -0,0 +1,55 @@ +_headers; + } + public function _clearHeaders() { + $this->_headers = array(); + } + + + // ###################### + // # Subclassed Methods # + // ###################### + + protected function setHeader($Name, $Value) { + $this->_headers[$Name] = $Value; + } + + protected function headersSent(&$Filename, &$Linenum) { + return false; + } + + public function detectClientExtension() { + return true; + } + +} diff --git a/vendor/firephp/firephp-core/tests/phpunit.xml b/vendor/firephp/firephp-core/tests/phpunit.xml new file mode 100644 index 00000000..b0474e9d --- /dev/null +++ b/vendor/firephp/firephp-core/tests/phpunit.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/vendor/firephp/firephp-core/workspace/README.md b/vendor/firephp/firephp-core/workspace/README.md new file mode 100644 index 00000000..999f09a9 --- /dev/null +++ b/vendor/firephp/firephp-core/workspace/README.md @@ -0,0 +1,19 @@ + +The [PINF JavaScript Loader](https://github.com/pinf/loader-js) is used to provide a development environment and package releases for this project. + +**NOTE:** It is assumed you have the _PINF JavaScript Loader_ mapped to the `commonjs` command and are using the `node` platform by default as explained [here](https://github.com/pinf/loader-js/blob/master/docs/Setup.md). + + +Publishing +========== + + git tag v... + + commonjs -v --script build . + + commonjs -v --script publish . + + +TODO: Auto-upload to PEAR channel server at http://pear.firephp.org/ + +NOTE: For PEAR RC releases: Change release stability to "beta" and capitalize "RC" in release version in package.xml diff --git a/vendor/firephp/firephp-core/workspace/package.json b/vendor/firephp/firephp-core/workspace/package.json new file mode 100644 index 00000000..19e8385e --- /dev/null +++ b/vendor/firephp/firephp-core/workspace/package.json @@ -0,0 +1,28 @@ +{ + "name": "firephp-core", + "engine": [ + "node" + ], + "main": "lib/project.js", + "scripts": { + "build": { + "location": "./", + "module": "/scripts/build.js" + }, + "publish": { + "location": "./", + "module": "/scripts/publish.js" + } + }, + "mappings": { + "nodejs": { + "id": "nodejs.org/" + }, + "pinf": { + "id": "pinf.org/loader/" + }, + "modules": { + "id": "github.com/pinf/modules-js/" + } + } +} \ No newline at end of file diff --git a/vendor/firephp/firephp-core/workspace/program.json b/vendor/firephp/firephp-core/workspace/program.json new file mode 100644 index 00000000..9628b525 --- /dev/null +++ b/vendor/firephp/firephp-core/workspace/program.json @@ -0,0 +1,78 @@ +{ + "boot": "workspace", + "engine": [ + "node" + ], + "packages": { + "workspace": { + "locator": { + "location": "./" + } + }, + "nodejs.org/": { + "provider": "nodejs.org/" + }, + "pinf.org/loader/": { + "provider": "pinf.org/loader/" + }, + "github.com/pinf/modules-js/": { + "locator": { + "archive": "https://github.com/pinf/modules-js/zipball/master" + } + }, + "github.com/kriskowal/q/": { + "locator": { + "archive": "https://github.com/kriskowal/q/zipball/v0.3.0" + }, + "descriptor": { + "uid": "https://github.com/kriskowal/q/", + "dependencies": [ + { + "id": "github.com/pinf/modules-js/" + } + ] + } + }, + "private-registry.appspot.com/cadorn.com/github/com.cadorn.baby/projects/sourcemint/packages/client-js/": { + "locator": { + "archive": "https://github.com/cadorn/com.cadorn.baby/zipball/master", + "path": "projects/sourcemint/packages/client-js" + } + }, + "github.com/cadorn/aws-lib/": { + "locator": { + "archive": "https://github.com/cadorn/aws-lib/zipball/master" + }, + "descriptor": { + "uid": "https://github.com/cadorn/aws-lib/", + "native": true, + "dependencies": [ + { + "id": "registry.npmjs.org/sax/" + }, + { + "id": "registry.npmjs.org/xml2js/" + } + ] + } + }, + "registry.npmjs.org/sax/": { + "locator": { + "archive": "http://registry.npmjs.org/sax/-/sax-0.1.2.tgz" + }, + "descriptor": { + "uid": "http://registry.npmjs.org/sax/", + "native": true + } + }, + "registry.npmjs.org/xml2js/": { + "locator": { + "archive": "http://registry.npmjs.org/xml2js/-/xml2js-0.1.6.tgz" + }, + "descriptor": { + "uid": "http://registry.npmjs.org/xml2js/", + "native": true + } + } + } +} \ No newline at end of file diff --git a/vendor/firephp/firephp-core/workspace/scripts/build.js b/vendor/firephp/firephp-core/workspace/scripts/build.js new file mode 100644 index 00000000..2481d99d --- /dev/null +++ b/vendor/firephp/firephp-core/workspace/scripts/build.js @@ -0,0 +1,164 @@ + +var FILE = require("modules/file"), + Q = require("modules/q"), + SYSTEM = require("modules/system"), + UTIL = require("modules/util"), + JSON = require("modules/json"); + + +var pkgPath = FILE.dirname(FILE.dirname(FILE.dirname(module.id))), + buildPath = pkgPath + "/build", + tplPath = pkgPath + "/workspace/tpl", + version = false; + +exports.getBuildPath = function() +{ + return buildPath; +} + +exports.main = function() +{ + + SYSTEM.exec("rm -Rf " + buildPath, function() + { + FILE.mkdirs(buildPath, 0775); + + SYSTEM.exec("git tag", function(stdout) + { + version = UTIL.trim(stdout).split("\n").pop().match(/^v(.*)$/)[1]; + + // TODO: Compare against version in `../../program.json ~ version` (ensure =) + + module.print("\0cyan(Building version: " + version + "\0)\n"); + + buildZipArchive(function() + { + buildPEARArchive(function() + { + done(); + }); + }); + }); + }); + + function done() + { + module.print("\0green(Done\0)\n"); + } +} + +function buildZipArchive(callback) +{ + var targetBasePath = buildPath + "/FirePHPCore-" + version; + + FILE.mkdirs(targetBasePath, 0775); + + SYSTEM.exec("rsync -r --copy-links --exclude \"- .DS_Store\" --exclude \"- .git/\" --exclude \"- .tmp_*\" " + pkgPath + "/lib " + targetBasePath, function() + { + replaceVariablesInFile(targetBasePath + "/lib/FirePHPCore/FirePHP.class.php"); + replaceVariablesInFile(targetBasePath + "/lib/FirePHPCore/FirePHP.class.php4"); + + SYSTEM.exec("cp -Rf " + pkgPath + "/examples " + targetBasePath, function() + { + next1(); + }); + }); + + function next1() + { + var content = FILE.read(tplPath + "/readme.tpl.md"); + content = content.replace(/%%VERSION%%/g, version); + FILE.write(targetBasePath + "/README.md", content); + + var content = FILE.read(tplPath + "/license.tpl.md"); + FILE.write(targetBasePath + "/LICENSE.md", content); + + FILE.write(buildPath + "/info.json", JSON.encode({ + version: version + })); + + next2(); + } + + function next2() + { + SYSTEM.exec("cd " + buildPath + " ; zip -vr FirePHPCore-" + version + ".zip FirePHPCore-" + version, function(stdout) + { + console.log(stdout); + + callback(); + }); + } +} + +function buildPEARArchive(callback) +{ + var targetBasePath = buildPath + "/pear"; + + FILE.mkdirs(targetBasePath, 0775); + + SYSTEM.exec("rsync -r --copy-links --exclude \"- .DS_Store\" --exclude \"- .git/\" --exclude \"- .tmp_*\" " + pkgPath + "/lib/FirePHPCore/* " + targetBasePath, function() + { + replaceVariablesInFile(targetBasePath + "/FirePHP.class.php"); + replaceVariablesInFile(targetBasePath + "/FirePHP.class.php4"); + + next1(); + }); + + function next1() + { + var content = FILE.read(tplPath + "/pear.package.tpl.xml"); + + var date = new Date(); + content = content.replace(/%%DATE%%/g, date.getFullYear() + "-" + UTIL.padBegin(date.getMonth()+1, 2, "0") + "-" + date.getDate()); + content = content.replace(/%%VERSION%%/g, version); + content = content.replace(/%%STABILITY%%/g, "stable"); + + FILE.write(targetBasePath + "/package.xml", content); + + next2(); + } + + function next2() + { + SYSTEM.exec("pear channel-discover pear.firephp.org", function(stdout) + { + console.log(stdout); + + SYSTEM.exec("cd " + targetBasePath + "; pear package package.xml", function(stdout) + { + console.log(stdout); + + callback(); + }); + }); + } +} + +function replaceVariablesInFile(path) +{ + var content = FILE.read(path); + + // @pinf replace '0.3' with '%%VERSION%%' + var re1 = /\n(.*)\/\/\s*@pinf\s(.*)\n/g; + var match1; + while (match1 = re1.exec(content)) { + var rule = match1[2].match(/^replace (.*?) with (.*)$/); + if(rule) { + // replace variables in rule + var re2 = /%%([^%]*)%%/g; + var match2; + while (match2 = re2.exec(rule[2])) { + var value; + if(match2[1]=="VERSION") { + value = version; + } + rule[2] = rule[2].replace(match2[0], value); + } + match1[1] = match1[1].replace(rule[1], rule[2]); + content = content.replace(match1[0], "\n"+match1[1]+"\n"); + } + } + + FILE.write(path, content); +} diff --git a/vendor/firephp/firephp-core/workspace/scripts/publish.js b/vendor/firephp/firephp-core/workspace/scripts/publish.js new file mode 100644 index 00000000..39106e1b --- /dev/null +++ b/vendor/firephp/firephp-core/workspace/scripts/publish.js @@ -0,0 +1,65 @@ + +var PINF_LOADER = require("pinf/loader"), + SANDBOX = PINF_LOADER.getSandbox(), + FILE = require("modules/file"), + Q = require("modules/q"), + SYSTEM = require("modules/system"), + BUILD = require("./build"), + JSON = require("modules/json"), + SOURCEMINT_CLIENT = false; + +exports.main = function() +{ + module.load({ + id: "private-registry.appspot.com/cadorn.com/github/com.cadorn.baby/projects/sourcemint/packages/client-js/", + descriptor: { + main: "lib/client.js" + } + }, function(id) + { + SOURCEMINT_CLIENT = require(id); + + publish(); + }); +} + +function publish() +{ + var buildPath = BUILD.getBuildPath(), + info = JSON.decode(FILE.read(buildPath + "/info.json")), + descriptor = JSON.decode(FILE.read(FILE.dirname(FILE.dirname(FILE.dirname(module.id))) + "/package.json")); + + var bundles = {}; + bundles["firephp-core.zip"] = { + "type": "zip", + "options": { + "archivePath": buildPath + "/FirePHPCore-" + info.version + ".zip", + } + }; + + var packages = [ + { + "uid": descriptor.uid, + "stream": "stable", + "version": info.version, + "bundles": bundles + } + ]; + + try + { + Q.when(SOURCEMINT_CLIENT.publish(packages), function(info) + { + module.print("\0green(Published:\n"); + console.log(info); + module.print("\0)"); + }, function(e) + { + throw e; + }); + } + catch(e) + { + console.error("Error: " + e); + } +} diff --git a/vendor/firephp/firephp-core/workspace/tpl/license.tpl.md b/vendor/firephp/firephp-core/workspace/tpl/license.tpl.md new file mode 100644 index 00000000..1b0aaf26 --- /dev/null +++ b/vendor/firephp/firephp-core/workspace/tpl/license.tpl.md @@ -0,0 +1,21 @@ +[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. \ No newline at end of file diff --git a/vendor/firephp/firephp-core/workspace/tpl/pear.package.tpl.xml b/vendor/firephp/firephp-core/workspace/tpl/pear.package.tpl.xml new file mode 100644 index 00000000..b9f3d65a --- /dev/null +++ b/vendor/firephp/firephp-core/workspace/tpl/pear.package.tpl.xml @@ -0,0 +1,61 @@ + + + + FirePHPCore + pear.firephp.org + Log variables from PHP to the browser (Firebug Console) + Handles all communication between the PHP code on the server and the client. Also implements all core FirePHP features. + + + Christoph Dorn + cadorn + christoph@christophdorn.com + yes + + + %%DATE%% + + %%VERSION%% + 0.3 + + + + %%STABILITY%% + stable + + + MIT + + No Notes + + + + + + + + + + + + + + + + + 4.0 + + + 1.4.5 + + + + + + + diff --git a/vendor/firephp/firephp-core/workspace/tpl/readme.tpl.md b/vendor/firephp/firephp-core/workspace/tpl/readme.tpl.md new file mode 100644 index 00000000..01264662 --- /dev/null +++ b/vendor/firephp/firephp-core/workspace/tpl/readme.tpl.md @@ -0,0 +1,17 @@ +FirePHPCore Server Library +========================== + +Status: stable + +Version: [%%VERSION%%](https://github.com/firephp/firephp-core/tree/v%%VERSION%%) + +This archive contains the *FirePHPCore* PHP server library. + +Links +----- + + * Documentation: http://docs.sourcemint.org/firephp.org/firephp/1/-docs/ + * Install: http://docs.sourcemint.org/firephp.org/firephp/1/-docs/Configuration/Traditional + * Support: http://docs.sourcemint.org/firephp.org/firephp/1/-docs/OpenSource#support + * Author: [Christoph Dorn](http://www.christophdorn.com/) + * License: [MIT License](http://www.opensource.org/licenses/mit-license.php)