Removing unused libs
11
gulliver/thirdparty/Haanga/.travis.yml
vendored
@@ -1,11 +0,0 @@
|
|||||||
language: php
|
|
||||||
script: cd tests/; phpunit TestSuite.php
|
|
||||||
|
|
||||||
php:
|
|
||||||
- 5.3
|
|
||||||
- 5.4
|
|
||||||
|
|
||||||
before_script:
|
|
||||||
- curl -s http://getcomposer.org/installer | php
|
|
||||||
- php composer.phar install
|
|
||||||
|
|
||||||
30
gulliver/thirdparty/Haanga/LICENSE
vendored
@@ -1,30 +0,0 @@
|
|||||||
Copyright (c) 2011, César D. Rodas <crodas@php.net> and Menéame Comunicacions S.L.
|
|
||||||
All rights reserved.
|
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
|
||||||
modification, are permitted provided that the following conditions are met:
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer.
|
|
||||||
|
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer in the
|
|
||||||
documentation and/or other materials provided with the distribution.
|
|
||||||
|
|
||||||
3. All advertising materials mentioning features or use of this software
|
|
||||||
must display the following acknowledgement:
|
|
||||||
This product includes software developed by César D. Rodas.
|
|
||||||
|
|
||||||
4. Neither the name of the Menéame Comunicacions S.L. nor the
|
|
||||||
names of its contributors may be used to endorse or promote products
|
|
||||||
derived from this software without specific prior written permission.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY MENÉAME COMUNICACIONS S.L. ''AS IS'' AND ANY
|
|
||||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
||||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
DISCLAIMED. IN NO EVENT SHALL CÉSAR D. RODAS BE LIABLE FOR ANY
|
|
||||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
||||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
||||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
||||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
||||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
|
|
||||||
17
gulliver/thirdparty/Haanga/Makefile
vendored
@@ -1,17 +0,0 @@
|
|||||||
all: build test
|
|
||||||
|
|
||||||
build:
|
|
||||||
#plex lib/Haanga/Compiler/Lexer.lex
|
|
||||||
phplemon lib/Haanga/Compiler/Parser.y
|
|
||||||
|
|
||||||
|
|
||||||
test:
|
|
||||||
cd tests; ~/bin/php-5.2/bin/php /usr/bin/phpunit --colors --verbose TestSuite.php
|
|
||||||
cd tests; php /usr/bin/phpunit --coverage-html coverage/ --colors --verbose TestSuite.php
|
|
||||||
|
|
||||||
test-fast:
|
|
||||||
cd tests; php /usr/bin/phpunit --stop-on-failure --colors --verbose TestSuite.php
|
|
||||||
|
|
||||||
|
|
||||||
edit:
|
|
||||||
vim lib/Haanga/Compiler/Parser.y lib/Haanga/Compiler/Tokenizer.php -O
|
|
||||||
3
gulliver/thirdparty/Haanga/README
vendored
@@ -1,3 +0,0 @@
|
|||||||
This project was created* and sponsored by Menéame (http://meneame.net/)
|
|
||||||
|
|
||||||
[*] http://twitter.com/gallir/status/16256084676
|
|
||||||
11
gulliver/thirdparty/Haanga/contrib/dummy.php
vendored
@@ -1,11 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
Class Haanga_Extension_Tag_Dummy
|
|
||||||
{
|
|
||||||
public $is_block = TRUE;
|
|
||||||
|
|
||||||
static function main($html)
|
|
||||||
{
|
|
||||||
return strtolower($html);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Tag_MeneamePagination
|
|
||||||
{
|
|
||||||
public $is_block = FALSE;
|
|
||||||
|
|
||||||
static function generator($cmp, $args, $redirected)
|
|
||||||
{
|
|
||||||
if (count($args) != 3 && count($args) != 4) {
|
|
||||||
throw new Haanga_CompilerException("Memeame_Pagination requires 3 or 4 parameters");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (count($args) == 3) {
|
|
||||||
$args[3] = 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
$current = hvar('mnm_current');
|
|
||||||
$total = hvar('mnm_total');
|
|
||||||
$start = hvar('mnm_start');
|
|
||||||
$end = hvar('mnm_end');
|
|
||||||
$prev = hvar('mnm_prev');
|
|
||||||
$next = hvar('mnm_next');
|
|
||||||
$pages = 'mnm_pages';
|
|
||||||
|
|
||||||
$code = hcode();
|
|
||||||
|
|
||||||
$code->decl($current, $args[0]);
|
|
||||||
$code->decl($total, hexec('ceil', hexpr($args[2], '/', $args[1])) );
|
|
||||||
$code->decl($start, hexec('max', hexpr($current, '-', hexec('intval', hexpr($args[3],'/', 2))), 1));
|
|
||||||
$code->decl($end, hexpr($start, '+', $args[3], '-', 1));
|
|
||||||
$code->decl($prev, hexpr_cond( hexpr(1, '==', $current), FALSE, hexpr($current, '-', 1)) );
|
|
||||||
$code->decl($next, hexpr_cond( hexpr($args[2], '<', 0, '||', $current, '<', $total), hexpr($current, '+', 1), FALSE));
|
|
||||||
$code->decl('mnm_pages', hexec('range', $start, hexpr_cond(hexpr($end,'<', $total), $end, $total)));
|
|
||||||
|
|
||||||
$cmp->set_safe($current);
|
|
||||||
$cmp->set_safe($total);
|
|
||||||
$cmp->set_safe($prev);
|
|
||||||
$cmp->set_safe($next);
|
|
||||||
$cmp->set_safe($pages);
|
|
||||||
|
|
||||||
|
|
||||||
return $code;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
8
gulliver/thirdparty/Haanga/haanga-cli.php
vendored
@@ -1,8 +0,0 @@
|
|||||||
#!/usr/bin/php
|
|
||||||
<?php
|
|
||||||
|
|
||||||
require dirname(__FILE__)."/lib/Haanga.php";
|
|
||||||
|
|
||||||
Haanga::registerAutoload();
|
|
||||||
|
|
||||||
Haanga_Compiler::main_cli();
|
|
||||||
427
gulliver/thirdparty/Haanga/lib/Haanga.php
vendored
@@ -1,427 +0,0 @@
|
|||||||
<?php
|
|
||||||
/*
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
| Copyright (c) 2010 César Rodas and Menéame Comunicacions S.L. |
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
| Redistribution and use in source and binary forms, with or without |
|
|
||||||
| modification, are permitted provided that the following conditions are met: |
|
|
||||||
| 1. Redistributions of source code must retain the above copyright |
|
|
||||||
| notice, this list of conditions and the following disclaimer. |
|
|
||||||
| |
|
|
||||||
| 2. Redistributions in binary form must reproduce the above copyright |
|
|
||||||
| notice, this list of conditions and the following disclaimer in the |
|
|
||||||
| documentation and/or other materials provided with the distribution. |
|
|
||||||
| |
|
|
||||||
| 3. All advertising materials mentioning features or use of this software |
|
|
||||||
| must display the following acknowledgement: |
|
|
||||||
| This product includes software developed by César D. Rodas. |
|
|
||||||
| |
|
|
||||||
| 4. Neither the name of the César D. Rodas nor the |
|
|
||||||
| names of its contributors may be used to endorse or promote products |
|
|
||||||
| derived from this software without specific prior written permission. |
|
|
||||||
| |
|
|
||||||
| THIS SOFTWARE IS PROVIDED BY CÉSAR D. RODAS ''AS IS'' AND ANY |
|
|
||||||
| EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
|
|
||||||
| WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
|
|
||||||
| DISCLAIMED. IN NO EVENT SHALL CÉSAR D. RODAS BE LIABLE FOR ANY |
|
|
||||||
| DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
|
|
||||||
| (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
|
|
||||||
| LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
|
|
||||||
| ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
|
|
||||||
| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
|
|
||||||
| SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE |
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
| Authors: César Rodas <crodas@php.net> |
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (!defined('HAANGA_VERSION')) {
|
|
||||||
/* anyone can override this value to force recompilation */
|
|
||||||
define('HAANGA_VERSION', '1.0.4');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Haanga Runtime class
|
|
||||||
*
|
|
||||||
* Simple class to call templates efficiently. This class aims
|
|
||||||
* to reduce the compilation of a template as less a possible. Also
|
|
||||||
* it will not load in memory the compiler, except when there is not
|
|
||||||
* cache (compiled template) or it is out-dated.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
class Haanga
|
|
||||||
{
|
|
||||||
protected static $cache_dir;
|
|
||||||
protected static $templates_dir='.';
|
|
||||||
protected static $debug;
|
|
||||||
protected static $bootstrap = NULL;
|
|
||||||
protected static $check_ttl;
|
|
||||||
protected static $check_get;
|
|
||||||
protected static $check_set;
|
|
||||||
protected static $use_autoload = TRUE;
|
|
||||||
protected static $hash_filename = TRUE;
|
|
||||||
protected static $compiler = array();
|
|
||||||
|
|
||||||
public static $has_compiled;
|
|
||||||
|
|
||||||
private function __construct()
|
|
||||||
{
|
|
||||||
/* The class can't be instanced */
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function getTemplateDir()
|
|
||||||
{
|
|
||||||
return self::$templates_dir;
|
|
||||||
}
|
|
||||||
|
|
||||||
// configure(Array $opts) {{{
|
|
||||||
/**
|
|
||||||
* Configuration to load Haanga
|
|
||||||
*
|
|
||||||
* Options:
|
|
||||||
*
|
|
||||||
* - (string) cache_dir
|
|
||||||
* - (string) tempalte_dir
|
|
||||||
* - (callback) on_compile
|
|
||||||
* - (boolean) debug
|
|
||||||
* - (int) check_ttl
|
|
||||||
* - (callback) check_get
|
|
||||||
* - (callback) check_set
|
|
||||||
* - (boolean) autoload
|
|
||||||
* - (boolean) use_hash_filename
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
final public static function configure(Array $opts)
|
|
||||||
{
|
|
||||||
foreach ($opts as $option => $value) {
|
|
||||||
switch (strtolower($option)) {
|
|
||||||
case 'cache_dir':
|
|
||||||
self::$cache_dir = $value;
|
|
||||||
break;
|
|
||||||
case 'template_dir':
|
|
||||||
self::$templates_dir = $value;
|
|
||||||
break;
|
|
||||||
case 'bootstrap':
|
|
||||||
if (is_callable($value)) {
|
|
||||||
self::$bootstrap = $value;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'debug':
|
|
||||||
self::enableDebug((bool)$value);
|
|
||||||
break;
|
|
||||||
case 'check_ttl':
|
|
||||||
self::$check_ttl = (int)$value;
|
|
||||||
break;
|
|
||||||
case 'check_get':
|
|
||||||
if (is_callable($value)) {
|
|
||||||
self::$check_get = $value;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'check_set':
|
|
||||||
if (is_callable($value)) {
|
|
||||||
self::$check_set = $value;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'autoload':
|
|
||||||
self::$use_autoload = (bool)$value;
|
|
||||||
break;
|
|
||||||
case 'use_hash_filename':
|
|
||||||
self::$hash_filename = (bool)$value;
|
|
||||||
break;
|
|
||||||
case 'compiler':
|
|
||||||
if (is_array($value)) {
|
|
||||||
self::$compiler = $value;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// checkCacheDir(string $dir) {{{
|
|
||||||
/**
|
|
||||||
* Check the directory where the compiled templates
|
|
||||||
* are stored.
|
|
||||||
*
|
|
||||||
* @param string $dir
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public static function checkCacheDir()
|
|
||||||
{
|
|
||||||
$dir = self::$cache_dir;
|
|
||||||
if (!is_dir($dir)) {
|
|
||||||
$old = umask(0);
|
|
||||||
if (!mkdir($dir, 0777, TRUE)) {
|
|
||||||
throw new Haanga_Exception("{$dir} is not a valid directory");
|
|
||||||
}
|
|
||||||
umask($old);
|
|
||||||
}
|
|
||||||
if (!is_writable($dir)) {
|
|
||||||
throw new Haanga_Exception("{$dir} can't be written");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// enableDebug($bool) {{{
|
|
||||||
public static function enableDebug($bool)
|
|
||||||
{
|
|
||||||
self::$debug = $bool;
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// getCompiler($checkdir=TRUE) {{{
|
|
||||||
/**
|
|
||||||
* This function is a singleton for the Haanga_Compiler_Runtime class.
|
|
||||||
* The instance is already set up properly and resetted.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @param bool $checkdir TRUE
|
|
||||||
*
|
|
||||||
* @return Haanga_Compiler_Runtime
|
|
||||||
*/
|
|
||||||
protected static function getCompiler($checkdir=TRUE)
|
|
||||||
{
|
|
||||||
static $compiler;
|
|
||||||
static $has_checkdir = FALSE;
|
|
||||||
|
|
||||||
if (!$compiler) {
|
|
||||||
|
|
||||||
/* Load needed files (to avoid autoload as much as possible) */
|
|
||||||
$dir = dirname(__FILE__);
|
|
||||||
require_once "{$dir}/Haanga/AST.php";
|
|
||||||
require_once "{$dir}/Haanga/Compiler.php";
|
|
||||||
require_once "{$dir}/Haanga/Compiler/Runtime.php";
|
|
||||||
require_once "{$dir}/Haanga/Compiler/Parser.php";
|
|
||||||
require_once "{$dir}/Haanga/Compiler/Tokenizer.php";
|
|
||||||
require_once "{$dir}/Haanga/Generator/PHP.php";
|
|
||||||
require_once "{$dir}/Haanga/Extension.php";
|
|
||||||
require_once "{$dir}/Haanga/Extension/Filter.php";
|
|
||||||
require_once "{$dir}/Haanga/Extension/Tag.php";
|
|
||||||
|
|
||||||
/* load compiler (done just once) */
|
|
||||||
if (self::$use_autoload) {
|
|
||||||
require_once "{$dir}/Haanga/Loader.php";
|
|
||||||
}
|
|
||||||
|
|
||||||
$compiler = new Haanga_Compiler_Runtime;
|
|
||||||
|
|
||||||
if (self::$bootstrap) {
|
|
||||||
/* call bootstrap hook, just the first time */
|
|
||||||
call_user_func(self::$bootstrap);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (count(self::$compiler) != 0) {
|
|
||||||
foreach (self::$compiler as $opt => $value) {
|
|
||||||
Haanga_Compiler::setOption($opt, $value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($checkdir && !$has_checkdir) {
|
|
||||||
self::checkCacheDir();
|
|
||||||
$has_checkdir = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
$compiler->reset();
|
|
||||||
return $compiler;
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// callback compile(string $tpl, $context=array()) {{{
|
|
||||||
/**
|
|
||||||
* Compile one template and return a PHP function
|
|
||||||
*
|
|
||||||
* @param string $tpl Template body
|
|
||||||
* @param array $context Context variables useful to generate efficient code (for array, objects and array)
|
|
||||||
*
|
|
||||||
* @return callback($vars=array(), $return=TRUE, $block=array())
|
|
||||||
*/
|
|
||||||
public static function compile($tpl, $context=array())
|
|
||||||
{
|
|
||||||
$compiler = self::getCompiler(FALSE);
|
|
||||||
|
|
||||||
foreach ($context as $var => $value) {
|
|
||||||
$compiler->set_context($var, $value);
|
|
||||||
}
|
|
||||||
|
|
||||||
$code = $compiler->compile($tpl);
|
|
||||||
|
|
||||||
return create_function('$' . $compiler->getScopeVariable(NULL, TRUE) . '=array(), $return=TRUE, $blocks=array()', $code);
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// safe_load(string $file, array $vars, bool $return, array $blocks) {{{
|
|
||||||
public static function Safe_Load($file, $vars = array(), $return=FALSE, $blocks=array())
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
|
|
||||||
$tpl = self::$templates_dir.'/'.$file;
|
|
||||||
if (file_exists($tpl)) {
|
|
||||||
/* call load if the tpl file exists */
|
|
||||||
return self::Load($file, $vars, $return, $blocks);
|
|
||||||
}
|
|
||||||
} Catch (Exception $e) {
|
|
||||||
}
|
|
||||||
/* some error but we don't care at all */
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// load(string $file, array $vars, bool $return, array $blocks) {{{
|
|
||||||
/**
|
|
||||||
* Load
|
|
||||||
*
|
|
||||||
* Load template. If the template is already compiled, just the compiled
|
|
||||||
* PHP file will be included an used. If the template is new, or it
|
|
||||||
* had changed, the Haanga compiler is loaded in memory, and the template
|
|
||||||
* is compiled.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @param string $file
|
|
||||||
* @param array $vars
|
|
||||||
* @param bool $return
|
|
||||||
* @param array $blocks
|
|
||||||
*
|
|
||||||
* @return string|NULL
|
|
||||||
*/
|
|
||||||
public static function Load($file, $vars = array(), $return=FALSE, $blocks=array())
|
|
||||||
{
|
|
||||||
if (empty(self::$cache_dir)) {
|
|
||||||
throw new Haanga_Exception("Cache dir or template dir is missing");
|
|
||||||
}
|
|
||||||
|
|
||||||
self::$has_compiled = FALSE;
|
|
||||||
|
|
||||||
$tpl = self::$templates_dir.'/'.$file;
|
|
||||||
$fnc = sha1($tpl);
|
|
||||||
$callback = "haanga_".$fnc;
|
|
||||||
|
|
||||||
if (is_callable($callback)) {
|
|
||||||
return $callback($vars, $return, $blocks);
|
|
||||||
}
|
|
||||||
|
|
||||||
$php = self::$hash_filename ? $fnc : $file;
|
|
||||||
$php = self::$cache_dir.'/'.$php.'.php';
|
|
||||||
|
|
||||||
$check = TRUE;
|
|
||||||
|
|
||||||
if (self::$check_ttl && self::$check_get && self::$check_set) {
|
|
||||||
/* */
|
|
||||||
if (call_user_func(self::$check_get, $callback)) {
|
|
||||||
/* disable checking for the next $check_ttl seconds */
|
|
||||||
$check = FALSE;
|
|
||||||
} else {
|
|
||||||
$result = call_user_func(self::$check_set, $callback, TRUE, self::$check_ttl);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!is_file($php) || ($check && filemtime($tpl) > filemtime($php))) {
|
|
||||||
|
|
||||||
if (!is_file($tpl)) {
|
|
||||||
/* There is no template nor compiled file */
|
|
||||||
throw new Exception("View {$file} doesn't exists");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!is_dir(dirname($php))) {
|
|
||||||
$old = umask(0);
|
|
||||||
mkdir(dirname($php), 0777, TRUE);
|
|
||||||
umask($old);
|
|
||||||
}
|
|
||||||
|
|
||||||
$fp = fopen($php, "a+");
|
|
||||||
/* try to block PHP file */
|
|
||||||
if (!flock($fp, LOCK_EX | LOCK_NB)) {
|
|
||||||
/* couldn't block, another process is already compiling */
|
|
||||||
fclose($fp);
|
|
||||||
if (is_file($php)) {
|
|
||||||
/*
|
|
||||||
** if there is an old version of the cache
|
|
||||||
** load it
|
|
||||||
*/
|
|
||||||
require $php;
|
|
||||||
if (is_callable($callback)) {
|
|
||||||
return $callback($vars, $return, $blocks);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
** no luck, probably the template is new
|
|
||||||
** the compilation will be done, but we won't
|
|
||||||
** save it (we'll use eval instead)
|
|
||||||
*/
|
|
||||||
unset($fp);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* recompile */
|
|
||||||
$compiler = self::getCompiler();
|
|
||||||
|
|
||||||
if (self::$debug) {
|
|
||||||
$compiler->setDebug($php.".dump");
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
$code = $compiler->compile_file($tpl, FALSE, $vars);
|
|
||||||
} catch (Exception $e) {
|
|
||||||
if (isset($fp)) {
|
|
||||||
/*
|
|
||||||
** set the $php file as old (to force future
|
|
||||||
** recompilation)
|
|
||||||
*/
|
|
||||||
touch($php, 300, 300);
|
|
||||||
chmod($php, 0777);
|
|
||||||
}
|
|
||||||
/* re-throw exception */
|
|
||||||
throw $e;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($fp)) {
|
|
||||||
ftruncate($fp, 0); // truncate file
|
|
||||||
fwrite($fp, "<?php".$code);
|
|
||||||
flock($fp, LOCK_UN); // release the lock
|
|
||||||
fclose($fp);
|
|
||||||
} else {
|
|
||||||
/* local eval */
|
|
||||||
eval($code);
|
|
||||||
}
|
|
||||||
|
|
||||||
self::$has_compiled = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!is_callable($callback)) {
|
|
||||||
/* Load the cached PHP file */
|
|
||||||
require $php;
|
|
||||||
if (!is_callable($callback)) {
|
|
||||||
/*
|
|
||||||
really weird case ($php is empty, another process is compiling
|
|
||||||
the $tpl for the first time), so create a lambda function
|
|
||||||
for the template
|
|
||||||
*/
|
|
||||||
$lambda= self::compile(file_get_contents($tpl), $vars);
|
|
||||||
return $lambda($vars, $return, $blocks);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isset($HAANGA_VERSION) || $HAANGA_VERSION != HAANGA_VERSION) {
|
|
||||||
touch($php, 300, 300);
|
|
||||||
chmod($php, 0777);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $callback($vars, $return, $blocks);
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Local variables:
|
|
||||||
* tab-width: 4
|
|
||||||
* c-basic-offset: 4
|
|
||||||
* End:
|
|
||||||
* vim600: sw=4 ts=4 fdm=marker
|
|
||||||
* vim<600: sw=4 ts=4
|
|
||||||
*/
|
|
||||||
545
gulliver/thirdparty/Haanga/lib/Haanga/AST.php
vendored
@@ -1,545 +0,0 @@
|
|||||||
<?php
|
|
||||||
/*
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
| Copyright (c) 2010 César Rodas and Menéame Comunicacions S.L. |
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
| Redistribution and use in source and binary forms, with or without |
|
|
||||||
| modification, are permitted provided that the following conditions are met: |
|
|
||||||
| 1. Redistributions of source code must retain the above copyright |
|
|
||||||
| notice, this list of conditions and the following disclaimer. |
|
|
||||||
| |
|
|
||||||
| 2. Redistributions in binary form must reproduce the above copyright |
|
|
||||||
| notice, this list of conditions and the following disclaimer in the |
|
|
||||||
| documentation and/or other materials provided with the distribution. |
|
|
||||||
| |
|
|
||||||
| 3. All advertising materials mentioning features or use of this software |
|
|
||||||
| must display the following acknowledgement: |
|
|
||||||
| This product includes software developed by César D. Rodas. |
|
|
||||||
| |
|
|
||||||
| 4. Neither the name of the César D. Rodas nor the |
|
|
||||||
| names of its contributors may be used to endorse or promote products |
|
|
||||||
| derived from this software without specific prior written permission. |
|
|
||||||
| |
|
|
||||||
| THIS SOFTWARE IS PROVIDED BY CÉSAR D. RODAS ''AS IS'' AND ANY |
|
|
||||||
| EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
|
|
||||||
| WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
|
|
||||||
| DISCLAIMED. IN NO EVENT SHALL CÉSAR D. RODAS BE LIABLE FOR ANY |
|
|
||||||
| DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
|
|
||||||
| (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
|
|
||||||
| LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
|
|
||||||
| ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
|
|
||||||
| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
|
|
||||||
| SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE |
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
| Authors: César Rodas <crodas@php.net> |
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Simple AST (abstract syntax tree) helper class. This
|
|
||||||
* helps to generate array structure that is then translated by
|
|
||||||
* the Haanga_Generator class.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
class Haanga_AST
|
|
||||||
{
|
|
||||||
public $stack = array();
|
|
||||||
public $current = array();
|
|
||||||
public $doesPrint = FALSE;
|
|
||||||
|
|
||||||
|
|
||||||
// getLast() {{{
|
|
||||||
/**
|
|
||||||
* Return a refernce to the last element
|
|
||||||
* of the AST stack.
|
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
function & getLast()
|
|
||||||
{
|
|
||||||
$f = array();
|
|
||||||
if (count($this->stack) == 0) {
|
|
||||||
return $f;
|
|
||||||
}
|
|
||||||
return $this->stack[count($this->stack)-1];
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
|
|
||||||
static protected function check_type($obj, $type)
|
|
||||||
{
|
|
||||||
if (is_string($obj)) {
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
if (is_object($obj)) {
|
|
||||||
$obj = $obj->getArray();
|
|
||||||
}
|
|
||||||
return isset($obj[$type]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function is_str($arr)
|
|
||||||
{
|
|
||||||
return self::check_type($arr, 'string');
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function is_var($arr)
|
|
||||||
{
|
|
||||||
return self::check_type($arr, 'var');
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function is_exec($arr)
|
|
||||||
{
|
|
||||||
return self::check_type($arr, 'exec');
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function is_expr($arr)
|
|
||||||
{
|
|
||||||
return self::check_type($arr, 'op_expr');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static function str($string)
|
|
||||||
{
|
|
||||||
return array("string" => $string);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function num($number)
|
|
||||||
{
|
|
||||||
return array("number" => $number);
|
|
||||||
}
|
|
||||||
|
|
||||||
function stack_size()
|
|
||||||
{
|
|
||||||
return count($this->stack);
|
|
||||||
}
|
|
||||||
|
|
||||||
function append_ast(Haanga_AST $obj)
|
|
||||||
{
|
|
||||||
$this->end();
|
|
||||||
$obj->end();
|
|
||||||
$this->stack = array_merge($this->stack, $obj->stack);
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
static function constant($str)
|
|
||||||
{
|
|
||||||
return array('constant' => $str);
|
|
||||||
}
|
|
||||||
|
|
||||||
function comment($str)
|
|
||||||
{
|
|
||||||
$this->stack[] = array("op" => "comment", 'comment' => $str);
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
function declare_function($name)
|
|
||||||
{
|
|
||||||
$this->stack[] = array('op' => 'function', 'name' => $name);
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
function do_return($name)
|
|
||||||
{
|
|
||||||
$this->getValue($name, $expr);
|
|
||||||
$this->stack[] = array('op' => 'return', $expr);
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
function do_if($expr)
|
|
||||||
{
|
|
||||||
$this->getValue($expr, $vexpr);
|
|
||||||
$this->stack[] = array('op' => 'if', 'expr' => $vexpr);
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
function do_else()
|
|
||||||
{
|
|
||||||
$this->stack[] = array('op' => 'else');
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
function do_endif()
|
|
||||||
{
|
|
||||||
$this->stack[] = array('op' => 'end_if');
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
function do_endfunction()
|
|
||||||
{
|
|
||||||
$this->stack[] = array('op' => 'end_function');
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
function v()
|
|
||||||
{
|
|
||||||
$var = array();
|
|
||||||
foreach (func_get_args() as $id => $def) {
|
|
||||||
if ($id == 0) {
|
|
||||||
$var[$id] = $def;
|
|
||||||
} else {
|
|
||||||
$this->getValue($def, $value);
|
|
||||||
$var[$id] = $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (count($var) == 1) {
|
|
||||||
$var = $var[0];
|
|
||||||
}
|
|
||||||
$this->current = array('var' => $var);
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
final function __get($property)
|
|
||||||
{
|
|
||||||
$property = strtolower($property);
|
|
||||||
if (isset($this->current[$property])) {
|
|
||||||
return $this->current[$property];
|
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static function fromArrayGetAST($obj)
|
|
||||||
{
|
|
||||||
$class = __CLASS__;
|
|
||||||
if ($obj InstanceOf $class) {
|
|
||||||
return $obj;
|
|
||||||
}
|
|
||||||
foreach (array('op_expr', 'expr_cond', 'exec', 'var', 'string', 'number', 'constant') as $type) {
|
|
||||||
if (isset($obj[$type])) {
|
|
||||||
$nobj = new $class;
|
|
||||||
$nobj->stack[] = $obj;
|
|
||||||
return $nobj;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static function getValue($obj, &$value, $get_all=FALSE)
|
|
||||||
{
|
|
||||||
$class = __CLASS__;
|
|
||||||
|
|
||||||
if ($obj InstanceOf $class) {
|
|
||||||
$value = $obj->getArray($get_all);
|
|
||||||
} else if (is_string($obj)) {
|
|
||||||
$value = self::str($obj);
|
|
||||||
} else if (is_numeric($obj) or $obj === 0) {
|
|
||||||
$value = self::num($obj);
|
|
||||||
} else if ($obj === FALSE) {
|
|
||||||
$value = array('expr' => FALSE);
|
|
||||||
} else if ($obj === TRUE) {
|
|
||||||
$value = array('expr' => TRUE);
|
|
||||||
} else if (is_array($obj)) {
|
|
||||||
foreach (array('op_expr', 'exec', 'var', 'string', 'number', 'constant') as $type) {
|
|
||||||
if (isset($obj[$type])) {
|
|
||||||
$value = $obj;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$h = hcode()->arr();
|
|
||||||
$first = 0;
|
|
||||||
foreach($obj as $key => $value) {
|
|
||||||
if ($key === $first) {
|
|
||||||
$key = NULL;
|
|
||||||
$first++;
|
|
||||||
}
|
|
||||||
$h->element($key, $value);
|
|
||||||
}
|
|
||||||
$value = $h->getArray();
|
|
||||||
} else if ($obj === NULL) {
|
|
||||||
$value = array();
|
|
||||||
} else {
|
|
||||||
var_Dump($obj);
|
|
||||||
throw new Exception("Imposible to get the value of the object");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function getArray($get_all=FALSE)
|
|
||||||
{
|
|
||||||
$this->end();
|
|
||||||
if ($get_all) {
|
|
||||||
return $this->stack;
|
|
||||||
}
|
|
||||||
return isset($this->stack[0]) ? $this->stack[0] : NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
function do_for($index, $min, $max, $step, Haanga_AST $body)
|
|
||||||
{
|
|
||||||
$def = array(
|
|
||||||
'op' => 'for',
|
|
||||||
'index' => $index,
|
|
||||||
'min' => $min,
|
|
||||||
'max' => $max,
|
|
||||||
'step' => $step,
|
|
||||||
);
|
|
||||||
|
|
||||||
$this->stack[] = $def;
|
|
||||||
$this->stack = array_merge($this->stack, $body->getArray(TRUE));
|
|
||||||
$this->stack[] = array('op' => 'end_for');
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
function do_foreach($array, $value, $key, Haanga_AST $body)
|
|
||||||
{
|
|
||||||
foreach (array('array', 'value', 'key') as $var) {
|
|
||||||
if ($$var === NULL) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$var1 = & $$var;
|
|
||||||
if (is_string($var1)) {
|
|
||||||
$var1 = hvar($var1);
|
|
||||||
}
|
|
||||||
if (is_object($var1)) {
|
|
||||||
$var1 = $var1->getArray();
|
|
||||||
}
|
|
||||||
if (empty($var1['var'])) {
|
|
||||||
throw new Exception("Can't iterate, apparently $var isn't a variable");
|
|
||||||
}
|
|
||||||
$var1 = $var1['var'];
|
|
||||||
}
|
|
||||||
$def = array('op' => 'foreach', 'array' => $array, 'value' => $value);
|
|
||||||
if ($key) {
|
|
||||||
$def['key'] = $key;
|
|
||||||
}
|
|
||||||
$this->stack[] = $def;
|
|
||||||
$this->stack = array_merge($this->stack, $body->getArray(TRUE));
|
|
||||||
$this->stack[] = array('op' => 'end_foreach');
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
function do_echo($stmt)
|
|
||||||
{
|
|
||||||
$this->getValue($stmt, $value);
|
|
||||||
$this->stack[] = array('op' => 'print', $value);
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
function do_global($array)
|
|
||||||
{
|
|
||||||
$this->stack[] = array('op' => 'global', 'vars' => $array);
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
function do_exec()
|
|
||||||
{
|
|
||||||
$params = func_get_args();
|
|
||||||
$exec = call_user_func_array('hexec', $params);
|
|
||||||
$this->stack[] = array('op' => 'expr', $exec->getArray());
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
function exec($function)
|
|
||||||
{
|
|
||||||
$this->current = array('exec' => $function, 'args' => array());
|
|
||||||
foreach (func_get_args() as $id => $param) {
|
|
||||||
if ($id > 0) {
|
|
||||||
$this->param($param);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
function expr($operation, $term1, $term2=NULL)
|
|
||||||
{
|
|
||||||
$this->getValue($term1, $value1);
|
|
||||||
if ($term2 !== NULL) {
|
|
||||||
$this->getValue($term2, $value2);
|
|
||||||
} else {
|
|
||||||
$value2 = NULL;
|
|
||||||
}
|
|
||||||
$this->current = array('op_expr' => $operation, $value1, $value2);
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
function expr_cond($expr, $if_true, $if_false)
|
|
||||||
{
|
|
||||||
$this->getValue($expr, $vExpr);
|
|
||||||
$this->getValue($if_true, $vIfTrue);
|
|
||||||
$this->getValue($if_false, $vIfFalse);
|
|
||||||
|
|
||||||
$this->current = array('expr_cond' => $vExpr, 'true' => $vIfTrue, 'false' => $vIfFalse);
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function arr()
|
|
||||||
{
|
|
||||||
$this->current = array('array' => array());
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
function element($key=NULL, $value)
|
|
||||||
{
|
|
||||||
$last = & $this->current;
|
|
||||||
|
|
||||||
if (!isset($last['array'])) {
|
|
||||||
throw new Exception("Invalid call to element()");
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->getValue($value, $val);
|
|
||||||
if ($key !== NULL) {
|
|
||||||
$this->getValue($key, $kval);
|
|
||||||
$val = array('key' => array($kval, $val));
|
|
||||||
}
|
|
||||||
$last['array'][] = $val;
|
|
||||||
}
|
|
||||||
|
|
||||||
function decl_raw($name, $value)
|
|
||||||
{
|
|
||||||
if (is_string($name)) {
|
|
||||||
$name = hvar($name);
|
|
||||||
}
|
|
||||||
$this->getValue($name, $name);
|
|
||||||
$array = array('op' => 'declare', 'name' => $name['var']);
|
|
||||||
foreach (func_get_args() as $id => $value) {
|
|
||||||
if ($id != 0) {
|
|
||||||
$array[] = $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$this->stack[] = $array;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
function decl($name, $value)
|
|
||||||
{
|
|
||||||
if (is_string($name)) {
|
|
||||||
$name = hvar($name);
|
|
||||||
}
|
|
||||||
$this->getValue($name, $name);
|
|
||||||
$array = array('op' => 'declare', 'name' => $name['var']);
|
|
||||||
foreach (func_get_args() as $id => $value) {
|
|
||||||
if ($id != 0) {
|
|
||||||
$this->getValue($value, $stmt);
|
|
||||||
$array[] = $stmt;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$this->stack[] = $array;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
function append($name, $value)
|
|
||||||
{
|
|
||||||
if (is_string($name)) {
|
|
||||||
$name = hvar($name);
|
|
||||||
}
|
|
||||||
$this->getValue($value, $stmt);
|
|
||||||
$this->getValue($name, $name);
|
|
||||||
$this->stack[] = array('op' => 'append_var', 'name' => $name['var'], $stmt);
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
function param($param)
|
|
||||||
{
|
|
||||||
$last = & $this->current;
|
|
||||||
|
|
||||||
if (!isset($last['exec'])) {
|
|
||||||
throw new Exception("Invalid call to param()");
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->getValue($param, $value);
|
|
||||||
$last['args'][] = $value;
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
function end()
|
|
||||||
{
|
|
||||||
if (count($this->current) > 0) {
|
|
||||||
$this->stack[] = $this->current;
|
|
||||||
$this->current = array();
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function hcode()
|
|
||||||
{
|
|
||||||
return new Haanga_AST;
|
|
||||||
}
|
|
||||||
|
|
||||||
function hexpr($term1, $op='expr', $term2=NULL, $op2=NULL)
|
|
||||||
{
|
|
||||||
$code = hcode();
|
|
||||||
switch ($op2) {
|
|
||||||
case '+':
|
|
||||||
case '-':
|
|
||||||
case '/':
|
|
||||||
case '*':
|
|
||||||
case '%':
|
|
||||||
case '||':
|
|
||||||
case '&&':
|
|
||||||
case '<':
|
|
||||||
case '>':
|
|
||||||
case '<=':
|
|
||||||
case '>=':
|
|
||||||
case '==':
|
|
||||||
case '!=':
|
|
||||||
/* call recursive to resolve term2 */
|
|
||||||
$args = func_get_args();
|
|
||||||
$term2 = call_user_func_array('hexpr', array_slice($args, 2));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $code->expr($op, $term1, $term2);
|
|
||||||
}
|
|
||||||
|
|
||||||
function hexpr_cond($expr, $if_true, $if_false)
|
|
||||||
{
|
|
||||||
$code = hcode();
|
|
||||||
$code->expr_cond($expr, $if_true, $if_false);
|
|
||||||
|
|
||||||
return $code;
|
|
||||||
}
|
|
||||||
|
|
||||||
function hexec()
|
|
||||||
{
|
|
||||||
$code = hcode();
|
|
||||||
$args = func_get_args();
|
|
||||||
return call_user_func_array(array($code, 'exec'), $args);
|
|
||||||
}
|
|
||||||
|
|
||||||
function hconst($str)
|
|
||||||
{
|
|
||||||
return Haanga_AST::Constant($str);
|
|
||||||
}
|
|
||||||
|
|
||||||
// hvar() {{{
|
|
||||||
/**
|
|
||||||
* Create the representation of a variable
|
|
||||||
*
|
|
||||||
* @return Haanga_AST
|
|
||||||
*/
|
|
||||||
function hvar()
|
|
||||||
{
|
|
||||||
$args = func_get_args();
|
|
||||||
return hvar_ex($args);
|
|
||||||
}
|
|
||||||
|
|
||||||
function hvar_ex($args)
|
|
||||||
{
|
|
||||||
$code = hcode();
|
|
||||||
return call_user_func_array(array($code, 'v'), $args);
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Local variables:
|
|
||||||
* tab-width: 4
|
|
||||||
* c-basic-offset: 4
|
|
||||||
* End:
|
|
||||||
* vim600: sw=4 ts=4 fdm=marker
|
|
||||||
* vim<600: sw=4 ts=4
|
|
||||||
*/
|
|
||||||
1529
gulliver/thirdparty/Haanga/lib/Haanga/Compiler.php
vendored
@@ -1,55 +0,0 @@
|
|||||||
<?php
|
|
||||||
/*
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
| Copyright (c) 2010 César Rodas and Menéame Comunicacions S.L. |
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
| Redistribution and use in source and binary forms, with or without |
|
|
||||||
| modification, are permitted provided that the following conditions are met: |
|
|
||||||
| 1. Redistributions of source code must retain the above copyright |
|
|
||||||
| notice, this list of conditions and the following disclaimer. |
|
|
||||||
| |
|
|
||||||
| 2. Redistributions in binary form must reproduce the above copyright |
|
|
||||||
| notice, this list of conditions and the following disclaimer in the |
|
|
||||||
| documentation and/or other materials provided with the distribution. |
|
|
||||||
| |
|
|
||||||
| 3. All advertising materials mentioning features or use of this software |
|
|
||||||
| must display the following acknowledgement: |
|
|
||||||
| This product includes software developed by César D. Rodas. |
|
|
||||||
| |
|
|
||||||
| 4. Neither the name of the César D. Rodas nor the |
|
|
||||||
| names of its contributors may be used to endorse or promote products |
|
|
||||||
| derived from this software without specific prior written permission. |
|
|
||||||
| |
|
|
||||||
| THIS SOFTWARE IS PROVIDED BY CÉSAR D. RODAS ''AS IS'' AND ANY |
|
|
||||||
| EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
|
|
||||||
| WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
|
|
||||||
| DISCLAIMED. IN NO EVENT SHALL CÉSAR D. RODAS BE LIABLE FOR ANY |
|
|
||||||
| DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
|
|
||||||
| (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
|
|
||||||
| LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
|
|
||||||
| ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
|
|
||||||
| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
|
|
||||||
| SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE |
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
| Authors: César Rodas <crodas@php.net> |
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Exception Class {{{
|
|
||||||
/**
|
|
||||||
* Exception class
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
class Haanga_Compiler_Exception extends Exception
|
|
||||||
{
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Local variables:
|
|
||||||
* tab-width: 4
|
|
||||||
* c-basic-offset: 4
|
|
||||||
* End:
|
|
||||||
* vim600: sw=4 ts=4 fdm=marker
|
|
||||||
* vim<600: sw=4 ts=4
|
|
||||||
*/
|
|
||||||
@@ -1,408 +0,0 @@
|
|||||||
%name Haanga_
|
|
||||||
%include {
|
|
||||||
/*
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
| Copyright (c) 2010 César Rodas and Menéame Comunicacions S.L. |
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
| Redistribution and use in source and binary forms, with or without |
|
|
||||||
| modification, are permitted provided that the following conditions are met: |
|
|
||||||
| 1. Redistributions of source code must retain the above copyright |
|
|
||||||
| notice, this list of conditions and the following disclaimer. |
|
|
||||||
| |
|
|
||||||
| 2. Redistributions in binary form must reproduce the above copyright |
|
|
||||||
| notice, this list of conditions and the following disclaimer in the |
|
|
||||||
| documentation and/or other materials provided with the distribution. |
|
|
||||||
| |
|
|
||||||
| 3. All advertising materials mentioning features or use of this software |
|
|
||||||
| must display the following acknowledgement: |
|
|
||||||
| This product includes software developed by César D. Rodas. |
|
|
||||||
| |
|
|
||||||
| 4. Neither the name of the César D. Rodas nor the |
|
|
||||||
| names of its contributors may be used to endorse or promote products |
|
|
||||||
| derived from this software without specific prior written permission. |
|
|
||||||
| |
|
|
||||||
| THIS SOFTWARE IS PROVIDED BY CÉSAR D. RODAS ''AS IS'' AND ANY |
|
|
||||||
| EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
|
|
||||||
| WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
|
|
||||||
| DISCLAIMED. IN NO EVENT SHALL CÉSAR D. RODAS BE LIABLE FOR ANY |
|
|
||||||
| DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
|
|
||||||
| (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
|
|
||||||
| LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
|
|
||||||
| ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
|
|
||||||
| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
|
|
||||||
| SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE |
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
| Authors: César Rodas <crodas@php.net> |
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
%declare_class { class Haanga_Compiler_Parser }
|
|
||||||
%include_class {
|
|
||||||
protected $lex;
|
|
||||||
protected $file;
|
|
||||||
|
|
||||||
function __construct($lex, $file='')
|
|
||||||
{
|
|
||||||
$this->lex = $lex;
|
|
||||||
$this->file = $file;
|
|
||||||
}
|
|
||||||
|
|
||||||
function Error($text)
|
|
||||||
{
|
|
||||||
throw new Haanga_Compiler_Exception($text.' in '.$this->file.':'.$this->lex->getLine());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
%parse_accept {
|
|
||||||
}
|
|
||||||
|
|
||||||
%right T_TAG_OPEN.
|
|
||||||
%right T_NOT.
|
|
||||||
%left T_AND.
|
|
||||||
%left T_OR.
|
|
||||||
%nonassoc T_EQ T_NE.
|
|
||||||
%nonassoc T_GT T_GE T_LT T_LE.
|
|
||||||
%nonassoc T_IN.
|
|
||||||
%left T_PLUS T_MINUS T_CONCAT.
|
|
||||||
%left T_TIMES T_DIV T_MOD.
|
|
||||||
%left T_PIPE T_BITWISE.
|
|
||||||
|
|
||||||
%syntax_error {
|
|
||||||
$expect = array();
|
|
||||||
foreach ($this->yy_get_expected_tokens($yymajor) as $token) {
|
|
||||||
$expect[] = self::$yyTokenName[$token];
|
|
||||||
}
|
|
||||||
$this->Error('Unexpected ' . $this->tokenName($yymajor) . '(' . $TOKEN. ')');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
start ::= body(B). { $this->body = B; }
|
|
||||||
|
|
||||||
body(A) ::= body(B) code(C). { A=B; A[] = C; }
|
|
||||||
body(A) ::= . { A = array(); }
|
|
||||||
|
|
||||||
/* List of statements */
|
|
||||||
code(A) ::= T_TAG_OPEN stmts(B). { if (count(B)) B['line'] = $this->lex->getLine(); A = B; }
|
|
||||||
|
|
||||||
code(A) ::= T_HTML(B). {
|
|
||||||
A = array('operation' => 'html', 'html' => B, 'line' => $this->lex->getLine() );
|
|
||||||
}
|
|
||||||
|
|
||||||
code(A) ::= T_COMMENT(B). {
|
|
||||||
B=rtrim(B); A = array('operation' => 'comment', 'comment' => B);
|
|
||||||
}
|
|
||||||
|
|
||||||
code(A) ::= T_PRINT_OPEN expr(B) T_PRINT_CLOSE. {
|
|
||||||
A = array('operation' => 'print_var', 'expr' => B, 'line' => $this->lex->getLine() );
|
|
||||||
}
|
|
||||||
|
|
||||||
stmts(A) ::= T_EXTENDS var_or_string(B) T_TAG_CLOSE. { A = array('operation' => 'base', B); }
|
|
||||||
stmts(A) ::= stmt(B) T_TAG_CLOSE. { A = B; }
|
|
||||||
stmts(A) ::= for_stmt(B). { A = B; }
|
|
||||||
stmts(A) ::= ifchanged_stmt(B). { A = B; }
|
|
||||||
stmts(A) ::= block_stmt(B). { A = B; }
|
|
||||||
stmts(A) ::= filter_stmt(B). { A = B; }
|
|
||||||
stmts(A) ::= if_stmt(B). { A = B; }
|
|
||||||
stmts(A) ::= T_INCLUDE var_or_string(B) T_TAG_CLOSE. { A = array('operation' => 'include', B); }
|
|
||||||
stmts(A) ::= custom_tag(B). { A = B; }
|
|
||||||
stmts(A) ::= alias(B). { A = B; }
|
|
||||||
stmts(A) ::= ifequal(B). { A = B; }
|
|
||||||
stmts(A) ::= T_AUTOESCAPE varname(B) T_TAG_CLOSE body(X) T_TAG_OPEN T_CUSTOM_END(E) T_TAG_CLOSE. {
|
|
||||||
B = strtolower(B);
|
|
||||||
if (B != 'on' && B != 'off') {
|
|
||||||
$this->Error("Invalid autoescape param (".B."), it must be on or off");
|
|
||||||
}
|
|
||||||
if (E != "endautoescape") {
|
|
||||||
$this->Error("Invalid close tag ".E.", it must be endautoescape");
|
|
||||||
}
|
|
||||||
A = array('operation' => 'autoescape', 'value' => B, 'body' => X);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Statement */
|
|
||||||
|
|
||||||
/* CUSTOM TAGS */
|
|
||||||
custom_tag(A) ::= T_CUSTOM_TAG(B) T_TAG_CLOSE. {
|
|
||||||
A = array('operation' => 'custom_tag', 'name' => B, 'list'=>array());
|
|
||||||
}
|
|
||||||
custom_tag(A) ::= T_CUSTOM_TAG(B) T_AS varname(C) T_TAG_CLOSE. {
|
|
||||||
A = array('operation' => 'custom_tag', 'name' => B, 'as' => C, 'list'=>array());
|
|
||||||
}
|
|
||||||
custom_tag(A) ::= T_CUSTOM_TAG(B) params(X) T_TAG_CLOSE. {
|
|
||||||
A = array('operation' => 'custom_tag', 'name' => B, 'list' => X);
|
|
||||||
}
|
|
||||||
custom_tag(A) ::= T_CUSTOM_TAG(B) params(X) T_AS varname(C) T_TAG_CLOSE. {
|
|
||||||
A = array('operation' => 'custom_tag', 'name' => B, 'as' => C, 'list' => X);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* tags as blocks */
|
|
||||||
custom_tag(A) ::= T_CUSTOM_BLOCK(B) T_TAG_CLOSE body(X) T_TAG_OPEN T_CUSTOM_END(C) T_TAG_CLOSE. {
|
|
||||||
if ('end'.B != C) {
|
|
||||||
$this->error("Unexpected ".C);
|
|
||||||
}
|
|
||||||
A = array('operation' => 'custom_tag', 'name' => B, 'body' => X, 'list' => array());
|
|
||||||
}
|
|
||||||
custom_tag(A) ::= T_CUSTOM_BLOCK(B) params(L) T_TAG_CLOSE body(X) T_TAG_OPEN T_CUSTOM_END(C) T_TAG_CLOSE. {
|
|
||||||
if ('end'.B != C) {
|
|
||||||
$this->error("Unexpected ".C);
|
|
||||||
}
|
|
||||||
A = array('operation' => 'custom_tag', 'name' => B, 'body' => X, 'list' => L);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Spacefull is very special, and it is handled in the compiler class */
|
|
||||||
custom_tag(A) ::= T_SPACEFULL T_TAG_CLOSE body(X) T_TAG_OPEN T_CUSTOM_END(C) T_TAG_CLOSE. {
|
|
||||||
if ('endspacefull' != C) {
|
|
||||||
$this->error("Unexpected ".C);
|
|
||||||
}
|
|
||||||
A = array('operation' => 'spacefull', 'body' => X);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* variable alias (easier to handle in the compiler class) */
|
|
||||||
alias(A) ::= T_WITH varname(B) T_AS varname(C) T_TAG_CLOSE body(X) T_TAG_OPEN T_CUSTOM_END(Z) T_TAG_CLOSE. {
|
|
||||||
if (Z != "endwith") {
|
|
||||||
$this->Error("Unexpected ".Z.", expecting endwith");
|
|
||||||
}
|
|
||||||
A = array('operation' => 'alias', 'var' => B, 'as' => C, 'body' => X);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Simple statements (don't require a end_tag or a body ) */
|
|
||||||
stmt(A) ::= T_SET varname(C) T_ASSIGN expr(X). { A = array('operation' => 'set', 'var' => C,'expr' => X); }
|
|
||||||
stmt(A) ::= regroup(B). { A = B; }
|
|
||||||
stmt ::= T_LOAD string(B). {
|
|
||||||
if (!is_file(B) || !Haanga_Compiler::getOption('enable_load')) {
|
|
||||||
$this->error(B." is not a valid file");
|
|
||||||
}
|
|
||||||
require_once B;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* FOR loop */
|
|
||||||
|
|
||||||
for_def(A) ::= T_FOR varname(B) T_IN filtered_var(C) T_TAG_CLOSE . {
|
|
||||||
$var = $this->compiler->get_context(C[0]);
|
|
||||||
if (is_array($var) || $var instanceof Iterator) {
|
|
||||||
/* let's check if it is an object or array */
|
|
||||||
$this->compiler->set_context(B, current($var));
|
|
||||||
}
|
|
||||||
A = array('operation' => 'loop', 'variable' => B, 'index' => NULL, 'array' => C);
|
|
||||||
}
|
|
||||||
|
|
||||||
for_def(A) ::= T_FOR varname(I) T_COMMA varname(B) T_IN filtered_var(C) T_TAG_CLOSE . {
|
|
||||||
$var = $this->compiler->get_context(C[0]);
|
|
||||||
if (is_array($var) || $var instanceof Iterator) {
|
|
||||||
/* let's check if it is an object or array */
|
|
||||||
$this->compiler->set_context(B, current($var));
|
|
||||||
}
|
|
||||||
A = array('operation' => 'loop', 'variable' => B, 'index' => I, 'array' => C);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
for_stmt(A) ::= for_def(B) body(D) T_TAG_OPEN T_CUSTOM_END(Z) T_TAG_CLOSE. {
|
|
||||||
if (Z != "endfor") {
|
|
||||||
$this->Error("Unexpected ".Z.", expecting endfor");
|
|
||||||
}
|
|
||||||
A = B;
|
|
||||||
A['body'] = D;
|
|
||||||
}
|
|
||||||
|
|
||||||
for_stmt(A) ::= T_FOR varname(B) T_IN range(X) T_TAG_CLOSE body(E) T_TAG_OPEN T_CUSTOM_END(Z) T_TAG_CLOSE. {
|
|
||||||
if (Z != "endfor") {
|
|
||||||
$this->Error("Unexpected ".Z.", expecting endfor");
|
|
||||||
}
|
|
||||||
A = array('operation' => 'loop', 'variable' => B, 'range' => X, 'body' => E, 'variable' => B, 'step' => 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
for_stmt(A) ::= T_FOR varname(B) T_IN range(X) T_STEP numvar(S) T_TAG_CLOSE body(E) T_TAG_OPEN T_CUSTOM_END(Z) T_TAG_CLOSE. {
|
|
||||||
if (Z != "endfor") {
|
|
||||||
$this->Error("Unexpected ".Z.", expecting endfor");
|
|
||||||
}
|
|
||||||
A = array('operation' => 'loop', 'variable' => B, 'range' => X, 'body' => E, 'variable' => B, 'step' => S);
|
|
||||||
}
|
|
||||||
|
|
||||||
for_stmt(A) ::= for_def(B) body(D) T_TAG_OPEN T_EMPTY T_TAG_CLOSE body(E) T_TAG_OPEN T_CUSTOM_END(Z) T_TAG_CLOSE. {
|
|
||||||
if (Z != "endfor") {
|
|
||||||
$this->Error("Unexpected ".Z.", expecting endfor");
|
|
||||||
}
|
|
||||||
A = B;
|
|
||||||
A['body'] = D;
|
|
||||||
A['empty'] = E;
|
|
||||||
}
|
|
||||||
/* IF */
|
|
||||||
if_stmt(A) ::= T_IF expr(B) T_TAG_CLOSE body(X) T_TAG_OPEN T_CUSTOM_END(Z) T_TAG_CLOSE. {
|
|
||||||
if (Z != "endif") {
|
|
||||||
$this->Error("Unexpected ".Z.", expecting endif");
|
|
||||||
}
|
|
||||||
A = array('operation' => 'if', 'expr' => B, 'body' => X);
|
|
||||||
}
|
|
||||||
if_stmt(A) ::= T_IF expr(B) T_TAG_CLOSE body(X) T_TAG_OPEN T_ELSE T_TAG_CLOSE body(Y) T_TAG_OPEN T_CUSTOM_END(Z) T_TAG_CLOSE. {
|
|
||||||
if (Z != "endif") {
|
|
||||||
$this->Error("Unexpected ".Z.", expecting endif");
|
|
||||||
}
|
|
||||||
A = array('operation' => 'if', 'expr' => B, 'body' => X, 'else' => Y);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ifchanged */
|
|
||||||
ifchanged_stmt(A) ::= T_IFCHANGED T_TAG_CLOSE body(B) T_TAG_OPEN T_CUSTOM_END(Z) T_TAG_CLOSE. {
|
|
||||||
if (Z != "endifchanged") {
|
|
||||||
$this->Error("Unexpected ".Z.", expecting endifchanged");
|
|
||||||
}
|
|
||||||
A = array('operation' => 'ifchanged', 'body' => B);
|
|
||||||
}
|
|
||||||
|
|
||||||
ifchanged_stmt(A) ::= T_IFCHANGED params(X) T_TAG_CLOSE body(B) T_TAG_OPEN T_CUSTOM_END(Z) T_TAG_CLOSE. {
|
|
||||||
if (Z != "endifchanged") {
|
|
||||||
$this->Error("Unexpected ".Z.", expecting endifchanged");
|
|
||||||
}
|
|
||||||
A = array('operation' => 'ifchanged', 'body' => B, 'check' => X);
|
|
||||||
}
|
|
||||||
ifchanged_stmt(A) ::= T_IFCHANGED T_TAG_CLOSE body(B) T_TAG_OPEN T_ELSE T_TAG_CLOSE body(C) T_TAG_OPEN T_CUSTOM_END(Z) T_TAG_CLOSE. {
|
|
||||||
if (Z != "endifchanged") {
|
|
||||||
$this->Error("Unexpected ".Z.", expecting endifchanged");
|
|
||||||
}
|
|
||||||
A = array('operation' => 'ifchanged', 'body' => B, 'else' => C);
|
|
||||||
}
|
|
||||||
|
|
||||||
ifchanged_stmt(A) ::= T_IFCHANGED params(X) T_TAG_CLOSE body(B) T_TAG_OPEN T_ELSE T_TAG_CLOSE body(C) T_TAG_OPEN T_CUSTOM_END(Z) T_TAG_CLOSE. {
|
|
||||||
if (Z != "endifchanged") {
|
|
||||||
$this->Error("Unexpected ".Z.", expecting endifchanged");
|
|
||||||
}
|
|
||||||
A = array('operation' => 'ifchanged', 'body' => B, 'check' => X, 'else' => C);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ifequal */
|
|
||||||
ifequal(A) ::= T_IFEQUAL fvar_or_string(B) fvar_or_string(C) T_TAG_CLOSE body(X) T_TAG_OPEN T_CUSTOM_END(Z) T_TAG_CLOSE. {
|
|
||||||
if (Z != "endifequal") {
|
|
||||||
$this->Error("Unexpected ".Z.", expecting endifequal");
|
|
||||||
}
|
|
||||||
A = array('operation' => 'ifequal', 'cmp' => '==', 1 => B, 2 => C, 'body' => X);
|
|
||||||
}
|
|
||||||
ifequal(A) ::= T_IFEQUAL fvar_or_string(B) fvar_or_string(C) T_TAG_CLOSE body(X) T_TAG_OPEN T_ELSE T_TAG_CLOSE body(Y) T_TAG_OPEN T_CUSTOM_END(Z) T_TAG_CLOSE. {
|
|
||||||
if (Z != "endifequal") {
|
|
||||||
$this->Error("Unexpected ".Z.", expecting endifequal");
|
|
||||||
}
|
|
||||||
A = array('operation' => 'ifequal', 'cmp' => '==', 1 => B, 2 => C, 'body' => X, 'else' => Y);
|
|
||||||
}
|
|
||||||
ifequal(A) ::= T_IFNOTEQUAL fvar_or_string(B) fvar_or_string(C) T_TAG_CLOSE body(X) T_TAG_OPEN T_CUSTOM_END(Z) T_TAG_CLOSE. {
|
|
||||||
if (Z != "endifnotequal") {
|
|
||||||
$this->Error("Unexpected ".Z.", expecting endifnotequal");
|
|
||||||
}
|
|
||||||
A = array('operation' => 'ifequal', 'cmp' => '!=', 1 => B, 2 => C, 'body' => X);
|
|
||||||
}
|
|
||||||
ifequal(A) ::= T_IFNOTEQUAL fvar_or_string(B) fvar_or_string(C) T_TAG_CLOSE body(X) T_TAG_OPEN T_ELSE T_TAG_CLOSE body(Y) T_TAG_OPEN T_CUSTOM_END(Z) T_TAG_CLOSE. {
|
|
||||||
if (Z != "endifnotequal") {
|
|
||||||
$this->Error("Unexpected ".Z.", expecting endifnotequal");
|
|
||||||
}
|
|
||||||
A = array('operation' => 'ifequal', 'cmp' => '!=', 1 => B, 2 => C, 'body' => X, 'else' => Y);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* block stmt */
|
|
||||||
block_stmt(A) ::= T_BLOCK varname(B) T_TAG_CLOSE body(C) T_TAG_OPEN T_CUSTOM_END(Z) T_TAG_CLOSE. {
|
|
||||||
if (Z != "endblock") {
|
|
||||||
$this->Error("Unexpected ".Z.", expecting endblock");
|
|
||||||
}
|
|
||||||
A = array('operation' => 'block', 'name' => B, 'body' => C);
|
|
||||||
}
|
|
||||||
|
|
||||||
block_stmt(A) ::= T_BLOCK varname(B) T_TAG_CLOSE body(C) T_TAG_OPEN T_CUSTOM_END(Z) varname T_TAG_CLOSE. {
|
|
||||||
if (Z != "endblock") {
|
|
||||||
$this->Error("Unexpected ".Z.", expecting endblock");
|
|
||||||
}
|
|
||||||
A = array('operation' => 'block', 'name' => B, 'body' => C);
|
|
||||||
}
|
|
||||||
|
|
||||||
block_stmt(A) ::= T_BLOCK number(B) T_TAG_CLOSE body(C) T_TAG_OPEN T_CUSTOM_END(Z) T_TAG_CLOSE. {
|
|
||||||
if (Z != "endblock") {
|
|
||||||
$this->Error("Unexpected ".Z.", expecting endblock");
|
|
||||||
}
|
|
||||||
A = array('operation' => 'block', 'name' => B, 'body' => C);
|
|
||||||
}
|
|
||||||
|
|
||||||
block_stmt(A) ::= T_BLOCK number(B) T_TAG_CLOSE body(C) T_TAG_OPEN T_CUSTOM_END(Z) number T_TAG_CLOSE. {
|
|
||||||
if (Z != "endblock") {
|
|
||||||
$this->Error("Unexpected ".Z.", expecting endblock");
|
|
||||||
}
|
|
||||||
A = array('operation' => 'block', 'name' => B, 'body' => C);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* filter stmt */
|
|
||||||
filter_stmt(A) ::= T_FILTER filtered_var(B) T_TAG_CLOSE body(X) T_TAG_OPEN T_CUSTOM_END(Z) T_TAG_CLOSE. {
|
|
||||||
if (Z != "endfilter") {
|
|
||||||
$this->Error("Unexpected ".Z.", expecting endfilter");
|
|
||||||
}
|
|
||||||
A = array('operation' => 'filter', 'functions' => B, 'body' => X);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* regroup stmt */
|
|
||||||
regroup(A) ::= T_REGROUP filtered_var(B) T_BY varname(C) T_AS varname(X). { A=array('operation' => 'regroup', 'array' => B, 'row' => C, 'as' => X); }
|
|
||||||
|
|
||||||
/* variables with filters */
|
|
||||||
filtered_var(A) ::= filtered_var(B) T_PIPE varname_args(C). { A = B; A[] = C; }
|
|
||||||
filtered_var(A) ::= varname_args(B). { A = array(B); }
|
|
||||||
|
|
||||||
varname_args(A) ::= varname(B) T_COLON var_or_string(X) . { A = array(B, 'args'=>array(X)); }
|
|
||||||
varname_args(A) ::= varname(B). { A = B; }
|
|
||||||
|
|
||||||
/* List of variables */
|
|
||||||
params(A) ::= params(B) var_or_string(C). { A = B; A[] = C; }
|
|
||||||
params(A) ::= params(B) T_COMMA var_or_string(C). { A = B; A[] = C; }
|
|
||||||
params(A) ::= var_or_string(B). { A = array(B); }
|
|
||||||
|
|
||||||
|
|
||||||
/* variable or string (used on params) */
|
|
||||||
var_or_string(A) ::= varname(B). { A = array('var' => B); }
|
|
||||||
var_or_string(A) ::= number(B). { A = array('number' => B); }
|
|
||||||
var_or_string(A) ::= T_TRUE|T_FALSE(B). { A = trim(@B); }
|
|
||||||
var_or_string(A) ::= string(B). { A = array('string' => B); }
|
|
||||||
|
|
||||||
/* filtered variables */
|
|
||||||
fvar_or_string(A) ::= filtered_var(B). { A = array('var_filter' => B); }
|
|
||||||
fvar_or_string(A) ::= number(B). { A = array('number' => B); }
|
|
||||||
fvar_or_string(A) ::= T_TRUE|T_FALSE(B). { A = trim(@B); }
|
|
||||||
fvar_or_string(A) ::= string(B). { A = array('string' => B); }
|
|
||||||
|
|
||||||
/* */
|
|
||||||
string(A) ::= T_STRING(B). { A = B; }
|
|
||||||
string(A) ::= T_INTL T_STRING(B) T_RPARENT. { A = B; }
|
|
||||||
|
|
||||||
/* expr */
|
|
||||||
expr(A) ::= T_NOT expr(B). { A = array('op_expr' => 'not', B); }
|
|
||||||
expr(A) ::= expr(B) T_AND(X) expr(C). { A = array('op_expr' => @X, B, C); }
|
|
||||||
expr(A) ::= expr(B) T_OR(X) expr(C). { A = array('op_expr' => @X, B, C); }
|
|
||||||
expr(A) ::= expr(B) T_PLUS|T_MINUS|T_CONCAT(X) expr(C). { A = array('op_expr' => @X, B, C); }
|
|
||||||
expr(A) ::= expr(B) T_EQ|T_NE|T_GT|T_GE|T_LT|T_LE|T_IN(X) expr(C). { A = array('op_expr' => trim(@X), B, C); }
|
|
||||||
expr(A) ::= expr(B) T_TIMES|T_DIV|T_MOD(X) expr(C). { A = array('op_expr' => @X, B, C); }
|
|
||||||
expr(A) ::= expr(B) T_BITWISE|T_PIPE(X) expr(C). { A = array('op_expr' => 'expr', array('op_expr' => @X, B, C)); }
|
|
||||||
expr(A) ::= T_LPARENT expr(B) T_RPARENT. { A = array('op_expr' => 'expr', B); }
|
|
||||||
expr(A) ::= fvar_or_string(B). { A = B; }
|
|
||||||
|
|
||||||
/* Variable name */
|
|
||||||
|
|
||||||
varname(A) ::= varpart(B). { A = current($this->compiler->generate_variable_name(B, false)); }
|
|
||||||
|
|
||||||
varpart(A) ::= varpart(B) T_OBJ|T_DOT varpart_single(C). {
|
|
||||||
if (!is_array(B)) { A = array(B); }
|
|
||||||
else { A = B; } A[]=array('object' => C);
|
|
||||||
}
|
|
||||||
|
|
||||||
varpart(A) ::= varpart(B) T_CLASS varpart_single(C). {
|
|
||||||
if (!is_array(B)) { A = array(B); }
|
|
||||||
else { A = B; } A[]=array('class' => '$'.C);
|
|
||||||
}
|
|
||||||
|
|
||||||
varpart(A) ::= varpart(B) T_BRACKETS_OPEN var_or_string(C) T_BRACKETS_CLOSE. {
|
|
||||||
if (!is_array(B)) { A = array(B); }
|
|
||||||
else { A = B; } A[]=C;
|
|
||||||
}
|
|
||||||
varpart(A) ::= varpart_single(B). { A = B; }
|
|
||||||
|
|
||||||
/* T_BLOCK|T_CUSTOM|T_CUSTOM_BLOCK are also T_ALPHA */
|
|
||||||
varpart_single(A) ::= T_ALPHA|T_BLOCK|T_CUSTOM_TAG|T_CUSTOM_END|T_CUSTOM_BLOCK(B). { A = B; }
|
|
||||||
|
|
||||||
range(A) ::= numvar(B) T_DOTDOT numvar(C). { A = array(B, C); }
|
|
||||||
|
|
||||||
numvar(A) ::= number(B). { A = B; }
|
|
||||||
numvar(A) ::= varname(B). { A = array('var' => B); }
|
|
||||||
|
|
||||||
number(A) ::= T_NUMERIC(B). { A = B; }
|
|
||||||
number(A) ::= T_MINUS T_NUMERIC(B). { A = -1 * (B); }
|
|
||||||
@@ -1,136 +0,0 @@
|
|||||||
<?php
|
|
||||||
/*
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
| Copyright (c) 2010 César Rodas and Menéame Comunicacions S.L. |
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
| Redistribution and use in source and binary forms, with or without |
|
|
||||||
| modification, are permitted provided that the following conditions are met: |
|
|
||||||
| 1. Redistributions of source code must retain the above copyright |
|
|
||||||
| notice, this list of conditions and the following disclaimer. |
|
|
||||||
| |
|
|
||||||
| 2. Redistributions in binary form must reproduce the above copyright |
|
|
||||||
| notice, this list of conditions and the following disclaimer in the |
|
|
||||||
| documentation and/or other materials provided with the distribution. |
|
|
||||||
| |
|
|
||||||
| 3. All advertising materials mentioning features or use of this software |
|
|
||||||
| must display the following acknowledgement: |
|
|
||||||
| This product includes software developed by César D. Rodas. |
|
|
||||||
| |
|
|
||||||
| 4. Neither the name of the César D. Rodas nor the |
|
|
||||||
| names of its contributors may be used to endorse or promote products |
|
|
||||||
| derived from this software without specific prior written permission. |
|
|
||||||
| |
|
|
||||||
| THIS SOFTWARE IS PROVIDED BY CÉSAR D. RODAS ''AS IS'' AND ANY |
|
|
||||||
| EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
|
|
||||||
| WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
|
|
||||||
| DISCLAIMED. IN NO EVENT SHALL CÉSAR D. RODAS BE LIABLE FOR ANY |
|
|
||||||
| DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
|
|
||||||
| (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
|
|
||||||
| LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
|
|
||||||
| ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
|
|
||||||
| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
|
|
||||||
| SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE |
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
| Authors: César Rodas <crodas@php.net> |
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Runtime compiler
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
final class Haanga_Compiler_Runtime extends Haanga_Compiler
|
|
||||||
{
|
|
||||||
|
|
||||||
// get_function_name($name=NULL) {{{
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
function get_function_name($name)
|
|
||||||
{
|
|
||||||
return "haanga_".sha1($name);
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// set_template_name($path) {{{
|
|
||||||
function set_template_name($path)
|
|
||||||
{
|
|
||||||
return $path;
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// Override {% include %} {{{
|
|
||||||
protected function generate_op_include($details, &$body)
|
|
||||||
{
|
|
||||||
$this->do_print($body,
|
|
||||||
hexec('Haanga::Load', $details[0], $this->getScopeVariable(),
|
|
||||||
TRUE,
|
|
||||||
hvar('blocks'))
|
|
||||||
);
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// {% base "" %} {{{
|
|
||||||
function expr_call_base_template()
|
|
||||||
{
|
|
||||||
return hexec('Haanga::Load', $this->subtemplate,
|
|
||||||
$this->getScopeVariable(), TRUE, hvar('blocks'));
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// get_base_template($base) {{{
|
|
||||||
function get_base_template($base)
|
|
||||||
{
|
|
||||||
$this->subtemplate = $base;
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// Override get_Custom_tag {{{
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
function get_custom_tag($name)
|
|
||||||
{
|
|
||||||
static $tag = NULL;
|
|
||||||
if (!$tag) $tag = Haanga_Extension::getInstance('Tag');
|
|
||||||
$loaded = &$this->tags;
|
|
||||||
|
|
||||||
if (!isset($loaded[$name])) {
|
|
||||||
$this->prepend_op->comment("Load tag {$name} definition");
|
|
||||||
$this->prepend_op->do_exec('require_once', $tag->getFilePath($name, FALSE));
|
|
||||||
$loaded[$name] = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $tag->getClassName($name)."::main";
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// Override get_custom_filter {{{
|
|
||||||
function get_custom_filter($name)
|
|
||||||
{
|
|
||||||
static $filter = NULL;
|
|
||||||
if (!$filter) $filter=Haanga_Extension::getInstance('Filter');
|
|
||||||
$loaded = &$this->filters;
|
|
||||||
|
|
||||||
if (!isset($loaded[$name])) {
|
|
||||||
$this->prepend_op->comment("Load filter {$name} definition");
|
|
||||||
$this->prepend_op->do_exec('require_once', $filter->getFilePath($name, FALSE));
|
|
||||||
$loaded[$name] = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $filter->getClassName($name)."::main";
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Local variables:
|
|
||||||
* tab-width: 4
|
|
||||||
* c-basic-offset: 4
|
|
||||||
* End:
|
|
||||||
* vim600: sw=4 ts=4 fdm=marker
|
|
||||||
* vim<600: sw=4 ts=4
|
|
||||||
*/
|
|
||||||
@@ -1,572 +0,0 @@
|
|||||||
<?php
|
|
||||||
/*
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
| Copyright (c) 2010 César Rodas and Menéame Comunicacions S.L. |
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
| Redistribution and use in source and binary forms, with or without |
|
|
||||||
| modification, are permitted provided that the following conditions are met: |
|
|
||||||
| 1. Redistributions of source code must retain the above copyright |
|
|
||||||
| notice, this list of conditions and the following disclaimer. |
|
|
||||||
| |
|
|
||||||
| 2. Redistributions in binary form must reproduce the above copyright |
|
|
||||||
| notice, this list of conditions and the following disclaimer in the |
|
|
||||||
| documentation and/or other materials provided with the distribution. |
|
|
||||||
| |
|
|
||||||
| 3. All advertising materials mentioning features or use of this software |
|
|
||||||
| must display the following acknowledgement: |
|
|
||||||
| This product includes software developed by César D. Rodas. |
|
|
||||||
| |
|
|
||||||
| 4. Neither the name of the César D. Rodas nor the |
|
|
||||||
| names of its contributors may be used to endorse or promote products |
|
|
||||||
| derived from this software without specific prior written permission. |
|
|
||||||
| |
|
|
||||||
| THIS SOFTWARE IS PROVIDED BY CÉSAR D. RODAS ''AS IS'' AND ANY |
|
|
||||||
| EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
|
|
||||||
| WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
|
|
||||||
| DISCLAIMED. IN NO EVENT SHALL CÉSAR D. RODAS BE LIABLE FOR ANY |
|
|
||||||
| DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
|
|
||||||
| (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
|
|
||||||
| LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
|
|
||||||
| ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
|
|
||||||
| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
|
|
||||||
| SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE |
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
| Authors: César Rodas <crodas@php.net> |
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
*/
|
|
||||||
|
|
||||||
class HG_Parser Extends Haanga_Compiler_Parser
|
|
||||||
{
|
|
||||||
/* subclass to made easier references to constants */
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Hand-written Tokenizer class inspired by SQLite's tokenize.c
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
class Haanga_Compiler_Tokenizer
|
|
||||||
{
|
|
||||||
/* they are case sensitive and sorted! */
|
|
||||||
static $keywords = array(
|
|
||||||
'AND' => HG_Parser::T_AND,
|
|
||||||
'FALSE' => HG_Parser::T_FALSE,
|
|
||||||
'NOT' => HG_Parser::T_NOT,
|
|
||||||
'OR' => HG_Parser::T_OR,
|
|
||||||
'TRUE' => HG_Parser::T_TRUE,
|
|
||||||
'_(' => HG_Parser::T_INTL,
|
|
||||||
'as' => HG_Parser::T_AS,
|
|
||||||
'autoescape' => HG_Parser::T_AUTOESCAPE,
|
|
||||||
'block' => HG_Parser::T_BLOCK,
|
|
||||||
'by' => HG_Parser::T_BY,
|
|
||||||
'else' => HG_Parser::T_ELSE,
|
|
||||||
'empty' => HG_Parser::T_EMPTY,
|
|
||||||
'extends' => HG_Parser::T_EXTENDS,
|
|
||||||
'filter' => HG_Parser::T_FILTER,
|
|
||||||
'for' => HG_Parser::T_FOR,
|
|
||||||
'if' => HG_Parser::T_IF,
|
|
||||||
'ifchanged' => HG_Parser::T_IFCHANGED,
|
|
||||||
'ifequal' => HG_Parser::T_IFEQUAL,
|
|
||||||
'ifnotequal' => HG_Parser::T_IFNOTEQUAL,
|
|
||||||
'in' => HG_Parser::T_IN,
|
|
||||||
'include' => HG_Parser::T_INCLUDE,
|
|
||||||
'load' => HG_Parser::T_LOAD,
|
|
||||||
'not' => HG_Parser::T_NOT,
|
|
||||||
'regroup' => HG_Parser::T_REGROUP,
|
|
||||||
'set' => HG_Parser::T_SET,
|
|
||||||
'spacefull' => HG_Parser::T_SPACEFULL,
|
|
||||||
'step' => HG_Parser::T_STEP,
|
|
||||||
'with' => HG_Parser::T_WITH,
|
|
||||||
);
|
|
||||||
|
|
||||||
/* common operations */
|
|
||||||
static $operators_single = array(
|
|
||||||
'!' => HG_Parser::T_NOT,
|
|
||||||
'%' => HG_Parser::T_MOD,
|
|
||||||
'&' => HG_Parser::T_BITWISE,
|
|
||||||
'(' => HG_Parser::T_LPARENT,
|
|
||||||
')' => HG_Parser::T_RPARENT,
|
|
||||||
'*' => HG_Parser::T_TIMES,
|
|
||||||
'+' => HG_Parser::T_PLUS,
|
|
||||||
',' => HG_Parser::T_COMMA,
|
|
||||||
'-' => HG_Parser::T_MINUS,
|
|
||||||
'.' => HG_Parser::T_DOT,
|
|
||||||
'/' => HG_Parser::T_DIV,
|
|
||||||
':' => HG_Parser::T_COLON,
|
|
||||||
'<' => HG_Parser::T_LT,
|
|
||||||
'=' => HG_Parser::T_ASSIGN,
|
|
||||||
'>' => HG_Parser::T_GT,
|
|
||||||
'[' => HG_Parser::T_BRACKETS_OPEN,
|
|
||||||
']' => HG_Parser::T_BRACKETS_CLOSE,
|
|
||||||
'|' => HG_Parser::T_PIPE,
|
|
||||||
);
|
|
||||||
static $operators = array(
|
|
||||||
'!==' => HG_Parser::T_NE,
|
|
||||||
'!=' => HG_Parser::T_NE,
|
|
||||||
'&&' => HG_Parser::T_AND,
|
|
||||||
'->' => HG_Parser::T_OBJ,
|
|
||||||
'..' => HG_Parser::T_DOTDOT,
|
|
||||||
'::' => HG_Parser::T_CLASS,
|
|
||||||
'<<' => HG_Parser::T_BITWISE,
|
|
||||||
'<=' => HG_Parser::T_LE,
|
|
||||||
'===' => HG_Parser::T_EQ,
|
|
||||||
'==' => HG_Parser::T_EQ,
|
|
||||||
'>=' => HG_Parser::T_GE,
|
|
||||||
'>>' => HG_Parser::T_BITWISE,
|
|
||||||
'||' => HG_Parser::T_OR,
|
|
||||||
);
|
|
||||||
|
|
||||||
static $close_tags = array();
|
|
||||||
|
|
||||||
static $open_tag = "{%";
|
|
||||||
static $end_tag = "%}";
|
|
||||||
static $open_comment = "{#";
|
|
||||||
static $end_comment = "#}";
|
|
||||||
static $open_print = "{{";
|
|
||||||
static $end_print = "}}";
|
|
||||||
|
|
||||||
public $open_tags;
|
|
||||||
public $value;
|
|
||||||
public $token;
|
|
||||||
public $status = self::IN_NONE;
|
|
||||||
|
|
||||||
const IN_NONE = 0;
|
|
||||||
const IN_HTML = 1;
|
|
||||||
const IN_TAG = 2;
|
|
||||||
const IN_ECHO = 3;
|
|
||||||
|
|
||||||
function __construct($data, $compiler, $file)
|
|
||||||
{
|
|
||||||
$this->data = $data;
|
|
||||||
$this->compiler = $compiler;
|
|
||||||
$this->line = 1;
|
|
||||||
$this->N = 0;
|
|
||||||
$this->file = $file;
|
|
||||||
$this->length = strlen($data);
|
|
||||||
|
|
||||||
|
|
||||||
/*$tmp1 = self::$operators;
|
|
||||||
$tmp2 = $tmp1;
|
|
||||||
ksort($tmp2);
|
|
||||||
var_dump($tmp2, $tmp1 === $tmp2);die();/**/
|
|
||||||
|
|
||||||
self::$close_tags =array(
|
|
||||||
self::$end_tag => HG_Parser::T_TAG_CLOSE,
|
|
||||||
self::$end_print => HG_Parser::T_PRINT_CLOSE,
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
$this->open_tags = array(
|
|
||||||
self::$open_tag => HG_Parser::T_TAG_OPEN,
|
|
||||||
self::$open_print => HG_Parser::T_PRINT_OPEN,
|
|
||||||
self::$open_comment => HG_Parser::T_COMMENT,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function yylex()
|
|
||||||
{
|
|
||||||
$this->token = NULL;
|
|
||||||
|
|
||||||
if ($this->length == $this->N) {
|
|
||||||
if ($this->status != self::IN_NONE && $this->status != self::IN_HTML) {
|
|
||||||
$this->Error("Unexpected end");
|
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->status == self::IN_NONE) {
|
|
||||||
$i = &$this->N;
|
|
||||||
$data = substr($this->data, $i, 12);
|
|
||||||
|
|
||||||
static $lencache = array();
|
|
||||||
foreach ($this->open_tags as $value => $token) {
|
|
||||||
if (!isset($lencache[$value])) {
|
|
||||||
$lencache[$value] = strlen($value);
|
|
||||||
}
|
|
||||||
$len = $lencache[$value];
|
|
||||||
if (strncmp($data, $value, $len) == 0) {
|
|
||||||
$this->value = $value;
|
|
||||||
$this->token = $token;
|
|
||||||
$i += $len;
|
|
||||||
switch ($this->token) {
|
|
||||||
case HG_Parser::T_TAG_OPEN:
|
|
||||||
$this->status = self::IN_TAG;
|
|
||||||
break;
|
|
||||||
case HG_Parser::T_COMMENT:
|
|
||||||
$zdata = & $this->data;
|
|
||||||
|
|
||||||
if (($pos=strpos($zdata, self::$end_comment, $i)) === FALSE) {
|
|
||||||
$this->error("unexpected end");
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->value = substr($zdata, $i, $pos-2);
|
|
||||||
$this->status = self::IN_NONE;
|
|
||||||
$i = $pos + 2;
|
|
||||||
break;
|
|
||||||
case HG_Parser::T_PRINT_OPEN:
|
|
||||||
$this->status = self::IN_ECHO;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->status = self::IN_HTML;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch ($this->status)
|
|
||||||
{
|
|
||||||
case self::IN_TAG:
|
|
||||||
case self::IN_ECHO:
|
|
||||||
$this->yylex_main();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$this->yylex_html();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (empty($this->token)) {
|
|
||||||
if ($this->status != self::IN_NONE && $this->status != self::IN_HTML) {
|
|
||||||
$this->Error("Unexpected end");
|
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function yylex_html()
|
|
||||||
{
|
|
||||||
$data = &$this->data;
|
|
||||||
$i = &$this->N;
|
|
||||||
|
|
||||||
foreach ($this->open_tags as $value => $status) {
|
|
||||||
$pos = strpos($data, $value, $i);
|
|
||||||
if ($pos === FALSE) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (!isset($lowest_pos) || $lowest_pos > $pos) {
|
|
||||||
$lowest_pos = $pos;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($lowest_pos)) {
|
|
||||||
$this->value = substr($data, $i, $lowest_pos-$i);
|
|
||||||
$this->token = HG_Parser::T_HTML;
|
|
||||||
$this->status = self::IN_NONE;
|
|
||||||
$i += $lowest_pos - $i;
|
|
||||||
} else {
|
|
||||||
$this->value = substr($data, $i);
|
|
||||||
$this->token = HG_Parser::T_HTML;
|
|
||||||
$i = $this->length;
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->line += substr_count($this->value, "\n");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function yylex_main()
|
|
||||||
{
|
|
||||||
$data = &$this->data;
|
|
||||||
|
|
||||||
for ($i=&$this->N; is_null($this->token) && $i < $this->length; ++$i) {
|
|
||||||
switch ($data[$i]) {
|
|
||||||
|
|
||||||
/* strings {{{ */
|
|
||||||
case '"':
|
|
||||||
case "'":
|
|
||||||
$end = $data[$i];
|
|
||||||
$value = "";
|
|
||||||
while ($data[++$i] != $end) {
|
|
||||||
switch ($data[$i]) {
|
|
||||||
case "\\":
|
|
||||||
switch ($data[++$i]) {
|
|
||||||
case "n":
|
|
||||||
$value .= "\n";
|
|
||||||
break;
|
|
||||||
case "t":
|
|
||||||
$value .= "\t";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$value .= $data[$i];
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case $end:
|
|
||||||
--$i;
|
|
||||||
break 2;
|
|
||||||
default:
|
|
||||||
if ($data[$i] == "\n") {
|
|
||||||
$this->line++;
|
|
||||||
}
|
|
||||||
$value .= $data[$i];
|
|
||||||
}
|
|
||||||
if (!isset($data[$i+1])) {
|
|
||||||
$this->Error("unclosed string");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$this->value = $value;
|
|
||||||
$this->token = HG_Parser::T_STRING;
|
|
||||||
break;
|
|
||||||
/* }}} */
|
|
||||||
|
|
||||||
/* number {{{ */
|
|
||||||
case '0': case '1': case '2': case '3': case '4':
|
|
||||||
case '5': case '6': case '7': case '8': case '9':
|
|
||||||
$value = "";
|
|
||||||
$dot = FALSE;
|
|
||||||
for ($e=0; $i < $this->length; ++$e, ++$i) {
|
|
||||||
switch ($data[$i]) {
|
|
||||||
case '0': case '1': case '2': case '3': case '4':
|
|
||||||
case '5': case '6': case '7': case '8': case '9':
|
|
||||||
$value .= $data[$i];
|
|
||||||
break;
|
|
||||||
case '.':
|
|
||||||
if (!$dot) {
|
|
||||||
$value .= ".";
|
|
||||||
$dot = TRUE;
|
|
||||||
} else {
|
|
||||||
$this->error("Invalid number");
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break 2; /* break the main loop */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!$this->is_token_end($data[$i]) &&
|
|
||||||
!isset(self::$operators_single[$data[$i]]) || $value[$e-1] == '.') {
|
|
||||||
$this->error("Unexpected '{$data[$i]}'");
|
|
||||||
}
|
|
||||||
$this->value = $value;
|
|
||||||
$this->token = HG_Parser::T_NUMERIC;
|
|
||||||
break 2;
|
|
||||||
/* }}} */
|
|
||||||
|
|
||||||
case "\n": case " ": case "\t": case "\r": case "\f":
|
|
||||||
for (; is_null($this->token) && $i < $this->length; ++$i) {
|
|
||||||
switch ($data[$i]) {
|
|
||||||
case "\n":
|
|
||||||
$this->line++;
|
|
||||||
case " ": case "\t": case "\r": case "\f":
|
|
||||||
break;
|
|
||||||
case '.':
|
|
||||||
if ($data[$i+1] != '.') {
|
|
||||||
$this->token = HG_Parser::T_CONCAT;
|
|
||||||
$this->value = '.';
|
|
||||||
$i++;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
/* break main loop */
|
|
||||||
/* and decrease because last processed byte */
|
|
||||||
/* wasn't a dot (T_CONCAT) */
|
|
||||||
--$i;
|
|
||||||
break 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break; /* whitespaces are ignored */
|
|
||||||
default:
|
|
||||||
if (!$this->getTag() && !$this->getOperator()) {
|
|
||||||
$alpha = $this->getAlpha();
|
|
||||||
if ($alpha === FALSE) {
|
|
||||||
$this->error("error: unexpected ".substr($data, $i));
|
|
||||||
}
|
|
||||||
static $tag=NULL;
|
|
||||||
if (!$tag) {
|
|
||||||
$tag = Haanga_Extension::getInstance('Tag');
|
|
||||||
}
|
|
||||||
$value = $tag->isValid($alpha);
|
|
||||||
$this->token = $value ? $value : HG_Parser::T_ALPHA;
|
|
||||||
$this->value = $alpha;
|
|
||||||
|
|
||||||
}
|
|
||||||
break 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->token == HG_Parser::T_TAG_CLOSE ||
|
|
||||||
$this->token == HG_Parser::T_PRINT_CLOSE) {
|
|
||||||
$this->status = self::IN_NONE;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function getTag()
|
|
||||||
{
|
|
||||||
static $lencache = array();
|
|
||||||
|
|
||||||
$i = &$this->N;
|
|
||||||
$data = substr($this->data, $i, 12);
|
|
||||||
foreach (self::$close_tags as $value => $token) {
|
|
||||||
if (!isset($lencache[$value])) {
|
|
||||||
$lencache[$value] = strlen($value);
|
|
||||||
}
|
|
||||||
$len = $lencache[$value];
|
|
||||||
if (strncmp($data, $value, $len) == 0) {
|
|
||||||
$this->token = $token;
|
|
||||||
$this->value = $value;
|
|
||||||
$i += $len;
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (self::$keywords as $value => $token) {
|
|
||||||
if (!isset($lencache[$value])) {
|
|
||||||
$lencache[$value] = strlen($value);
|
|
||||||
}
|
|
||||||
$len = $lencache[$value];
|
|
||||||
switch (strncmp($data, $value, $len)) {
|
|
||||||
case -1:
|
|
||||||
break 2;
|
|
||||||
case 0: // match
|
|
||||||
if (isset($data[$len]) && !$this->is_token_end($data[$len])) {
|
|
||||||
/* probably a variable name TRUEfoo (and not TRUE) */
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$this->token = $token;
|
|
||||||
$this->value = $value;
|
|
||||||
$i += $len;
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* /end([a-zA-Z][a-zA-Z0-9]*)/ */
|
|
||||||
if (strncmp($data, "end", 3) == 0) {
|
|
||||||
$this->value = $this->getAlpha();
|
|
||||||
$this->token = HG_Parser::T_CUSTOM_END;
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
function Error($text)
|
|
||||||
{
|
|
||||||
throw new Haanga_Compiler_Exception($text." in ".$this->file.":".$this->line);
|
|
||||||
}
|
|
||||||
|
|
||||||
function getOperator()
|
|
||||||
{
|
|
||||||
static $lencache = array();
|
|
||||||
|
|
||||||
$i = &$this->N;
|
|
||||||
$data = substr($this->data, $i, 12);
|
|
||||||
|
|
||||||
foreach (self::$operators as $value => $token) {
|
|
||||||
if (!isset($lencache[$value])) {
|
|
||||||
$lencache[$value] = strlen($value);
|
|
||||||
}
|
|
||||||
$len = $lencache[$value];
|
|
||||||
switch (strncmp($data, $value, $len)) {
|
|
||||||
case -1:
|
|
||||||
if (strlen($data) == $len) {
|
|
||||||
break 2;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 0:
|
|
||||||
$this->token = $token;
|
|
||||||
$this->value = $value;
|
|
||||||
$i += $len;
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$data = $this->data[$i];
|
|
||||||
foreach (self::$operators_single as $value => $token) {
|
|
||||||
if ($value == $data) {
|
|
||||||
$this->token = $token;
|
|
||||||
$this->value = $value;
|
|
||||||
$i += 1;
|
|
||||||
return TRUE;
|
|
||||||
} else if ($value > $data) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return TRUE if $letter is a valid "token_end". We use token_end
|
|
||||||
* to avoid confuse T_ALPHA TRUEfoo with TRUE and foo (T_ALPHA)
|
|
||||||
*
|
|
||||||
* @param string $letter
|
|
||||||
*
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
protected function is_token_end($letter)
|
|
||||||
{
|
|
||||||
/* [^a-zA-Z0-9_] */
|
|
||||||
return !(
|
|
||||||
('a' <= $letter && 'z' >= $letter) ||
|
|
||||||
('A' <= $letter && 'Z' >= $letter) ||
|
|
||||||
('0' <= $letter && '9' >= $letter) ||
|
|
||||||
$letter == "_"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function getAlpha()
|
|
||||||
{
|
|
||||||
/* [a-zA-Z_][a-zA-Z0-9_]* */
|
|
||||||
$i = &$this->N;
|
|
||||||
$data = &$this->data;
|
|
||||||
|
|
||||||
if ( !('a' <= $data[$i] && 'z' >= $data[$i]) &&
|
|
||||||
!('A' <= $data[$i] && 'Z' >= $data[$i]) && $data[$i] != '_') {
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
$value = "";
|
|
||||||
for (; $i < $this->length; ++$i) {
|
|
||||||
if (
|
|
||||||
('a' <= $data[$i] && 'z' >= $data[$i]) ||
|
|
||||||
('A' <= $data[$i] && 'Z' >= $data[$i]) ||
|
|
||||||
('0' <= $data[$i] && '9' >= $data[$i]) ||
|
|
||||||
$data[$i] == "_"
|
|
||||||
) {
|
|
||||||
$value .= $data[$i];
|
|
||||||
} else {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $value;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getLine()
|
|
||||||
{
|
|
||||||
return $this->line;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static function init($template, $compiler, $file='')
|
|
||||||
{
|
|
||||||
$lexer = new Haanga_Compiler_Tokenizer($template, $compiler, $file);
|
|
||||||
$parser = new Haanga_Compiler_Parser($lexer, $file);
|
|
||||||
|
|
||||||
$parser->compiler = $compiler;
|
|
||||||
|
|
||||||
try {
|
|
||||||
for($i=0; ; $i++) {
|
|
||||||
if (!$lexer->yylex()) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$parser->doParse($lexer->token, $lexer->value);
|
|
||||||
}
|
|
||||||
} catch (Exception $e) {
|
|
||||||
/* destroy the parser */
|
|
||||||
try {
|
|
||||||
$parser->doParse(0,0);
|
|
||||||
} catch (Exception $y) {}
|
|
||||||
throw $e; /* re-throw exception */
|
|
||||||
}
|
|
||||||
|
|
||||||
$parser->doParse(0, 0);
|
|
||||||
|
|
||||||
return (array)$parser->body;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
<?php
|
|
||||||
/*
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
| Copyright (c) 2010 César Rodas and Menéame Comunicacions S.L. |
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
| Redistribution and use in source and binary forms, with or without |
|
|
||||||
| modification, are permitted provided that the following conditions are met: |
|
|
||||||
| 1. Redistributions of source code must retain the above copyright |
|
|
||||||
| notice, this list of conditions and the following disclaimer. |
|
|
||||||
| |
|
|
||||||
| 2. Redistributions in binary form must reproduce the above copyright |
|
|
||||||
| notice, this list of conditions and the following disclaimer in the |
|
|
||||||
| documentation and/or other materials provided with the distribution. |
|
|
||||||
| |
|
|
||||||
| 3. All advertising materials mentioning features or use of this software |
|
|
||||||
| must display the following acknowledgement: |
|
|
||||||
| This product includes software developed by César D. Rodas. |
|
|
||||||
| |
|
|
||||||
| 4. Neither the name of the César D. Rodas nor the |
|
|
||||||
| names of its contributors may be used to endorse or promote products |
|
|
||||||
| derived from this software without specific prior written permission. |
|
|
||||||
| |
|
|
||||||
| THIS SOFTWARE IS PROVIDED BY CÉSAR D. RODAS ''AS IS'' AND ANY |
|
|
||||||
| EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
|
|
||||||
| WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
|
|
||||||
| DISCLAIMED. IN NO EVENT SHALL CÉSAR D. RODAS BE LIABLE FOR ANY |
|
|
||||||
| DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
|
|
||||||
| (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
|
|
||||||
| LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
|
|
||||||
| ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
|
|
||||||
| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
|
|
||||||
| SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE |
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
| Authors: César Rodas <crodas@php.net> |
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Haanga_Exception {{{
|
|
||||||
/**
|
|
||||||
* General exception class. It is thrown
|
|
||||||
* when something is not configured properly
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
class Haanga_Exception extends Exception
|
|
||||||
{
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Local variables:
|
|
||||||
* tab-width: 4
|
|
||||||
* c-basic-offset: 4
|
|
||||||
* End:
|
|
||||||
* vim600: sw=4 ts=4 fdm=marker
|
|
||||||
* vim<600: sw=4 ts=4
|
|
||||||
*/
|
|
||||||
|
|
||||||
183
gulliver/thirdparty/Haanga/lib/Haanga/Extension.php
vendored
@@ -1,183 +0,0 @@
|
|||||||
<?php
|
|
||||||
/*
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
| Copyright (c) 2010 César Rodas and Menéame Comunicacions S.L. |
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
| Redistribution and use in source and binary forms, with or without |
|
|
||||||
| modification, are permitted provided that the following conditions are met: |
|
|
||||||
| 1. Redistributions of source code must retain the above copyright |
|
|
||||||
| notice, this list of conditions and the following disclaimer. |
|
|
||||||
| |
|
|
||||||
| 2. Redistributions in binary form must reproduce the above copyright |
|
|
||||||
| notice, this list of conditions and the following disclaimer in the |
|
|
||||||
| documentation and/or other materials provided with the distribution. |
|
|
||||||
| |
|
|
||||||
| 3. All advertising materials mentioning features or use of this software |
|
|
||||||
| must display the following acknowledgement: |
|
|
||||||
| This product includes software developed by César D. Rodas. |
|
|
||||||
| |
|
|
||||||
| 4. Neither the name of the César D. Rodas nor the |
|
|
||||||
| names of its contributors may be used to endorse or promote products |
|
|
||||||
| derived from this software without specific prior written permission. |
|
|
||||||
| |
|
|
||||||
| THIS SOFTWARE IS PROVIDED BY CÉSAR D. RODAS ''AS IS'' AND ANY |
|
|
||||||
| EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
|
|
||||||
| WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
|
|
||||||
| DISCLAIMED. IN NO EVENT SHALL CÉSAR D. RODAS BE LIABLE FOR ANY |
|
|
||||||
| DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
|
|
||||||
| (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
|
|
||||||
| LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
|
|
||||||
| ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
|
|
||||||
| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
|
|
||||||
| SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE |
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
| Authors: César Rodas <crodas@php.net> |
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
*/
|
|
||||||
|
|
||||||
Abstract Class Haanga_Extension
|
|
||||||
{
|
|
||||||
private static $_instances;
|
|
||||||
|
|
||||||
final private function __construct()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
final static function getInstance($name)
|
|
||||||
{
|
|
||||||
$name = 'Haanga_Extension_'.$name;
|
|
||||||
if (!class_exists($name)) {
|
|
||||||
throw new Haanga_Compiler_Exception("{$name} is not a class");
|
|
||||||
}
|
|
||||||
if (!is_subclass_of($name, __CLASS__)) {
|
|
||||||
throw new Haanga_Compiler_Exception("{$name} is not a sub-class of ".__CLASS__);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isset(self::$_instances[$name])) {
|
|
||||||
self::$_instances[$name] = new $name;
|
|
||||||
}
|
|
||||||
return self::$_instances[$name];
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract function isValid($name);
|
|
||||||
abstract function getClassName($name);
|
|
||||||
|
|
||||||
final function getFilePath($name, $rel=TRUE, $pref=NULL)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
$reflection = new ReflectionClass($this->getClassName($name));
|
|
||||||
$file = $reflection->getFileName();
|
|
||||||
} catch (Exception $e) {
|
|
||||||
$file = "";
|
|
||||||
}
|
|
||||||
return $file;
|
|
||||||
}
|
|
||||||
|
|
||||||
final public function getFunctionAlias($name)
|
|
||||||
{
|
|
||||||
if (!$this->isValid($name)) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
$zclass = $this->getClassName($name);
|
|
||||||
$properties = get_class_vars($zclass);
|
|
||||||
if (isset($properties['php_alias'])) {
|
|
||||||
return $properties['php_alias'];
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
final public function isSafe($name)
|
|
||||||
{
|
|
||||||
if (!$this->isValid($name)) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
$zclass = $this->getClassName($name);
|
|
||||||
$properties = get_class_vars($zclass);
|
|
||||||
return isset($properties['is_safe']) ? $properties['is_safe'] : FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
// generator(string $name, Haanga_Compiler $compiler, Array $args) {{{
|
|
||||||
/**
|
|
||||||
* Executer the generator method of the extension. If
|
|
||||||
* the extension doesn't has any generator method, an empty
|
|
||||||
* will be returned.
|
|
||||||
*
|
|
||||||
* @param string $name extension name
|
|
||||||
* @param Haanga_Compiler Compiler object
|
|
||||||
* @param array Arrays
|
|
||||||
* @param mixed Extra param
|
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
function generator($name, Haanga_Compiler $compiler, $args, $extra=NULL)
|
|
||||||
{
|
|
||||||
if (!$this->hasGenerator($name)) {
|
|
||||||
return array();
|
|
||||||
}
|
|
||||||
$zclass = $this->getClassName($name);
|
|
||||||
return call_user_func(array($zclass, 'generator'), $compiler, $args, $extra);
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// hasGenerator(string $name) {{{
|
|
||||||
/**
|
|
||||||
* Return TRUE if the extension has a
|
|
||||||
* generator method
|
|
||||||
*
|
|
||||||
* @param string $name Extension name
|
|
||||||
*
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
function hasGenerator($name)
|
|
||||||
{
|
|
||||||
if (!$this->isValid($name)) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
$zclass = $this->getClassName($name);
|
|
||||||
return is_callable(array($zclass, 'generator'));
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// getFunctionBody(string $name, string $name) {{{
|
|
||||||
/**
|
|
||||||
* Return the body function of the custom extension main method.
|
|
||||||
*
|
|
||||||
* @param string $name
|
|
||||||
* @param string $name
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
function getFunctionBody($tag_name, $name)
|
|
||||||
{
|
|
||||||
if (!$this->isValid($tag_name)) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
$zclass = $this->getClassName($tag_name);
|
|
||||||
if (!is_callable(array($zclass, 'main'))) {
|
|
||||||
throw new Haanga_Compiler_Exception("{$name}: missing main method in {$zclass} class");
|
|
||||||
}
|
|
||||||
|
|
||||||
$reflection = new ReflectionMethod($zclass, 'main');
|
|
||||||
$content = file($this->getFilePath($tag_name));
|
|
||||||
|
|
||||||
$start = $reflection->getStartLine()-1;
|
|
||||||
$end = $reflection->getEndLine();
|
|
||||||
$content = array_slice($content, $start, $end-$start);
|
|
||||||
|
|
||||||
$content[0] = str_replace("main", $name, $content[0]);
|
|
||||||
|
|
||||||
|
|
||||||
return "if (!function_exists('{$name}')) {\n".implode("", $content)."}";
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Local variables:
|
|
||||||
* tab-width: 4
|
|
||||||
* c-basic-offset: 4
|
|
||||||
* End:
|
|
||||||
* vim600: sw=4 ts=4 fdm=marker
|
|
||||||
* vim<600: sw=4 ts=4
|
|
||||||
*/
|
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
<?php
|
|
||||||
/*
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
| Copyright (c) 2010 César Rodas and Menéame Comunicacions S.L. |
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
| Redistribution and use in source and binary forms, with or without |
|
|
||||||
| modification, are permitted provided that the following conditions are met: |
|
|
||||||
| 1. Redistributions of source code must retain the above copyright |
|
|
||||||
| notice, this list of conditions and the following disclaimer. |
|
|
||||||
| |
|
|
||||||
| 2. Redistributions in binary form must reproduce the above copyright |
|
|
||||||
| notice, this list of conditions and the following disclaimer in the |
|
|
||||||
| documentation and/or other materials provided with the distribution. |
|
|
||||||
| |
|
|
||||||
| 3. All advertising materials mentioning features or use of this software |
|
|
||||||
| must display the following acknowledgement: |
|
|
||||||
| This product includes software developed by César D. Rodas. |
|
|
||||||
| |
|
|
||||||
| 4. Neither the name of the César D. Rodas nor the |
|
|
||||||
| names of its contributors may be used to endorse or promote products |
|
|
||||||
| derived from this software without specific prior written permission. |
|
|
||||||
| |
|
|
||||||
| THIS SOFTWARE IS PROVIDED BY CÉSAR D. RODAS ''AS IS'' AND ANY |
|
|
||||||
| EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
|
|
||||||
| WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
|
|
||||||
| DISCLAIMED. IN NO EVENT SHALL CÉSAR D. RODAS BE LIABLE FOR ANY |
|
|
||||||
| DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
|
|
||||||
| (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
|
|
||||||
| LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
|
|
||||||
| ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
|
|
||||||
| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
|
|
||||||
| SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE |
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
| Authors: César Rodas <crodas@php.net> |
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
*/
|
|
||||||
|
|
||||||
class Haanga_Extension_Filter extends Haanga_Extension
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* isValid
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
final function isValid($filter)
|
|
||||||
{
|
|
||||||
static $cache = array();
|
|
||||||
$filter = strtolower($filter);
|
|
||||||
|
|
||||||
if (!isset($cache[$filter])) {
|
|
||||||
$class_name = $this->getClassName($filter);
|
|
||||||
if (class_exists($class_name)) {
|
|
||||||
$cache[$filter] = TRUE;
|
|
||||||
} else {
|
|
||||||
$cache[$filter] = FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $cache[$filter];
|
|
||||||
}
|
|
||||||
|
|
||||||
final function getClassName($filter)
|
|
||||||
{
|
|
||||||
$filter = str_replace("_", "", ucfirst($filter));
|
|
||||||
return "Haanga_Extension_Filter_{$filter}";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Local variables:
|
|
||||||
* tab-width: 4
|
|
||||||
* c-basic-offset: 4
|
|
||||||
* End:
|
|
||||||
* vim600: sw=4 ts=4 fdm=marker
|
|
||||||
* vim<600: sw=4 ts=4
|
|
||||||
*/
|
|
||||||
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Filter_Capfirst
|
|
||||||
{
|
|
||||||
public $php_alias = "ucfirst";
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Filter_Count
|
|
||||||
{
|
|
||||||
public $php_alias = "count";
|
|
||||||
public $is_safe = TRUE; /* a number if safe */
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
Class Haanga_Extension_Filter_Cut
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* We implement "cut" filter at compilation time, to
|
|
||||||
* avoid senseless includes for simple things.
|
|
||||||
*
|
|
||||||
* We can also define an "php_alias" that will simple
|
|
||||||
* call this function (therefore it must exists at
|
|
||||||
* rendering time).
|
|
||||||
*
|
|
||||||
* Also a Main() static method could be declared, this will
|
|
||||||
* included at runtime or copied as a function if the CLI is used (more
|
|
||||||
* or less django style).
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
static function generator($compiler, $args)
|
|
||||||
{
|
|
||||||
return hexec('str_replace', $args[1], "", $args[0]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Filter_Date
|
|
||||||
{
|
|
||||||
static function generator($compiler, $args)
|
|
||||||
{
|
|
||||||
return hexec('date', $args[1], $args[0]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Filter_Default
|
|
||||||
{
|
|
||||||
static function generator($compiler, $args)
|
|
||||||
{
|
|
||||||
return hexpr_cond(hexpr(hexec('empty', $args[0]), '==', TRUE), $args[1], $args[0]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Filter_Dictsort
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Sorted a nested array by '$sort_by'
|
|
||||||
* property on each sub-array. This
|
|
||||||
* filter is included at rendering time, if you want
|
|
||||||
* to see the generated version see tags/dictsort.php
|
|
||||||
*/
|
|
||||||
static function main($array, $sort_by)
|
|
||||||
{
|
|
||||||
$field = array();
|
|
||||||
foreach ($array as $key => $item) {
|
|
||||||
$field[$key] = $item[$sort_by];
|
|
||||||
}
|
|
||||||
array_multisort($field, SORT_REGULAR, $array);
|
|
||||||
return $array;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Filter_Empty
|
|
||||||
{
|
|
||||||
public $php_alias = 'empty';
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Filter_Escape
|
|
||||||
{
|
|
||||||
public $php_alias = "htmlspecialchars";
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Filter_Exists
|
|
||||||
{
|
|
||||||
public $php_alias = 'isset';
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Filter_Hostname
|
|
||||||
{
|
|
||||||
static function generator($cmp, $args)
|
|
||||||
{
|
|
||||||
return hexec('parse_url', $args[0], hconst('PHP_URL_HOST'));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Filter_intval
|
|
||||||
{
|
|
||||||
public $php_alias = 'intval';
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Filter_IsArray
|
|
||||||
{
|
|
||||||
public $php_alias = "is_array";
|
|
||||||
public $is_safe = TRUE; /* boolean if safe */
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Filter_Join
|
|
||||||
{
|
|
||||||
public static function generator($compiler, $args)
|
|
||||||
{
|
|
||||||
if (count($args) == 1) {
|
|
||||||
$args[1] = "";
|
|
||||||
}
|
|
||||||
return hexec("implode", $args[1], $args[0]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Filter_Length
|
|
||||||
{
|
|
||||||
public $is_safe = TRUE; /* a number if safe */
|
|
||||||
static function generator($compiler, $args)
|
|
||||||
{
|
|
||||||
$count = hexec('count', $args[0]);
|
|
||||||
$strlen = hexec('strlen', $args[0]);
|
|
||||||
$guess = hexpr_cond(hexec('is_array', $args[0]), hexec('count', $args[0]),
|
|
||||||
hexec('strlen', $args[0]));
|
|
||||||
|
|
||||||
if (Haanga_AST::is_var($args[0])) {
|
|
||||||
/* if it is a variable, best effort to detect
|
|
||||||
its type at compile time */
|
|
||||||
$value = $compiler->get_context($args[0]['var']);
|
|
||||||
if (is_array($value)) {
|
|
||||||
return $count;
|
|
||||||
} else if (is_string($value)) {
|
|
||||||
return $strlen;
|
|
||||||
} else {
|
|
||||||
return $guess;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Haanga_AST::is_str($args[0])) {
|
|
||||||
return $strlen;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $guess;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Filter_Lower
|
|
||||||
{
|
|
||||||
public $php_alias = "strtolower";
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Filter_Null
|
|
||||||
{
|
|
||||||
public $php_alias = 'is_null';
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Filter_Pluralize
|
|
||||||
{
|
|
||||||
static function generator($compiler, $args)
|
|
||||||
{
|
|
||||||
if (count($args) > 1) {
|
|
||||||
if (!Haanga_AST::is_str($args[1])) {
|
|
||||||
$compiler->Error("pluralize: First parameter must be an string");
|
|
||||||
}
|
|
||||||
$parts = explode(",", $args[1]['string']);
|
|
||||||
$singular = "";
|
|
||||||
if (count($parts) == 1) {
|
|
||||||
$plural = $parts[0];
|
|
||||||
} else {
|
|
||||||
$singular = $parts[0];
|
|
||||||
$plural = $parts[1];
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$singular = "";
|
|
||||||
$plural = "s";
|
|
||||||
}
|
|
||||||
|
|
||||||
return hexpr_cond(hexpr($args[0], '<=', 1), $singular, $plural);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Filter_Reverse
|
|
||||||
{
|
|
||||||
static function generator($compiler, $args)
|
|
||||||
{
|
|
||||||
if (count($args) != 1) {
|
|
||||||
$compiler->Error("Reverse only needs one parameter");
|
|
||||||
}
|
|
||||||
|
|
||||||
return hexec('array_reverse', $args[0], TRUE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Filter_Safe
|
|
||||||
{
|
|
||||||
static function generator($compiler, $args)
|
|
||||||
{
|
|
||||||
$compiler->var_is_safe = TRUE;
|
|
||||||
return current($args);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Filter_Slugify
|
|
||||||
{
|
|
||||||
static function generator($compiler, $args)
|
|
||||||
{
|
|
||||||
if (count($args) != 1) {
|
|
||||||
$compiler->Error("slugify filter only needs one parameter");
|
|
||||||
}
|
|
||||||
|
|
||||||
$arg = hexec('strtolower', $args[0]);
|
|
||||||
$arg = hexec('str_replace'," ","-",$arg);
|
|
||||||
$arg = hexec('preg_replace',"/[^\d\w-_]/",'',$arg);
|
|
||||||
return $arg;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Filter_StringFormat
|
|
||||||
{
|
|
||||||
static function generator($compiler, $args)
|
|
||||||
{
|
|
||||||
return hexec('sprintf', $args[1], $args[0]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Filter_Length
|
|
||||||
{
|
|
||||||
public $php_alias = "strlen";
|
|
||||||
public $is_safe = TRUE; /* a number if safe */
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Filter_Substr
|
|
||||||
{
|
|
||||||
public static function generator($cmp, $args)
|
|
||||||
{
|
|
||||||
if (count($args) != 2) {
|
|
||||||
$cmp->Error("substr parameter must have one param");
|
|
||||||
}
|
|
||||||
if (!isset($args[1]['string'])) {
|
|
||||||
$cmp->Error("substr parameter must be a string");
|
|
||||||
}
|
|
||||||
list($start, $end) = explode(",", $args[1]['string']);
|
|
||||||
return hexec('substr', $args[0], (int)$start, (int)$end);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Filter_Title
|
|
||||||
{
|
|
||||||
static function generator($compiler, $args)
|
|
||||||
{
|
|
||||||
if (count($args) != 1) {
|
|
||||||
$compiler->Error("title filter only needs one parameter");
|
|
||||||
}
|
|
||||||
|
|
||||||
return hexec('ucwords', hexec('strtolower', $args[0]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Filter_Trans
|
|
||||||
{
|
|
||||||
public $php_alias = '_';
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Filter_Translation extends Haanga_Extension_Filter_Trans
|
|
||||||
{
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Filter_Trim
|
|
||||||
{
|
|
||||||
public $php_alias = "trim";
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Filter_Truncatechars
|
|
||||||
{
|
|
||||||
static function main($text, $limit)
|
|
||||||
{
|
|
||||||
if(strlen($text) <= $limit)
|
|
||||||
return $text;
|
|
||||||
$trunctext = substr($text, 0, $limit);
|
|
||||||
$trunctext[$limit-3] = '.';
|
|
||||||
$trunctext[$limit-2] = '.';
|
|
||||||
$trunctext[$limit-1] = '.';
|
|
||||||
return $trunctext;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Filter_Truncatewords
|
|
||||||
{
|
|
||||||
static function main($text, $limit)
|
|
||||||
{
|
|
||||||
$words = explode(" ", $text, $limit+1);
|
|
||||||
if (count($words) == $limit+1) {
|
|
||||||
$words[$limit] = '...';
|
|
||||||
}
|
|
||||||
return implode(" ", $words);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Filter_Upper
|
|
||||||
{
|
|
||||||
public $php_alias = "strtoupper";
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Filter_UrlEncode
|
|
||||||
{
|
|
||||||
|
|
||||||
public static function generator($cmp, $args)
|
|
||||||
{
|
|
||||||
$cmp->var_is_safe = TRUE;
|
|
||||||
return hexec('urlencode', $args[0]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,93 +0,0 @@
|
|||||||
<?php
|
|
||||||
/*
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
| Copyright (c) 2010 César Rodas and Menéame Comunicacions S.L. |
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
| Redistribution and use in source and binary forms, with or without |
|
|
||||||
| modification, are permitted provided that the following conditions are met: |
|
|
||||||
| 1. Redistributions of source code must retain the above copyright |
|
|
||||||
| notice, this list of conditions and the following disclaimer. |
|
|
||||||
| |
|
|
||||||
| 2. Redistributions in binary form must reproduce the above copyright |
|
|
||||||
| notice, this list of conditions and the following disclaimer in the |
|
|
||||||
| documentation and/or other materials provided with the distribution. |
|
|
||||||
| |
|
|
||||||
| 3. All advertising materials mentioning features or use of this software |
|
|
||||||
| must display the following acknowledgement: |
|
|
||||||
| This product includes software developed by César D. Rodas. |
|
|
||||||
| |
|
|
||||||
| 4. Neither the name of the César D. Rodas nor the |
|
|
||||||
| names of its contributors may be used to endorse or promote products |
|
|
||||||
| derived from this software without specific prior written permission. |
|
|
||||||
| |
|
|
||||||
| THIS SOFTWARE IS PROVIDED BY CÉSAR D. RODAS ''AS IS'' AND ANY |
|
|
||||||
| EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
|
|
||||||
| WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
|
|
||||||
| DISCLAIMED. IN NO EVENT SHALL CÉSAR D. RODAS BE LIABLE FOR ANY |
|
|
||||||
| DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
|
|
||||||
| (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
|
|
||||||
| LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
|
|
||||||
| ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
|
|
||||||
| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
|
|
||||||
| SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE |
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
| Authors: César Rodas <crodas@php.net> |
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
class Haanga_Extension_Tag extends Haanga_Extension
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* isValid
|
|
||||||
*
|
|
||||||
* Check if the current $tag (string) is registered as a custom
|
|
||||||
* tag, if so, it check wether it is just a custom tag or a custom block.
|
|
||||||
*
|
|
||||||
* This method is called from the lexer for each alpha (within {% %}),
|
|
||||||
* to avoid parsing conflicts.
|
|
||||||
*
|
|
||||||
* @param string $tag Tag to check
|
|
||||||
*
|
|
||||||
* @return int|bool HG_Parser::T_CUSTOM_TAG, HG_Parser::T_CUSTOM_TAG or FALSE
|
|
||||||
*/
|
|
||||||
final function isValid($tag)
|
|
||||||
{
|
|
||||||
static $cache = array();
|
|
||||||
$tag = strtolower($tag);
|
|
||||||
|
|
||||||
if (!isset($cache[$tag])) {
|
|
||||||
$class_name = $this->getClassName($tag);
|
|
||||||
if (class_exists($class_name)) {
|
|
||||||
$properties = get_class_vars($class_name);
|
|
||||||
$is_block = FALSE;
|
|
||||||
if (isset($properties['is_block'])) {
|
|
||||||
$is_block = (bool)$properties['is_block'];
|
|
||||||
}
|
|
||||||
$cache[$tag] = $is_block ? HG_Parser::T_CUSTOM_BLOCK : HG_Parser::T_CUSTOM_TAG;
|
|
||||||
}
|
|
||||||
if (!isset($cache[$tag])) {
|
|
||||||
$cache[$tag] = FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $cache[$tag];
|
|
||||||
}
|
|
||||||
|
|
||||||
final function getClassName($tag)
|
|
||||||
{
|
|
||||||
$tag = str_replace("_", "", ucfirst($tag));
|
|
||||||
return "Haanga_Extension_Tag_{$tag}";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Local variables:
|
|
||||||
* tab-width: 4
|
|
||||||
* c-basic-offset: 4
|
|
||||||
* End:
|
|
||||||
* vim600: sw=4 ts=4 fdm=marker
|
|
||||||
* vim<600: sw=4 ts=4
|
|
||||||
*/
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Tag_Buffer
|
|
||||||
{
|
|
||||||
public $is_block = TRUE;
|
|
||||||
|
|
||||||
static function generator($cmp, $args, $redirected)
|
|
||||||
{
|
|
||||||
if (count($args) != 2) {
|
|
||||||
$cmp->Error("buffer filter must have one parameter");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* get new code object */
|
|
||||||
$code = hcode();
|
|
||||||
/* redirect buffer to $args[1] */
|
|
||||||
$code->decl($args[1], $args[0]);
|
|
||||||
/* telling to Haanga that we're handling the output */
|
|
||||||
$code->doesPrint = TRUE;
|
|
||||||
|
|
||||||
/* $args[1] is already safe (it might have HTML) */
|
|
||||||
$cmp->set_safe($args[1]['var']);
|
|
||||||
|
|
||||||
return $code;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Tag_CurrentTime
|
|
||||||
{
|
|
||||||
public static $is_block = FALSE;
|
|
||||||
/* This tag calls to a PHP native function */
|
|
||||||
public static $php_alias = "date";
|
|
||||||
}
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Tag_Cycle
|
|
||||||
{
|
|
||||||
public $is_block = FALSE;
|
|
||||||
|
|
||||||
static function generator($cmp, $args, $declared)
|
|
||||||
{
|
|
||||||
static $cycle = 0;
|
|
||||||
if (!isset($cmp->cycle)) {
|
|
||||||
$cmp->cycle = array();
|
|
||||||
}
|
|
||||||
|
|
||||||
$code = hcode();
|
|
||||||
|
|
||||||
$index = 'index_'.$cycle;
|
|
||||||
$def = 'def_cycle_'.$cycle;
|
|
||||||
|
|
||||||
if (count($args) == 1 && Haanga_AST::is_var($args[0]) && isset($cmp->cycle[$args[0]['var']])) {
|
|
||||||
$id = $cmp->cycle[$args[0]['var']];
|
|
||||||
$index = 'index_'.$id;
|
|
||||||
$def = 'def_cycle_'.$id;
|
|
||||||
} else {
|
|
||||||
if (!$declared) {
|
|
||||||
$code->do_if(hexpr(hexec('isset', hvar($def)), '==', FALSE));
|
|
||||||
}
|
|
||||||
$code->decl($def, $args);
|
|
||||||
if (!$declared) {
|
|
||||||
$code->do_endif();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* isset($var) == FALSE */
|
|
||||||
$expr = hexpr(hexec('isset', hvar($index)), '==', FALSE);
|
|
||||||
$inc = hexpr(hexpr(hexpr(hvar($index), '+', 1)), '%', hexec('count', hvar($def)));
|
|
||||||
|
|
||||||
|
|
||||||
if (!$declared) {
|
|
||||||
if (isset($id)) {
|
|
||||||
$code->decl($index, $inc);
|
|
||||||
} else {
|
|
||||||
$code->decl($index, hexpr_cond($expr, 0, $inc));
|
|
||||||
}
|
|
||||||
$code->end();
|
|
||||||
$var = hvar($def, hvar($index));
|
|
||||||
$cmp->do_print($code, $var);
|
|
||||||
} else {
|
|
||||||
$code->decl($index, -1);
|
|
||||||
$cmp->cycle[$declared] = $cycle;
|
|
||||||
}
|
|
||||||
|
|
||||||
$cycle++;
|
|
||||||
|
|
||||||
return $code;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Tag_Dictsort
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sorted a nested array by '$sort_by'
|
|
||||||
* property on each sub-array. , if you want
|
|
||||||
* to see the original php file look filters/dictsort.php
|
|
||||||
*/
|
|
||||||
static function generator($cmp, $args, $redirected)
|
|
||||||
{
|
|
||||||
if (!$redirected) {
|
|
||||||
$cmp->Error("dictsort must be redirected to a variable using AS <varname>");
|
|
||||||
}
|
|
||||||
if (count($args) != 2) {
|
|
||||||
$cmp->Error("Dictsort must have two params");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Haanga_AST::is_var($args[0])) {
|
|
||||||
$cmp->Error("Dictsort: First parameter must be an array");
|
|
||||||
}
|
|
||||||
|
|
||||||
$var = $cmp->get_context($args[0]['var']);
|
|
||||||
$cmp->set_context($redirected, $var);
|
|
||||||
|
|
||||||
$redirected = hvar($redirected);
|
|
||||||
$field = hvar('field');
|
|
||||||
$key = hvar('key');
|
|
||||||
|
|
||||||
$code = hcode();
|
|
||||||
$body = hcode();
|
|
||||||
|
|
||||||
$body->decl(hvar('field', $key), hvar('item', $args[1]));
|
|
||||||
|
|
||||||
$code->decl($redirected, $args[0]);
|
|
||||||
$code->decl($field, array());
|
|
||||||
$code->do_foreach($redirected, 'item', $key, $body);
|
|
||||||
$code->do_exec('array_multisort', $field, hconst('SORT_REGULAR'), $redirected);
|
|
||||||
|
|
||||||
return $code;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
|
|
||||||
class Haanga_Extension_Tag_Exec
|
|
||||||
{
|
|
||||||
public $is_block = FALSE;
|
|
||||||
|
|
||||||
static function generator($cmp, $args, $assign=NULL)
|
|
||||||
{
|
|
||||||
if (!$cmp->getOption('allow_exec')) {
|
|
||||||
$cmp->Error("Tag exec is disabled for security reasons");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$code = hcode();
|
|
||||||
if (Haanga_AST::is_var($args[0])) {
|
|
||||||
$args[0] = $args[0]['var'];
|
|
||||||
} else if (Haanga_AST::is_str($args[0])) {
|
|
||||||
$args[0] = $args[0]['string'];
|
|
||||||
} else {
|
|
||||||
$cmp->Error("invalid param");
|
|
||||||
}
|
|
||||||
|
|
||||||
// fix for static calls {{{
|
|
||||||
if (is_array($args[0])) {
|
|
||||||
$end = end($args[0]);
|
|
||||||
if (isset($end['class'])) {
|
|
||||||
$args[0][ key($args[0]) ]['class'] = substr($end['class'], 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
$exec = hexec($args[0]);
|
|
||||||
for ($i=1; $i < count($args); $i++) {
|
|
||||||
$exec->param($args[$i]);
|
|
||||||
}
|
|
||||||
$exec->end();
|
|
||||||
if ($assign) {
|
|
||||||
$code->decl($assign, $exec);
|
|
||||||
|
|
||||||
// make it global
|
|
||||||
$code->decl($cmp->getScopeVariable($assign), hvar($assign));
|
|
||||||
} else {
|
|
||||||
$cmp->do_print($code, $exec);
|
|
||||||
}
|
|
||||||
return $code;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Tag_FirstOf
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* firstof tag
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
static function generator($cmp, $args)
|
|
||||||
{
|
|
||||||
$count = count($args);
|
|
||||||
$args = array_reverse($args);
|
|
||||||
for ($i=0; $i < $count; $i++) {
|
|
||||||
if (isset($expr) && Haanga_AST::is_var($args[$i])) {
|
|
||||||
$expr = hexpr_cond(hexpr(hexec('empty', $args[$i]),'==', FALSE), $args[$i], $expr);
|
|
||||||
} else {
|
|
||||||
$expr = $args[$i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $expr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Tag_Inline
|
|
||||||
{
|
|
||||||
public static function generator($cmp, $args, $redirected)
|
|
||||||
{
|
|
||||||
if (count($args) != 1) {
|
|
||||||
$cmp->Error("inline needs one argument");
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($redirected) {
|
|
||||||
$cmp->Error("inline can't be redirected to one variable");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Haanga_AST::is_str($args[0])) {
|
|
||||||
$cmp->Error("The argument to inline must be an string");
|
|
||||||
}
|
|
||||||
$file = $args[0]['string'];
|
|
||||||
|
|
||||||
if (class_exists('Haanga')) {
|
|
||||||
$file = Haanga::GetTemplateDir().'/'.$file;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!is_file($file)) {
|
|
||||||
$cmp->Error("{$file} is not a template");
|
|
||||||
}
|
|
||||||
|
|
||||||
return $cmp->getOpCodes(file_get_contents($file), $file);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Tag_Lower
|
|
||||||
{
|
|
||||||
public static $is_block = TRUE;
|
|
||||||
/* This tag calls to a PHP native function */
|
|
||||||
public static $php_alias = "strtolower";
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Tag_Min
|
|
||||||
{
|
|
||||||
public $php_alias = "min";
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Tag_SetSafe
|
|
||||||
{
|
|
||||||
public $is_block = FALSE;
|
|
||||||
|
|
||||||
static function generator($cmp, $args)
|
|
||||||
{
|
|
||||||
foreach ($args as $arg) {
|
|
||||||
if (Haanga_AST::is_var($arg)) {
|
|
||||||
$cmp->set_safe($arg['var']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return hcode();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Spaceless custom tag
|
|
||||||
*
|
|
||||||
* @author crodas
|
|
||||||
*/
|
|
||||||
class Haanga_Extension_Tag_Spaceless
|
|
||||||
{
|
|
||||||
/* This tag is a block */
|
|
||||||
public $is_block = TRUE;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* main() {{{
|
|
||||||
*
|
|
||||||
* This static function contains the definition of spaceless
|
|
||||||
* tag, it is important not to refence to $compiler since it
|
|
||||||
* will copied and paste in the generated PHP code from the
|
|
||||||
* template as a static function.
|
|
||||||
*
|
|
||||||
* It is also important to put the start and the end of the
|
|
||||||
* static function in new lines.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
static static function main($html)
|
|
||||||
{
|
|
||||||
$regex = array(
|
|
||||||
'/>[ \t\r\n]+</sU',
|
|
||||||
'/^[ \t\r\n]+</sU',
|
|
||||||
'/>[ \t\r\n]+$/sU',
|
|
||||||
);
|
|
||||||
$replaces = array('><', '<', '>');
|
|
||||||
$html = preg_replace($regex, $replaces, $html);
|
|
||||||
return $html;
|
|
||||||
} }}} */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* spaceless now uses generated code instead of
|
|
||||||
* calling Spaceless_Tag::main() at everytime.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
static function generator($compiler, $args)
|
|
||||||
{
|
|
||||||
$regex = array('/>[ \t\r\n]+</sU','/^[ \t\r\n]+</sU','/>[ \t\r\n]+$/sU');
|
|
||||||
$repl = array('><', '<', '>');
|
|
||||||
|
|
||||||
return hexec('preg_replace', $regex, $repl, $args[0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Tag_Templatetag
|
|
||||||
{
|
|
||||||
static function generator($compiler, $args)
|
|
||||||
{
|
|
||||||
if (count($args) != 1) {
|
|
||||||
$compiler->Error("templatetag only needs one parameter");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Haanga_AST::is_var($args[0])) {
|
|
||||||
$type = $args[0]['var'];
|
|
||||||
if (!is_string($type)) {
|
|
||||||
$compiler->Error("Invalid parameter");
|
|
||||||
}
|
|
||||||
} else if (Haanga_AST::is_str($args[0])) {
|
|
||||||
$type = $args[0]['string'];
|
|
||||||
}
|
|
||||||
|
|
||||||
switch ($type)
|
|
||||||
{
|
|
||||||
case 'openblock':
|
|
||||||
$str = '{%';
|
|
||||||
break;
|
|
||||||
case 'closeblock':
|
|
||||||
$str = '%}';
|
|
||||||
break;
|
|
||||||
case 'openbrace':
|
|
||||||
$str = '{';
|
|
||||||
break;
|
|
||||||
case 'closebrace':
|
|
||||||
$str = '}';
|
|
||||||
break;
|
|
||||||
case 'openvariable':
|
|
||||||
$str = '{{';
|
|
||||||
break;
|
|
||||||
case 'closevariable':
|
|
||||||
$str = '}}';
|
|
||||||
break;
|
|
||||||
case 'opencomment':
|
|
||||||
$str = '{#';
|
|
||||||
break;
|
|
||||||
case 'closecomment':
|
|
||||||
$str = '#}';
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$compiler->Error("Invalid parameter");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
$code = hcode();
|
|
||||||
$compiler->do_print($code, Haanga_AST::str($str));
|
|
||||||
|
|
||||||
return $code;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Tag_Trans
|
|
||||||
{
|
|
||||||
public $is_block = FALSE;
|
|
||||||
|
|
||||||
static function generator($cmp, $args, $redirect)
|
|
||||||
{
|
|
||||||
$code = hcode();
|
|
||||||
|
|
||||||
$exec = hexec('_', $args[0]);
|
|
||||||
|
|
||||||
if (count($args) > 1) {
|
|
||||||
$exec = hexec('sprintf', $exec);
|
|
||||||
foreach ($args as $id => $arg) {
|
|
||||||
if ($id !== 0) {
|
|
||||||
$exec->param($arg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if ($redirect) {
|
|
||||||
$code->decl($redirect, $exec);
|
|
||||||
} else {
|
|
||||||
$cmp->do_print($code, $exec);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $code;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Tag_Tryinclude
|
|
||||||
{
|
|
||||||
static function generator($cmp, $args, $declared)
|
|
||||||
{
|
|
||||||
if ($declared) {
|
|
||||||
$cmp->Error("try_include can't be redirected to a variable");
|
|
||||||
}
|
|
||||||
|
|
||||||
$code = hcode();
|
|
||||||
$exec = hexec('Haanga::Safe_Load', $args[0], $cmp->getScopeVariable(), TRUE, array());
|
|
||||||
|
|
||||||
$cmp->do_print($code, $exec);
|
|
||||||
|
|
||||||
return $code;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Haanga_Extension_Tag_Upper
|
|
||||||
{
|
|
||||||
public static $is_block = TRUE;
|
|
||||||
/* This tag calls to a PHP native function */
|
|
||||||
public static $php_alias = "strtoupper";
|
|
||||||
}
|
|
||||||
@@ -1,681 +0,0 @@
|
|||||||
<?php
|
|
||||||
/*
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
| Copyright (c) 2010 César Rodas and Menéame Comunicacions S.L. |
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
| Redistribution and use in source and binary forms, with or without |
|
|
||||||
| modification, are permitted provided that the following conditions are met: |
|
|
||||||
| 1. Redistributions of source code must retain the above copyright |
|
|
||||||
| notice, this list of conditions and the following disclaimer. |
|
|
||||||
| |
|
|
||||||
| 2. Redistributions in binary form must reproduce the above copyright |
|
|
||||||
| notice, this list of conditions and the following disclaimer in the |
|
|
||||||
| documentation and/or other materials provided with the distribution. |
|
|
||||||
| |
|
|
||||||
| 3. All advertising materials mentioning features or use of this software |
|
|
||||||
| must display the following acknowledgement: |
|
|
||||||
| This product includes software developed by César D. Rodas. |
|
|
||||||
| |
|
|
||||||
| 4. Neither the name of the César D. Rodas nor the |
|
|
||||||
| names of its contributors may be used to endorse or promote products |
|
|
||||||
| derived from this software without specific prior written permission. |
|
|
||||||
| |
|
|
||||||
| THIS SOFTWARE IS PROVIDED BY CÉSAR D. RODAS ''AS IS'' AND ANY |
|
|
||||||
| EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
|
|
||||||
| WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
|
|
||||||
| DISCLAIMED. IN NO EVENT SHALL CÉSAR D. RODAS BE LIABLE FOR ANY |
|
|
||||||
| DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
|
|
||||||
| (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
|
|
||||||
| LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
|
|
||||||
| ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
|
|
||||||
| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
|
|
||||||
| SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE |
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
| Authors: César Rodas <crodas@php.net> |
|
|
||||||
+---------------------------------------------------------------------------------+
|
|
||||||
*/
|
|
||||||
|
|
||||||
// addslashes_ex($string) {{{
|
|
||||||
/**
|
|
||||||
* addslashes like function for single quote string ('foo')
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
function addslashes_ex($string)
|
|
||||||
{
|
|
||||||
return str_replace(array("\\", "'"), array("\\\\", "\\'"), $string);
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Haanga_Generator_PHP class
|
|
||||||
*
|
|
||||||
* This class takes the generated AST structure (arrays),
|
|
||||||
* and generated the PHP represantion.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
class Haanga_Generator_PHP
|
|
||||||
{
|
|
||||||
protected $ident;
|
|
||||||
protected $tab = " ";
|
|
||||||
protected $scopeVariableName;
|
|
||||||
|
|
||||||
// getCode (AST $op_code) {{{
|
|
||||||
/**
|
|
||||||
* Transform the AST generated by the Haanga_Compiler class
|
|
||||||
* and return the equivalent PHP code.
|
|
||||||
*
|
|
||||||
* @param array $op_code
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
final function getCode($op_code, $scope)
|
|
||||||
{
|
|
||||||
$this->scopeVariableName = $scope;
|
|
||||||
$this->ident = 0;
|
|
||||||
$code = "";
|
|
||||||
$size = count($op_code);
|
|
||||||
for ($i=0; $i < $size; $i++) {
|
|
||||||
$op = $op_code[$i];
|
|
||||||
if (!isset($op['op'])) {
|
|
||||||
throw new Haanga_Compiler_Exception("Invalid \$op_code ".print_r($op, TRUE));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* echo optimization {{{ */
|
|
||||||
if ($op['op'] == 'print') {
|
|
||||||
do {
|
|
||||||
$next_op = $op_code[$i+1];
|
|
||||||
if (!isset($next_op) || $next_op['op'] != 'print') {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
for ($e=0; $e < count($next_op); $e++) {
|
|
||||||
if (!isset($next_op[$e])) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$op[] = $next_op[$e];
|
|
||||||
}
|
|
||||||
$i++;
|
|
||||||
} while(TRUE);
|
|
||||||
}
|
|
||||||
/* }}} */
|
|
||||||
|
|
||||||
/* declare optimization {{{ */
|
|
||||||
if ($op['op'] == 'declare' || $op['op'] == 'append_var') {
|
|
||||||
/* Code optimization
|
|
||||||
**
|
|
||||||
** If a variable declaration, or append variable is followed
|
|
||||||
** by several append_var, then merge everything into a
|
|
||||||
** single STMT.
|
|
||||||
**
|
|
||||||
*/
|
|
||||||
do {
|
|
||||||
$next_op = $op_code[$i+1];
|
|
||||||
if (!isset($next_op) || $next_op['op'] != 'append_var' || $next_op['name'] != $op['name']) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
for ($e=0; $e < count($next_op); $e++) {
|
|
||||||
if (!isset($next_op[$e])) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$op[] = $next_op[$e];
|
|
||||||
}
|
|
||||||
$i++;
|
|
||||||
} while(TRUE);
|
|
||||||
}
|
|
||||||
/* }}} */
|
|
||||||
|
|
||||||
$method = "php_{$op['op']}";
|
|
||||||
if (!is_callable(array($this, $method))) {
|
|
||||||
throw new Exception("CodeGenerator: Missing method $method");
|
|
||||||
}
|
|
||||||
switch ($op['op']) {
|
|
||||||
case 'end_for':
|
|
||||||
case 'end_foreach':
|
|
||||||
case 'end_if':
|
|
||||||
case 'end_function':
|
|
||||||
case 'else':
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$code .= $this->ident();
|
|
||||||
}
|
|
||||||
$code .= $this->$method($op);
|
|
||||||
}
|
|
||||||
return $code;
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// ident() {{{
|
|
||||||
/**
|
|
||||||
* Get the string for the current tabulation
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
protected function ident()
|
|
||||||
{
|
|
||||||
$code = PHP_EOL;
|
|
||||||
$code .= str_repeat($this->tab, $this->ident);
|
|
||||||
|
|
||||||
return $code;
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// php_else() {{{
|
|
||||||
/**
|
|
||||||
* Return code for "else"
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
protected function php_else()
|
|
||||||
{
|
|
||||||
$this->ident--;
|
|
||||||
$code = $this->ident()."} else {";
|
|
||||||
$this->ident++;
|
|
||||||
return $code;
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// php_comment() {{{
|
|
||||||
/**
|
|
||||||
* Return code for "comments"
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
function php_comment($op)
|
|
||||||
{
|
|
||||||
return "/* {$op['comment']} */";
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// php_function(array $op) {{{
|
|
||||||
/**
|
|
||||||
* Return the function declaration of the class, for now
|
|
||||||
* it has fixed params, this should change soon to generate
|
|
||||||
* any sort of functions
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
function php_function($op)
|
|
||||||
{
|
|
||||||
$code = "function {$op['name']}(\${$this->scopeVariableName}, \$return=FALSE, \$blocks=array())".$this->ident()."{";
|
|
||||||
$this->ident++;
|
|
||||||
return $code;
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// php_if(array $op) {{{
|
|
||||||
/**
|
|
||||||
* Return the "if" declaration and increase $this->ident
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
protected function php_if($op)
|
|
||||||
{
|
|
||||||
$code = "if (".$this->php_generate_expr($op['expr']).") {";
|
|
||||||
$this->ident++;
|
|
||||||
return $code;
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// php_expr($op) {{{
|
|
||||||
/**
|
|
||||||
* Return a stand-alone statement
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
protected function php_expr($op)
|
|
||||||
{
|
|
||||||
return $this->php_generate_expr($op[0]).";";
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// php_end_block() {{{
|
|
||||||
/**
|
|
||||||
* Finish the current block (if, for, function, etc),
|
|
||||||
* return the final "}", and decrease $this->ident
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
protected function php_end_block()
|
|
||||||
{
|
|
||||||
$this->ident--;
|
|
||||||
return $this->ident()."}";
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// php_end_function() {{{
|
|
||||||
/**
|
|
||||||
* Return code to end a function
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
protected function php_end_function()
|
|
||||||
{
|
|
||||||
return $this->php_end_block();
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// php_end_if() {{{
|
|
||||||
/**
|
|
||||||
* Return code to end a if
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
protected function php_end_if()
|
|
||||||
{
|
|
||||||
return $this->php_end_block();
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// php_end_for() {{{
|
|
||||||
/**
|
|
||||||
* Return code to end a for
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
protected function php_end_for()
|
|
||||||
{
|
|
||||||
return $this->php_end_block();
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// php_end_foreach() {{{
|
|
||||||
/**
|
|
||||||
* Return code to end a foreach
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
protected function php_end_foreach()
|
|
||||||
{
|
|
||||||
return $this->php_end_block();
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// php_for() {{{
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
protected function php_for($op)
|
|
||||||
{
|
|
||||||
$index = $this->php_get_varname($op['index']);
|
|
||||||
foreach (array('min', 'max', 'step') as $type) {
|
|
||||||
if (is_array($op[$type])) {
|
|
||||||
$$type = $this->php_get_varname($op[$type]['var']);
|
|
||||||
} else {
|
|
||||||
$$type = $op[$type];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$cmp = "<=";
|
|
||||||
if (is_numeric($step) && $step < 0) {
|
|
||||||
$cmp = ">=";
|
|
||||||
}
|
|
||||||
if (is_numeric($min) && is_numeric($max) && $max < $min) {
|
|
||||||
if (is_numeric($step) && $step > 0) {
|
|
||||||
$step *= -1;
|
|
||||||
}
|
|
||||||
$cmp = ">=";
|
|
||||||
}
|
|
||||||
|
|
||||||
$code = "for ({$index} = {$min}; {$index} {$cmp} {$max}; {$index} += {$step}) {";
|
|
||||||
$this->ident++;
|
|
||||||
|
|
||||||
return $code;
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// php_foreach(array $op) {{{
|
|
||||||
/**
|
|
||||||
* Return the declaration of a "foreach" statement.
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
protected function php_foreach($op)
|
|
||||||
{
|
|
||||||
$op['array'] = $this->php_get_varname($op['array']);
|
|
||||||
$op['value'] = $this->php_get_varname($op['value']);
|
|
||||||
$code = "foreach ((array) {$op['array']} as ";
|
|
||||||
if (!isset($op['key'])) {
|
|
||||||
$code .= " {$op['value']}";
|
|
||||||
} else {
|
|
||||||
$op['key'] = $this->php_get_varname($op['key']);
|
|
||||||
$code .= " {$op['key']} => {$op['value']}";
|
|
||||||
}
|
|
||||||
|
|
||||||
$code .= ") {";
|
|
||||||
$this->ident++;
|
|
||||||
return $code;
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// php_append_var(array $op) {{{
|
|
||||||
/**
|
|
||||||
* Return code to append something to a variable
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
protected function php_append_var($op)
|
|
||||||
{
|
|
||||||
return $this->php_declare($op, '.=');
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// php_exec($op) {{{
|
|
||||||
/**
|
|
||||||
* Return code for a function calling.
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
protected function php_exec($op)
|
|
||||||
{
|
|
||||||
$code = "";
|
|
||||||
if (is_string($op['name'])) {
|
|
||||||
$code .= $op['name'];
|
|
||||||
} else {
|
|
||||||
$function = $this->php_get_varname($op['name']);
|
|
||||||
$code .= $function;
|
|
||||||
}
|
|
||||||
$code .= '(';
|
|
||||||
if (isset($op['args'])) {
|
|
||||||
$code .= $this->php_generate_list($op['args']);
|
|
||||||
}
|
|
||||||
$code .= ')';
|
|
||||||
return $code;
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// php_global($op) {{{
|
|
||||||
function php_global($op)
|
|
||||||
{
|
|
||||||
return "global \$".implode(", \$", $op['vars']).";";
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// php_generate_expr($op) {{{
|
|
||||||
/**
|
|
||||||
* Return an expression
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
protected function php_generate_expr($expr)
|
|
||||||
{
|
|
||||||
$code = '';
|
|
||||||
if (is_object($expr)) {
|
|
||||||
$expr = $expr->getArray();
|
|
||||||
}
|
|
||||||
if (is_array($expr) && isset($expr['op_expr'])) {
|
|
||||||
if ($expr['op_expr'] == 'expr') {
|
|
||||||
$code .= "(";
|
|
||||||
$code .= $this->php_generate_expr($expr[0]);
|
|
||||||
$code .= ")";
|
|
||||||
} else if ($expr['op_expr'] == 'not') {
|
|
||||||
$code .= "!".$this->php_generate_expr($expr[0]);
|
|
||||||
} else {
|
|
||||||
$code .= $this->php_generate_expr($expr[0]);
|
|
||||||
if (is_object($expr['op_expr'])) {
|
|
||||||
var_dump($expr);die('unexpected error');
|
|
||||||
}
|
|
||||||
$code .= " {$expr['op_expr']} ";
|
|
||||||
$code .= $this->php_generate_expr($expr[1]);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (is_array($expr)) {
|
|
||||||
$code .= $this->php_generate_stmt(array($expr));
|
|
||||||
} else {
|
|
||||||
if ($expr === FALSE) {
|
|
||||||
$expr = 'FALSE';
|
|
||||||
} else if ($expr === TRUE) {
|
|
||||||
$expr = 'TRUE';
|
|
||||||
}
|
|
||||||
$code .= $expr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $code;
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// php_generate_list(array ($array) {{{
|
|
||||||
/**
|
|
||||||
* Return a list of expressions for parameters
|
|
||||||
* of a function
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
protected function php_generate_list($array)
|
|
||||||
{
|
|
||||||
$code = "";
|
|
||||||
foreach ($array as $value) {
|
|
||||||
$code .= $this->php_generate_stmt(array($value));
|
|
||||||
$code .= ", ";
|
|
||||||
}
|
|
||||||
return substr($code, 0, -2);
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// php_generate_stmt(Array $op) {{{
|
|
||||||
/**
|
|
||||||
* Return the representation of a statement
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
protected function php_generate_stmt($op, $concat='.')
|
|
||||||
{
|
|
||||||
$code = "";
|
|
||||||
|
|
||||||
for ($i=0; $i < count($op); $i++) {
|
|
||||||
if (!isset($op[$i])) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (!is_Array($op[$i])) {
|
|
||||||
throw new Haanga_Compiler_Exception("Malformed declaration ".print_r($op, TRUE));
|
|
||||||
}
|
|
||||||
$key = key($op[$i]);
|
|
||||||
$value = current($op[$i]);
|
|
||||||
switch ($key) {
|
|
||||||
case 'array':
|
|
||||||
$code .= "Array(";
|
|
||||||
$code .= $this->php_generate_list($value);
|
|
||||||
$code .= ")";
|
|
||||||
break;
|
|
||||||
case 'function':
|
|
||||||
case 'exec':
|
|
||||||
if (strlen($code) != 0 && $code[strlen($code) -1] != $concat) {
|
|
||||||
$code .= $concat;
|
|
||||||
}
|
|
||||||
|
|
||||||
$value = array('name' => $value, 'args' => $op[$i]['args']);
|
|
||||||
$code .= $this->php_exec($value, FALSE);
|
|
||||||
$code .= $concat;
|
|
||||||
break;
|
|
||||||
case 'key':
|
|
||||||
$code .= $this->php_generate_stmt(array($value[0]))." => ".$this->php_generate_stmt(array($value[1]));
|
|
||||||
break;
|
|
||||||
case 'string':
|
|
||||||
if ($code != "" && $code[strlen($code)-1] == "'") {
|
|
||||||
$code = substr($code, 0, -1);
|
|
||||||
} else {
|
|
||||||
$code .= "'";
|
|
||||||
}
|
|
||||||
$html = addslashes_ex($value);
|
|
||||||
$code .= $html."'";
|
|
||||||
break;
|
|
||||||
case 'var':
|
|
||||||
if (strlen($code) != 0 && $code[strlen($code) -1] != $concat) {
|
|
||||||
$code .= $concat;
|
|
||||||
}
|
|
||||||
$code .= $this->php_get_varname($value). $concat;
|
|
||||||
break;
|
|
||||||
case 'number':
|
|
||||||
if (!is_numeric($value)) {
|
|
||||||
throw new Exception("$value is not a valid number");
|
|
||||||
}
|
|
||||||
$code .= $value;
|
|
||||||
break;
|
|
||||||
case 'op_expr':
|
|
||||||
if (strlen($code) != 0 && $code[strlen($code) -1] != $concat) {
|
|
||||||
$code .= $concat;
|
|
||||||
}
|
|
||||||
$code .= '(' . $this->php_generate_expr($op[$i]) . ')';
|
|
||||||
$code .= $concat;
|
|
||||||
break;
|
|
||||||
case 'expr':
|
|
||||||
if (strlen($code) != 0 && $code[strlen($code) -1] != $concat) {
|
|
||||||
$code .= $concat;
|
|
||||||
}
|
|
||||||
$code .= $this->php_generate_expr($value);
|
|
||||||
$code .= $concat;
|
|
||||||
break;
|
|
||||||
case 'expr_cond':
|
|
||||||
if (strlen($code) != 0 && $code[strlen($code) -1] != $concat) {
|
|
||||||
$code .= $concat;
|
|
||||||
}
|
|
||||||
$code .= "(";
|
|
||||||
$code .= $this->php_generate_expr($value);
|
|
||||||
$code .= " ? ";
|
|
||||||
$code .= $this->php_generate_stmt(array($op[$i]['true']));
|
|
||||||
$code .= " : ";
|
|
||||||
$code .= $this->php_generate_stmt(array($op[$i]['false']));
|
|
||||||
$code .= "){$concat}";
|
|
||||||
break;
|
|
||||||
case 'constant':
|
|
||||||
$code = $value;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
throw new Exception("Don't know how to declare {$key} = {$value} (".print_r($op, TRUE));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($code != "" && $code[strlen($code)-1] == $concat) {
|
|
||||||
$code = substr($code, 0, -1);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $code;
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// php_print(array $op) {{{
|
|
||||||
/**
|
|
||||||
* Return an echo of an stmt
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
protected function php_print($op)
|
|
||||||
{
|
|
||||||
$output = $this->php_generate_stmt($op, Haanga_Compiler::getOption('echo_concat'));
|
|
||||||
if ($output == "' '" && Haanga_Compiler::getOption('strip_whitespace')) {
|
|
||||||
return; /* ignore this */
|
|
||||||
}
|
|
||||||
return 'echo '.$output.';';
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// php_inc(array $op) {{{
|
|
||||||
/**
|
|
||||||
* Return increment a variable ($var++)
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
protected function php_inc($op)
|
|
||||||
{
|
|
||||||
return "++".$this->php_get_varname($op['name']);
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// php_declare(array $op, $assign='=') {{{
|
|
||||||
/**
|
|
||||||
* Return a variable declaration
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
protected function php_declare($op, $assign=' =')
|
|
||||||
{
|
|
||||||
$op['name'] = $this->php_get_varname($op['name']);
|
|
||||||
$code = "{$op['name']} {$assign} ".$this->php_generate_stmt($op).";";
|
|
||||||
return $code;
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// php_get_varname(mixed $var) {{{
|
|
||||||
/**
|
|
||||||
* Return a variable
|
|
||||||
*
|
|
||||||
* @param mixed $var
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
protected function php_get_varname($var)
|
|
||||||
{
|
|
||||||
if (is_array($var)) {
|
|
||||||
if (!is_string($var[0])) {
|
|
||||||
if (count($var) == 1) {
|
|
||||||
return $this->php_get_varname($var[0]);
|
|
||||||
} else {
|
|
||||||
throw new Exception("Invalid variable definition ".print_r($var, TRUE));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$var_str = $this->php_get_varname($var[0]);
|
|
||||||
for ($i=1; $i < count($var); $i++) {
|
|
||||||
if (is_string($var[$i])) {
|
|
||||||
$var_str .= "['".addslashes_ex($var[$i])."']";
|
|
||||||
} else if (is_array($var[$i])) {
|
|
||||||
if (isset($var[$i]['var'])) {
|
|
||||||
/* index is a variable */
|
|
||||||
$var_str .= '['.$this->php_get_varname($var[$i]['var']).']';
|
|
||||||
} else if (isset($var[$i]['string'])) {
|
|
||||||
/* index is a string */
|
|
||||||
$var_str .= "['".addslashes_ex($var[$i]['string'])."']";
|
|
||||||
} else if (isset($var[$i]['number'])) {
|
|
||||||
/* index is a number */
|
|
||||||
$var_str .= '['.$var[$i]['number'].']';
|
|
||||||
} else if (isset($var[$i]['object'])) {
|
|
||||||
/* Accessing a object's property */
|
|
||||||
if (is_array($var[$i]['object'])) {
|
|
||||||
$var_str .= '->{'.$this->php_get_varname($var[$i]['object']['var']).'}';
|
|
||||||
} else {
|
|
||||||
$var_str .= '->'.$var[$i]['object'];
|
|
||||||
}
|
|
||||||
} else if (isset($var[$i]['class'])) {
|
|
||||||
/* Accessing a class' property */
|
|
||||||
$var_str = substr($var_str, 1);
|
|
||||||
if (is_array($var[$i]['class'])) {
|
|
||||||
$var_str .= '::{'.$this->php_get_varname($var[$i]['class']['var']).'}';
|
|
||||||
} else {
|
|
||||||
$var_str .= '::'.$var[$i]['class'];
|
|
||||||
}
|
|
||||||
} else if ($var[$i] === array()) {
|
|
||||||
/* index is a NULL (do append) */
|
|
||||||
$var_str .= '[]';
|
|
||||||
} else {
|
|
||||||
throw new Haanga_Compiler_Exception('Unknown variable definition '.print_r($var, TRUE));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $var_str;
|
|
||||||
} else {
|
|
||||||
return "\$".$var;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// php_return($op) {{{
|
|
||||||
/**
|
|
||||||
* Return "return"
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
protected function php_return($op)
|
|
||||||
{
|
|
||||||
$code = "return ".$this->php_generate_stmt($op).";";
|
|
||||||
return $code;
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Local variables:
|
|
||||||
* tab-width: 4
|
|
||||||
* c-basic-offset: 4
|
|
||||||
* End:
|
|
||||||
* vim600: sw=4 ts=4 fdm=marker
|
|
||||||
* vim<600: sw=4 ts=4
|
|
||||||
*/
|
|
||||||
118
gulliver/thirdparty/Haanga/lib/Haanga/Loader.php
vendored
@@ -1,118 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
function hanga_anonymous($class) {
|
|
||||||
/*
|
|
||||||
This array has a map of (class => file)
|
|
||||||
*/
|
|
||||||
|
|
||||||
// classes {{{
|
|
||||||
static $classes = array (
|
|
||||||
'haanga' => '/../Haanga.php',
|
|
||||||
'haanga_ast' => '/AST.php',
|
|
||||||
'haanga_extension_filter' => '/Extension/Filter.php',
|
|
||||||
'haanga_extension' => '/Extension.php',
|
|
||||||
'haanga_extension_tag_spaceless' => '/Extension/Tag/Spaceless.php',
|
|
||||||
'haanga_extension_tag_exec' => '/Extension/Tag/Exec.php',
|
|
||||||
'haanga_extension_tag_inline' => '/Extension/Tag/Inline.php',
|
|
||||||
'haanga_extension_tag_upper' => '/Extension/Tag/Upper.php',
|
|
||||||
'haanga_extension_tag_trans' => '/Extension/Tag/Trans.php',
|
|
||||||
'haanga_extension_tag_templatetag' => '/Extension/Tag/Templatetag.php',
|
|
||||||
'haanga_extension_tag_tryinclude' => '/Extension/Tag/Tryinclude.php',
|
|
||||||
'haanga_extension_tag_setsafe' => '/Extension/Tag/Setsafe.php',
|
|
||||||
'haanga_extension_tag_dictsort' => '/Extension/Tag/Dictsort.php',
|
|
||||||
'haanga_extension_tag_min' => '/Extension/Tag/Min.php',
|
|
||||||
'haanga_extension_tag_lower' => '/Extension/Tag/Lower.php',
|
|
||||||
'haanga_extension_tag_currenttime' => '/Extension/Tag/Currenttime.php',
|
|
||||||
'haanga_extension_tag_firstof' => '/Extension/Tag/Firstof.php',
|
|
||||||
'haanga_extension_tag_buffer' => '/Extension/Tag/Buffer.php',
|
|
||||||
'haanga_extension_tag_cycle' => '/Extension/Tag/Cycle.php',
|
|
||||||
'haanga_extension_filter_urlencode' => '/Extension/Filter/Urlencode.php',
|
|
||||||
'haanga_extension_filter_default' => '/Extension/Filter/Default.php',
|
|
||||||
'haanga_extension_filter_length' => '/Extension/Filter/Length.php',
|
|
||||||
'haanga_extension_filter_truncatechars' => '/Extension/Filter/Truncatechars.php',
|
|
||||||
'haanga_extension_filter_intval' => '/Extension/Filter/Intval.php',
|
|
||||||
'haanga_extension_filter_translation' => '/Extension/Filter/Translation.php',
|
|
||||||
'haanga_extension_filter_trans' => '/Extension/Filter/Trans.php',
|
|
||||||
'haanga_extension_filter_stringformat' => '/Extension/Filter/Stringformat.php',
|
|
||||||
'haanga_extension_filter_capfirst' => '/Extension/Filter/Capfirst.php',
|
|
||||||
'haanga_extension_filter_reverse' => '/Extension/Filter/Reverse.php',
|
|
||||||
'haanga_extension_filter_substr' => '/Extension/Filter/Substr.php',
|
|
||||||
'haanga_extension_filter_upper' => '/Extension/Filter/Upper.php',
|
|
||||||
'haanga_extension_filter_isarray' => '/Extension/Filter/Isarray.php',
|
|
||||||
'haanga_extension_filter_empty' => '/Extension/Filter/Empty.php',
|
|
||||||
'haanga_extension_filter_trim' => '/Extension/Filter/Trim.php',
|
|
||||||
'haanga_extension_filter_hostname' => '/Extension/Filter/Hostname.php',
|
|
||||||
'haanga_extension_filter_count' => '/Extension/Filter/Count.php',
|
|
||||||
'haanga_extension_filter_truncatewords' => '/Extension/Filter/Truncatewords.php',
|
|
||||||
'haanga_extension_filter_dictsort' => '/Extension/Filter/Dictsort.php',
|
|
||||||
'haanga_extension_filter_exists' => '/Extension/Filter/Exists.php',
|
|
||||||
'haanga_extension_filter_title' => '/Extension/Filter/Title.php',
|
|
||||||
'haanga_extension_filter_cut' => '/Extension/Filter/Cut.php',
|
|
||||||
'haanga_extension_filter_date' => '/Extension/Filter/Date.php',
|
|
||||||
'haanga_extension_filter_lower' => '/Extension/Filter/Lower.php',
|
|
||||||
'haanga_extension_filter_slugify' => '/Extension/Filter/Slugify.php',
|
|
||||||
'haanga_extension_filter_join' => '/Extension/Filter/Join.php',
|
|
||||||
'haanga_extension_filter_escape' => '/Extension/Filter/Escape.php',
|
|
||||||
'haanga_extension_filter_pluralize' => '/Extension/Filter/Pluralize.php',
|
|
||||||
'haanga_extension_filter_safe' => '/Extension/Filter/Safe.php',
|
|
||||||
'haanga_extension_filter_null' => '/Extension/Filter/Null.php',
|
|
||||||
'haanga_extension_tag' => '/Extension/Tag.php',
|
|
||||||
'hg_parser' => '/Compiler/Tokenizer.php',
|
|
||||||
'haanga_compiler_parser' => '/Compiler/Parser.php',
|
|
||||||
'haanga_compiler_tokenizer' => '/Compiler/Tokenizer.php',
|
|
||||||
'haanga_yytoken' => '/Compiler/Parser.php',
|
|
||||||
'haanga_yystackentry' => '/Compiler/Parser.php',
|
|
||||||
'haanga_compiler_exception' => '/Compiler/Exception.php',
|
|
||||||
'haanga_compiler_runtime' => '/Compiler/Runtime.php',
|
|
||||||
'haanga_compiler' => '/Compiler.php',
|
|
||||||
'haanga_exception' => '/Exception.php',
|
|
||||||
'haanga_generator_php' => '/Generator/PHP.php',
|
|
||||||
);
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// deps {{{
|
|
||||||
static $deps = array (
|
|
||||||
'haanga_extension_filter' =>
|
|
||||||
array (
|
|
||||||
0 => 'haanga_extension',
|
|
||||||
),
|
|
||||||
'haanga_extension_filter_translation' =>
|
|
||||||
array (
|
|
||||||
0 => 'haanga_extension_filter_trans',
|
|
||||||
),
|
|
||||||
'haanga_extension_tag' =>
|
|
||||||
array (
|
|
||||||
0 => 'haanga_extension',
|
|
||||||
),
|
|
||||||
'hg_parser' =>
|
|
||||||
array (
|
|
||||||
0 => 'haanga_compiler_parser',
|
|
||||||
),
|
|
||||||
'haanga_compiler_runtime' =>
|
|
||||||
array (
|
|
||||||
0 => 'haanga_compiler',
|
|
||||||
),
|
|
||||||
);
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
$class = strtolower($class);
|
|
||||||
if (isset($classes[$class])) {
|
|
||||||
if (!empty($deps[$class])) {
|
|
||||||
foreach ($deps[$class] as $zclass) {
|
|
||||||
if (!class_exists($zclass, false) && !interface_exists($zclass, false)) {
|
|
||||||
require __DIR__ . $classes[$zclass];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!class_exists($class, false) && !interface_exists($class, false)) {
|
|
||||||
require __DIR__ . $classes[$class];
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
spl_autoload_register( "hanga_anonymous" );
|
|
||||||
|
|
||||||
|
|
||||||
32
gulliver/thirdparty/krumo/INSTALL
vendored
@@ -1,32 +0,0 @@
|
|||||||
------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
SETUP: How to install Krumo ?
|
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
In order to use Krumo you have to put it on your (development) server, and
|
|
||||||
include it in your script. You can put it somewhere in the INCLUDE_PATH, or
|
|
||||||
specify the full path to the "class.krumo.php" file.
|
|
||||||
|
|
||||||
You have to modify the "krumo.ini" file too. It is the configuration file for
|
|
||||||
Krumo. The first option is choosing a skin:
|
|
||||||
|
|
||||||
[skin]
|
|
||||||
selected = "orange"
|
|
||||||
|
|
||||||
The value for this setting has to be the name of one of the sub-folders from the
|
|
||||||
"Krumo/skins/" folder. If the value provided for the skin results in not finding
|
|
||||||
the skin, the `default` skin will be used instead.
|
|
||||||
|
|
||||||
The second option is used to set the correct web path to the folder where Krumo
|
|
||||||
is installed. This is used in order to make the images from Krumo's CSS skins
|
|
||||||
web-accessible.
|
|
||||||
|
|
||||||
[css]
|
|
||||||
url = "http://www.example.com/Krumo/"
|
|
||||||
|
|
||||||
So far those two are the only configuration options.
|
|
||||||
|
|
||||||
All the CSS files ("skin.css") from the "Krumo/skins/" sub-folders must have the
|
|
||||||
proper permissions in order to be readable from Krumo. Same applies for
|
|
||||||
"krumo.ini" and "krumo.js" files.
|
|
||||||
504
gulliver/thirdparty/krumo/LICENSE
vendored
@@ -1,504 +0,0 @@
|
|||||||
GNU LESSER GENERAL PUBLIC LICENSE
|
|
||||||
Version 2.1, February 1999
|
|
||||||
|
|
||||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
|
||||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
[This is the first released version of the Lesser GPL. It also counts
|
|
||||||
as the successor of the GNU Library Public License, version 2, hence
|
|
||||||
the version number 2.1.]
|
|
||||||
|
|
||||||
Preamble
|
|
||||||
|
|
||||||
The licenses for most software are designed to take away your
|
|
||||||
freedom to share and change it. By contrast, the GNU General Public
|
|
||||||
Licenses are intended to guarantee your freedom to share and change
|
|
||||||
free software--to make sure the software is free for all its users.
|
|
||||||
|
|
||||||
This license, the Lesser General Public License, applies to some
|
|
||||||
specially designated software packages--typically libraries--of the
|
|
||||||
Free Software Foundation and other authors who decide to use it. You
|
|
||||||
can use it too, but we suggest you first think carefully about whether
|
|
||||||
this license or the ordinary General Public License is the better
|
|
||||||
strategy to use in any particular case, based on the explanations below.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom of use,
|
|
||||||
not price. Our General Public Licenses are designed to make sure that
|
|
||||||
you have the freedom to distribute copies of free software (and charge
|
|
||||||
for this service if you wish); that you receive source code or can get
|
|
||||||
it if you want it; that you can change the software and use pieces of
|
|
||||||
it in new free programs; and that you are informed that you can do
|
|
||||||
these things.
|
|
||||||
|
|
||||||
To protect your rights, we need to make restrictions that forbid
|
|
||||||
distributors to deny you these rights or to ask you to surrender these
|
|
||||||
rights. These restrictions translate to certain responsibilities for
|
|
||||||
you if you distribute copies of the library or if you modify it.
|
|
||||||
|
|
||||||
For example, if you distribute copies of the library, whether gratis
|
|
||||||
or for a fee, you must give the recipients all the rights that we gave
|
|
||||||
you. You must make sure that they, too, receive or can get the source
|
|
||||||
code. If you link other code with the library, you must provide
|
|
||||||
complete object files to the recipients, so that they can relink them
|
|
||||||
with the library after making changes to the library and recompiling
|
|
||||||
it. And you must show them these terms so they know their rights.
|
|
||||||
|
|
||||||
We protect your rights with a two-step method: (1) we copyright the
|
|
||||||
library, and (2) we offer you this license, which gives you legal
|
|
||||||
permission to copy, distribute and/or modify the library.
|
|
||||||
|
|
||||||
To protect each distributor, we want to make it very clear that
|
|
||||||
there is no warranty for the free library. Also, if the library is
|
|
||||||
modified by someone else and passed on, the recipients should know
|
|
||||||
that what they have is not the original version, so that the original
|
|
||||||
author's reputation will not be affected by problems that might be
|
|
||||||
introduced by others.
|
|
||||||
|
|
||||||
Finally, software patents pose a constant threat to the existence of
|
|
||||||
any free program. We wish to make sure that a company cannot
|
|
||||||
effectively restrict the users of a free program by obtaining a
|
|
||||||
restrictive license from a patent holder. Therefore, we insist that
|
|
||||||
any patent license obtained for a version of the library must be
|
|
||||||
consistent with the full freedom of use specified in this license.
|
|
||||||
|
|
||||||
Most GNU software, including some libraries, is covered by the
|
|
||||||
ordinary GNU General Public License. This license, the GNU Lesser
|
|
||||||
General Public License, applies to certain designated libraries, and
|
|
||||||
is quite different from the ordinary General Public License. We use
|
|
||||||
this license for certain libraries in order to permit linking those
|
|
||||||
libraries into non-free programs.
|
|
||||||
|
|
||||||
When a program is linked with a library, whether statically or using
|
|
||||||
a shared library, the combination of the two is legally speaking a
|
|
||||||
combined work, a derivative of the original library. The ordinary
|
|
||||||
General Public License therefore permits such linking only if the
|
|
||||||
entire combination fits its criteria of freedom. The Lesser General
|
|
||||||
Public License permits more lax criteria for linking other code with
|
|
||||||
the library.
|
|
||||||
|
|
||||||
We call this license the "Lesser" General Public License because it
|
|
||||||
does Less to protect the user's freedom than the ordinary General
|
|
||||||
Public License. It also provides other free software developers Less
|
|
||||||
of an advantage over competing non-free programs. These disadvantages
|
|
||||||
are the reason we use the ordinary General Public License for many
|
|
||||||
libraries. However, the Lesser license provides advantages in certain
|
|
||||||
special circumstances.
|
|
||||||
|
|
||||||
For example, on rare occasions, there may be a special need to
|
|
||||||
encourage the widest possible use of a certain library, so that it becomes
|
|
||||||
a de-facto standard. To achieve this, non-free programs must be
|
|
||||||
allowed to use the library. A more frequent case is that a free
|
|
||||||
library does the same job as widely used non-free libraries. In this
|
|
||||||
case, there is little to gain by limiting the free library to free
|
|
||||||
software only, so we use the Lesser General Public License.
|
|
||||||
|
|
||||||
In other cases, permission to use a particular library in non-free
|
|
||||||
programs enables a greater number of people to use a large body of
|
|
||||||
free software. For example, permission to use the GNU C Library in
|
|
||||||
non-free programs enables many more people to use the whole GNU
|
|
||||||
operating system, as well as its variant, the GNU/Linux operating
|
|
||||||
system.
|
|
||||||
|
|
||||||
Although the Lesser General Public License is Less protective of the
|
|
||||||
users' freedom, it does ensure that the user of a program that is
|
|
||||||
linked with the Library has the freedom and the wherewithal to run
|
|
||||||
that program using a modified version of the Library.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow. Pay close attention to the difference between a
|
|
||||||
"work based on the library" and a "work that uses the library". The
|
|
||||||
former contains code derived from the library, whereas the latter must
|
|
||||||
be combined with the library in order to run.
|
|
||||||
|
|
||||||
GNU LESSER GENERAL PUBLIC LICENSE
|
|
||||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
|
||||||
|
|
||||||
0. This License Agreement applies to any software library or other
|
|
||||||
program which contains a notice placed by the copyright holder or
|
|
||||||
other authorized party saying it may be distributed under the terms of
|
|
||||||
this Lesser General Public License (also called "this License").
|
|
||||||
Each licensee is addressed as "you".
|
|
||||||
|
|
||||||
A "library" means a collection of software functions and/or data
|
|
||||||
prepared so as to be conveniently linked with application programs
|
|
||||||
(which use some of those functions and data) to form executables.
|
|
||||||
|
|
||||||
The "Library", below, refers to any such software library or work
|
|
||||||
which has been distributed under these terms. A "work based on the
|
|
||||||
Library" means either the Library or any derivative work under
|
|
||||||
copyright law: that is to say, a work containing the Library or a
|
|
||||||
portion of it, either verbatim or with modifications and/or translated
|
|
||||||
straightforwardly into another language. (Hereinafter, translation is
|
|
||||||
included without limitation in the term "modification".)
|
|
||||||
|
|
||||||
"Source code" for a work means the preferred form of the work for
|
|
||||||
making modifications to it. For a library, complete source code means
|
|
||||||
all the source code for all modules it contains, plus any associated
|
|
||||||
interface definition files, plus the scripts used to control compilation
|
|
||||||
and installation of the library.
|
|
||||||
|
|
||||||
Activities other than copying, distribution and modification are not
|
|
||||||
covered by this License; they are outside its scope. The act of
|
|
||||||
running a program using the Library is not restricted, and output from
|
|
||||||
such a program is covered only if its contents constitute a work based
|
|
||||||
on the Library (independent of the use of the Library in a tool for
|
|
||||||
writing it). Whether that is true depends on what the Library does
|
|
||||||
and what the program that uses the Library does.
|
|
||||||
|
|
||||||
1. You may copy and distribute verbatim copies of the Library's
|
|
||||||
complete source code as you receive it, in any medium, provided that
|
|
||||||
you conspicuously and appropriately publish on each copy an
|
|
||||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
|
||||||
all the notices that refer to this License and to the absence of any
|
|
||||||
warranty; and distribute a copy of this License along with the
|
|
||||||
Library.
|
|
||||||
|
|
||||||
You may charge a fee for the physical act of transferring a copy,
|
|
||||||
and you may at your option offer warranty protection in exchange for a
|
|
||||||
fee.
|
|
||||||
|
|
||||||
2. You may modify your copy or copies of the Library or any portion
|
|
||||||
of it, thus forming a work based on the Library, and copy and
|
|
||||||
distribute such modifications or work under the terms of Section 1
|
|
||||||
above, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) The modified work must itself be a software library.
|
|
||||||
|
|
||||||
b) You must cause the files modified to carry prominent notices
|
|
||||||
stating that you changed the files and the date of any change.
|
|
||||||
|
|
||||||
c) You must cause the whole of the work to be licensed at no
|
|
||||||
charge to all third parties under the terms of this License.
|
|
||||||
|
|
||||||
d) If a facility in the modified Library refers to a function or a
|
|
||||||
table of data to be supplied by an application program that uses
|
|
||||||
the facility, other than as an argument passed when the facility
|
|
||||||
is invoked, then you must make a good faith effort to ensure that,
|
|
||||||
in the event an application does not supply such function or
|
|
||||||
table, the facility still operates, and performs whatever part of
|
|
||||||
its purpose remains meaningful.
|
|
||||||
|
|
||||||
(For example, a function in a library to compute square roots has
|
|
||||||
a purpose that is entirely well-defined independent of the
|
|
||||||
application. Therefore, Subsection 2d requires that any
|
|
||||||
application-supplied function or table used by this function must
|
|
||||||
be optional: if the application does not supply it, the square
|
|
||||||
root function must still compute square roots.)
|
|
||||||
|
|
||||||
These requirements apply to the modified work as a whole. If
|
|
||||||
identifiable sections of that work are not derived from the Library,
|
|
||||||
and can be reasonably considered independent and separate works in
|
|
||||||
themselves, then this License, and its terms, do not apply to those
|
|
||||||
sections when you distribute them as separate works. But when you
|
|
||||||
distribute the same sections as part of a whole which is a work based
|
|
||||||
on the Library, the distribution of the whole must be on the terms of
|
|
||||||
this License, whose permissions for other licensees extend to the
|
|
||||||
entire whole, and thus to each and every part regardless of who wrote
|
|
||||||
it.
|
|
||||||
|
|
||||||
Thus, it is not the intent of this section to claim rights or contest
|
|
||||||
your rights to work written entirely by you; rather, the intent is to
|
|
||||||
exercise the right to control the distribution of derivative or
|
|
||||||
collective works based on the Library.
|
|
||||||
|
|
||||||
In addition, mere aggregation of another work not based on the Library
|
|
||||||
with the Library (or with a work based on the Library) on a volume of
|
|
||||||
a storage or distribution medium does not bring the other work under
|
|
||||||
the scope of this License.
|
|
||||||
|
|
||||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
|
||||||
License instead of this License to a given copy of the Library. To do
|
|
||||||
this, you must alter all the notices that refer to this License, so
|
|
||||||
that they refer to the ordinary GNU General Public License, version 2,
|
|
||||||
instead of to this License. (If a newer version than version 2 of the
|
|
||||||
ordinary GNU General Public License has appeared, then you can specify
|
|
||||||
that version instead if you wish.) Do not make any other change in
|
|
||||||
these notices.
|
|
||||||
|
|
||||||
Once this change is made in a given copy, it is irreversible for
|
|
||||||
that copy, so the ordinary GNU General Public License applies to all
|
|
||||||
subsequent copies and derivative works made from that copy.
|
|
||||||
|
|
||||||
This option is useful when you wish to copy part of the code of
|
|
||||||
the Library into a program that is not a library.
|
|
||||||
|
|
||||||
4. You may copy and distribute the Library (or a portion or
|
|
||||||
derivative of it, under Section 2) in object code or executable form
|
|
||||||
under the terms of Sections 1 and 2 above provided that you accompany
|
|
||||||
it with the complete corresponding machine-readable source code, which
|
|
||||||
must be distributed under the terms of Sections 1 and 2 above on a
|
|
||||||
medium customarily used for software interchange.
|
|
||||||
|
|
||||||
If distribution of object code is made by offering access to copy
|
|
||||||
from a designated place, then offering equivalent access to copy the
|
|
||||||
source code from the same place satisfies the requirement to
|
|
||||||
distribute the source code, even though third parties are not
|
|
||||||
compelled to copy the source along with the object code.
|
|
||||||
|
|
||||||
5. A program that contains no derivative of any portion of the
|
|
||||||
Library, but is designed to work with the Library by being compiled or
|
|
||||||
linked with it, is called a "work that uses the Library". Such a
|
|
||||||
work, in isolation, is not a derivative work of the Library, and
|
|
||||||
therefore falls outside the scope of this License.
|
|
||||||
|
|
||||||
However, linking a "work that uses the Library" with the Library
|
|
||||||
creates an executable that is a derivative of the Library (because it
|
|
||||||
contains portions of the Library), rather than a "work that uses the
|
|
||||||
library". The executable is therefore covered by this License.
|
|
||||||
Section 6 states terms for distribution of such executables.
|
|
||||||
|
|
||||||
When a "work that uses the Library" uses material from a header file
|
|
||||||
that is part of the Library, the object code for the work may be a
|
|
||||||
derivative work of the Library even though the source code is not.
|
|
||||||
Whether this is true is especially significant if the work can be
|
|
||||||
linked without the Library, or if the work is itself a library. The
|
|
||||||
threshold for this to be true is not precisely defined by law.
|
|
||||||
|
|
||||||
If such an object file uses only numerical parameters, data
|
|
||||||
structure layouts and accessors, and small macros and small inline
|
|
||||||
functions (ten lines or less in length), then the use of the object
|
|
||||||
file is unrestricted, regardless of whether it is legally a derivative
|
|
||||||
work. (Executables containing this object code plus portions of the
|
|
||||||
Library will still fall under Section 6.)
|
|
||||||
|
|
||||||
Otherwise, if the work is a derivative of the Library, you may
|
|
||||||
distribute the object code for the work under the terms of Section 6.
|
|
||||||
Any executables containing that work also fall under Section 6,
|
|
||||||
whether or not they are linked directly with the Library itself.
|
|
||||||
|
|
||||||
6. As an exception to the Sections above, you may also combine or
|
|
||||||
link a "work that uses the Library" with the Library to produce a
|
|
||||||
work containing portions of the Library, and distribute that work
|
|
||||||
under terms of your choice, provided that the terms permit
|
|
||||||
modification of the work for the customer's own use and reverse
|
|
||||||
engineering for debugging such modifications.
|
|
||||||
|
|
||||||
You must give prominent notice with each copy of the work that the
|
|
||||||
Library is used in it and that the Library and its use are covered by
|
|
||||||
this License. You must supply a copy of this License. If the work
|
|
||||||
during execution displays copyright notices, you must include the
|
|
||||||
copyright notice for the Library among them, as well as a reference
|
|
||||||
directing the user to the copy of this License. Also, you must do one
|
|
||||||
of these things:
|
|
||||||
|
|
||||||
a) Accompany the work with the complete corresponding
|
|
||||||
machine-readable source code for the Library including whatever
|
|
||||||
changes were used in the work (which must be distributed under
|
|
||||||
Sections 1 and 2 above); and, if the work is an executable linked
|
|
||||||
with the Library, with the complete machine-readable "work that
|
|
||||||
uses the Library", as object code and/or source code, so that the
|
|
||||||
user can modify the Library and then relink to produce a modified
|
|
||||||
executable containing the modified Library. (It is understood
|
|
||||||
that the user who changes the contents of definitions files in the
|
|
||||||
Library will not necessarily be able to recompile the application
|
|
||||||
to use the modified definitions.)
|
|
||||||
|
|
||||||
b) Use a suitable shared library mechanism for linking with the
|
|
||||||
Library. A suitable mechanism is one that (1) uses at run time a
|
|
||||||
copy of the library already present on the user's computer system,
|
|
||||||
rather than copying library functions into the executable, and (2)
|
|
||||||
will operate properly with a modified version of the library, if
|
|
||||||
the user installs one, as long as the modified version is
|
|
||||||
interface-compatible with the version that the work was made with.
|
|
||||||
|
|
||||||
c) Accompany the work with a written offer, valid for at
|
|
||||||
least three years, to give the same user the materials
|
|
||||||
specified in Subsection 6a, above, for a charge no more
|
|
||||||
than the cost of performing this distribution.
|
|
||||||
|
|
||||||
d) If distribution of the work is made by offering access to copy
|
|
||||||
from a designated place, offer equivalent access to copy the above
|
|
||||||
specified materials from the same place.
|
|
||||||
|
|
||||||
e) Verify that the user has already received a copy of these
|
|
||||||
materials or that you have already sent this user a copy.
|
|
||||||
|
|
||||||
For an executable, the required form of the "work that uses the
|
|
||||||
Library" must include any data and utility programs needed for
|
|
||||||
reproducing the executable from it. However, as a special exception,
|
|
||||||
the materials to be distributed need not include anything that is
|
|
||||||
normally distributed (in either source or binary form) with the major
|
|
||||||
components (compiler, kernel, and so on) of the operating system on
|
|
||||||
which the executable runs, unless that component itself accompanies
|
|
||||||
the executable.
|
|
||||||
|
|
||||||
It may happen that this requirement contradicts the license
|
|
||||||
restrictions of other proprietary libraries that do not normally
|
|
||||||
accompany the operating system. Such a contradiction means you cannot
|
|
||||||
use both them and the Library together in an executable that you
|
|
||||||
distribute.
|
|
||||||
|
|
||||||
7. You may place library facilities that are a work based on the
|
|
||||||
Library side-by-side in a single library together with other library
|
|
||||||
facilities not covered by this License, and distribute such a combined
|
|
||||||
library, provided that the separate distribution of the work based on
|
|
||||||
the Library and of the other library facilities is otherwise
|
|
||||||
permitted, and provided that you do these two things:
|
|
||||||
|
|
||||||
a) Accompany the combined library with a copy of the same work
|
|
||||||
based on the Library, uncombined with any other library
|
|
||||||
facilities. This must be distributed under the terms of the
|
|
||||||
Sections above.
|
|
||||||
|
|
||||||
b) Give prominent notice with the combined library of the fact
|
|
||||||
that part of it is a work based on the Library, and explaining
|
|
||||||
where to find the accompanying uncombined form of the same work.
|
|
||||||
|
|
||||||
8. You may not copy, modify, sublicense, link with, or distribute
|
|
||||||
the Library except as expressly provided under this License. Any
|
|
||||||
attempt otherwise to copy, modify, sublicense, link with, or
|
|
||||||
distribute the Library is void, and will automatically terminate your
|
|
||||||
rights under this License. However, parties who have received copies,
|
|
||||||
or rights, from you under this License will not have their licenses
|
|
||||||
terminated so long as such parties remain in full compliance.
|
|
||||||
|
|
||||||
9. You are not required to accept this License, since you have not
|
|
||||||
signed it. However, nothing else grants you permission to modify or
|
|
||||||
distribute the Library or its derivative works. These actions are
|
|
||||||
prohibited by law if you do not accept this License. Therefore, by
|
|
||||||
modifying or distributing the Library (or any work based on the
|
|
||||||
Library), you indicate your acceptance of this License to do so, and
|
|
||||||
all its terms and conditions for copying, distributing or modifying
|
|
||||||
the Library or works based on it.
|
|
||||||
|
|
||||||
10. Each time you redistribute the Library (or any work based on the
|
|
||||||
Library), the recipient automatically receives a license from the
|
|
||||||
original licensor to copy, distribute, link with or modify the Library
|
|
||||||
subject to these terms and conditions. You may not impose any further
|
|
||||||
restrictions on the recipients' exercise of the rights granted herein.
|
|
||||||
You are not responsible for enforcing compliance by third parties with
|
|
||||||
this License.
|
|
||||||
|
|
||||||
11. If, as a consequence of a court judgment or allegation of patent
|
|
||||||
infringement or for any other reason (not limited to patent issues),
|
|
||||||
conditions are imposed on you (whether by court order, agreement or
|
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
|
||||||
excuse you from the conditions of this License. If you cannot
|
|
||||||
distribute so as to satisfy simultaneously your obligations under this
|
|
||||||
License and any other pertinent obligations, then as a consequence you
|
|
||||||
may not distribute the Library at all. For example, if a patent
|
|
||||||
license would not permit royalty-free redistribution of the Library by
|
|
||||||
all those who receive copies directly or indirectly through you, then
|
|
||||||
the only way you could satisfy both it and this License would be to
|
|
||||||
refrain entirely from distribution of the Library.
|
|
||||||
|
|
||||||
If any portion of this section is held invalid or unenforceable under any
|
|
||||||
particular circumstance, the balance of the section is intended to apply,
|
|
||||||
and the section as a whole is intended to apply in other circumstances.
|
|
||||||
|
|
||||||
It is not the purpose of this section to induce you to infringe any
|
|
||||||
patents or other property right claims or to contest validity of any
|
|
||||||
such claims; this section has the sole purpose of protecting the
|
|
||||||
integrity of the free software distribution system which is
|
|
||||||
implemented by public license practices. Many people have made
|
|
||||||
generous contributions to the wide range of software distributed
|
|
||||||
through that system in reliance on consistent application of that
|
|
||||||
system; it is up to the author/donor to decide if he or she is willing
|
|
||||||
to distribute software through any other system and a licensee cannot
|
|
||||||
impose that choice.
|
|
||||||
|
|
||||||
This section is intended to make thoroughly clear what is believed to
|
|
||||||
be a consequence of the rest of this License.
|
|
||||||
|
|
||||||
12. If the distribution and/or use of the Library is restricted in
|
|
||||||
certain countries either by patents or by copyrighted interfaces, the
|
|
||||||
original copyright holder who places the Library under this License may add
|
|
||||||
an explicit geographical distribution limitation excluding those countries,
|
|
||||||
so that distribution is permitted only in or among countries not thus
|
|
||||||
excluded. In such case, this License incorporates the limitation as if
|
|
||||||
written in the body of this License.
|
|
||||||
|
|
||||||
13. The Free Software Foundation may publish revised and/or new
|
|
||||||
versions of the Lesser General Public License from time to time.
|
|
||||||
Such new versions will be similar in spirit to the present version,
|
|
||||||
but may differ in detail to address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the Library
|
|
||||||
specifies a version number of this License which applies to it and
|
|
||||||
"any later version", you have the option of following the terms and
|
|
||||||
conditions either of that version or of any later version published by
|
|
||||||
the Free Software Foundation. If the Library does not specify a
|
|
||||||
license version number, you may choose any version ever published by
|
|
||||||
the Free Software Foundation.
|
|
||||||
|
|
||||||
14. If you wish to incorporate parts of the Library into other free
|
|
||||||
programs whose distribution conditions are incompatible with these,
|
|
||||||
write to the author to ask for permission. For software which is
|
|
||||||
copyrighted by the Free Software Foundation, write to the Free
|
|
||||||
Software Foundation; we sometimes make exceptions for this. Our
|
|
||||||
decision will be guided by the two goals of preserving the free status
|
|
||||||
of all derivatives of our free software and of promoting the sharing
|
|
||||||
and reuse of software generally.
|
|
||||||
|
|
||||||
NO WARRANTY
|
|
||||||
|
|
||||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
|
||||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
|
||||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
|
||||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
|
||||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
|
||||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
|
||||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
|
||||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
|
||||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
|
||||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
|
||||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
|
||||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
|
||||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
|
||||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
|
||||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
|
||||||
DAMAGES.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
How to Apply These Terms to Your New Libraries
|
|
||||||
|
|
||||||
If you develop a new library, and you want it to be of the greatest
|
|
||||||
possible use to the public, we recommend making it free software that
|
|
||||||
everyone can redistribute and change. You can do so by permitting
|
|
||||||
redistribution under these terms (or, alternatively, under the terms of the
|
|
||||||
ordinary General Public License).
|
|
||||||
|
|
||||||
To apply these terms, attach the following notices to the library. It is
|
|
||||||
safest to attach them to the start of each source file to most effectively
|
|
||||||
convey the exclusion of warranty; and each file should have at least the
|
|
||||||
"copyright" line and a pointer to where the full notice is found.
|
|
||||||
|
|
||||||
<one line to give the library's name and a brief idea of what it does.>
|
|
||||||
Copyright (C) <year> <name of author>
|
|
||||||
|
|
||||||
This library is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU Lesser General Public
|
|
||||||
License as published by the Free Software Foundation; either
|
|
||||||
version 2.1 of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
This library is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public
|
|
||||||
License along with this library; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or your
|
|
||||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
|
||||||
necessary. Here is a sample; alter the names:
|
|
||||||
|
|
||||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
|
||||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
|
||||||
|
|
||||||
<signature of Ty Coon>, 1 April 1990
|
|
||||||
Ty Coon, President of Vice
|
|
||||||
|
|
||||||
That's all there is to it!
|
|
||||||
|
|
||||||
|
|
||||||
103
gulliver/thirdparty/krumo/README
vendored
@@ -1,103 +0,0 @@
|
|||||||
=============================================================================
|
|
||||||
|
|
||||||
Krumo
|
|
||||||
version 0.2.1a
|
|
||||||
|
|
||||||
=============================================================================
|
|
||||||
|
|
||||||
You probably got this package from...
|
|
||||||
http://www.sourceforge.net/projects/krumo/
|
|
||||||
|
|
||||||
If there is no licence agreement with this package please download
|
|
||||||
a version from the location above. You must read and accept that
|
|
||||||
licence to use this software. The file is titled simply LICENSE.
|
|
||||||
|
|
||||||
OVERVIEW
|
|
||||||
------------------------------------------------------------------------------
|
|
||||||
To put it simply, Krumo is a replacement for print_r() and var_dump(). By
|
|
||||||
definition Krumo is a debugging tool (for PHP5), which displays structured
|
|
||||||
information about any PHP variable.
|
|
||||||
|
|
||||||
A lot of developers use print_r() and var_dump() in the means of debugging
|
|
||||||
tools. Although they were intended to present human readble information about a
|
|
||||||
variable, we can all agree that in general they are not. Krumo is an
|
|
||||||
alternative: it does the same job, but it presents the information beautified
|
|
||||||
using CSS and DHTML.
|
|
||||||
|
|
||||||
EXAMPLES
|
|
||||||
------------------------------------------------------------------------------
|
|
||||||
Here's a basic example, which will return a report on the array variable passed
|
|
||||||
as argument to it:
|
|
||||||
|
|
||||||
krumo(array('a1'=> 'A1', 3, 'red'));
|
|
||||||
|
|
||||||
You can dump simultaneously more then one variable - here's another example:
|
|
||||||
|
|
||||||
krumo($_SERVER, $_REQUEST);
|
|
||||||
|
|
||||||
You probably saw from the examples above that some of the nodes are expandable,
|
|
||||||
so if you want to inspect the nested information, click on them and they will
|
|
||||||
expand; if you do not need that information shown simply click again on it to
|
|
||||||
collapse it. Here's an example to test this:
|
|
||||||
|
|
||||||
$x1->x2->x3->x4->x5->x6->x7->x8->x9 = 'X10';
|
|
||||||
krumo($x1);
|
|
||||||
|
|
||||||
The krumo() is the only standalone function from the package, and this is
|
|
||||||
because basic dumps about variables (like print_r() or var_dump()) are the most
|
|
||||||
common tasks such functionality is used for. The rest of the functionality can
|
|
||||||
be called using static calls to the Krumo class. Here are several more examples:
|
|
||||||
|
|
||||||
// print a debug backgrace
|
|
||||||
krumo::backtrace();
|
|
||||||
|
|
||||||
// print all the included(or required) files
|
|
||||||
krumo::includes();
|
|
||||||
|
|
||||||
// print all the included functions
|
|
||||||
krumo::functions();
|
|
||||||
|
|
||||||
// print all the declared classes
|
|
||||||
krumo::classes();
|
|
||||||
|
|
||||||
// print all the defined constants
|
|
||||||
krumo::defines();
|
|
||||||
|
|
||||||
... and so on, etc.
|
|
||||||
|
|
||||||
A full PHPDocumenter API documentation exists both in this package and at the
|
|
||||||
project's website.
|
|
||||||
|
|
||||||
INSTALL
|
|
||||||
------------------------------------------------------------------------------
|
|
||||||
Read the INSTALL file.
|
|
||||||
|
|
||||||
DOCUMENTATION
|
|
||||||
------------------------------------------------------------------------------
|
|
||||||
As I said, a full PHPDocumenter API documentation can be found both in this
|
|
||||||
package and at the project's website.
|
|
||||||
|
|
||||||
SKINS
|
|
||||||
------------------------------------------------------------------------------
|
|
||||||
There are several skins pre-installed with this package, but if you wish you can
|
|
||||||
create skins of your own. The skins are simply CSS files that are prepended to
|
|
||||||
the result that Krumo prints. If you want to use images in your CSS (for
|
|
||||||
background, list-style, etc), you have to put "%URL%" in front of the image URL
|
|
||||||
in order hook it up to the skin folder and make the image web-accessible.
|
|
||||||
|
|
||||||
Here's an example:
|
|
||||||
|
|
||||||
ul.krumo-first {background: url(%url%bg.gif);}
|
|
||||||
|
|
||||||
TODO
|
|
||||||
------------------------------------------------------------------------------
|
|
||||||
You can find the list of stuff that is going to be added to this project in the
|
|
||||||
TODO file from this very package.
|
|
||||||
|
|
||||||
CONTRIBUTION
|
|
||||||
-----------------------------------------------------------------------------
|
|
||||||
If you download and use and possibly even extend this tool, please let us know.
|
|
||||||
Any feedback, even bad, is always welcome and your suggestions are going to be
|
|
||||||
considered for our next release. Please use our SourceForge page for that:
|
|
||||||
|
|
||||||
http://www.sourceforge.net/projects/krumo/
|
|
||||||
24
gulliver/thirdparty/krumo/TODO
vendored
@@ -1,24 +0,0 @@
|
|||||||
******************************************************************************
|
|
||||||
|
|
||||||
Krumo: TODO
|
|
||||||
|
|
||||||
******************************************************************************
|
|
||||||
|
|
||||||
BUGS
|
|
||||||
----------------
|
|
||||||
- watch the SourceForge.net Bug Tracker
|
|
||||||
|
|
||||||
Features: PHP
|
|
||||||
----------------
|
|
||||||
- Try to detect anonymous (lambda) functions
|
|
||||||
- Try to detect whether an array is indexed or associated
|
|
||||||
- Add var_export support for arrays and objects
|
|
||||||
- Add JSON support for arrays and objects
|
|
||||||
|
|
||||||
Features: GUI
|
|
||||||
----------------
|
|
||||||
- Nicer and friendlier skin(s)
|
|
||||||
- Add top-level links for collapsing and expanding the whole tree
|
|
||||||
- Add object & array -level links for collapsing and expanding all the
|
|
||||||
nested nodes
|
|
||||||
- Print all parent classes for the rendered objects
|
|
||||||
1
gulliver/thirdparty/krumo/VERSION
vendored
@@ -1 +0,0 @@
|
|||||||
0.2.1a
|
|
||||||
1302
gulliver/thirdparty/krumo/class.krumo.php
vendored
@@ -1,267 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<head>
|
|
||||||
<!-- template designed by Marco Von Ballmoos -->
|
|
||||||
<title>Docs for page class.krumo.php</title>
|
|
||||||
<link rel="stylesheet" href="../media/stylesheet.css" />
|
|
||||||
<script src="../media/lib/classTree.js"></script>
|
|
||||||
<script language="javascript" type="text/javascript">
|
|
||||||
var imgPlus = new Image();
|
|
||||||
var imgMinus = new Image();
|
|
||||||
imgPlus.src = "../media/images/plus.png";
|
|
||||||
imgMinus.src = "../media/images/minus.png";
|
|
||||||
|
|
||||||
function showNode(Node){
|
|
||||||
switch(navigator.family){
|
|
||||||
case 'nn4':
|
|
||||||
// Nav 4.x code fork...
|
|
||||||
var oTable = document.layers["span" + Node];
|
|
||||||
var oImg = document.layers["img" + Node];
|
|
||||||
break;
|
|
||||||
case 'ie4':
|
|
||||||
// IE 4/5 code fork...
|
|
||||||
var oTable = document.all["span" + Node];
|
|
||||||
var oImg = document.all["img" + Node];
|
|
||||||
break;
|
|
||||||
case 'gecko':
|
|
||||||
// Standards Compliant code fork...
|
|
||||||
var oTable = document.getElementById("span" + Node);
|
|
||||||
var oImg = document.getElementById("img" + Node);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
oImg.src = imgMinus.src;
|
|
||||||
oTable.style.display = "block";
|
|
||||||
}
|
|
||||||
|
|
||||||
function hideNode(Node){
|
|
||||||
switch(navigator.family){
|
|
||||||
case 'nn4':
|
|
||||||
// Nav 4.x code fork...
|
|
||||||
var oTable = document.layers["span" + Node];
|
|
||||||
var oImg = document.layers["img" + Node];
|
|
||||||
break;
|
|
||||||
case 'ie4':
|
|
||||||
// IE 4/5 code fork...
|
|
||||||
var oTable = document.all["span" + Node];
|
|
||||||
var oImg = document.all["img" + Node];
|
|
||||||
break;
|
|
||||||
case 'gecko':
|
|
||||||
// Standards Compliant code fork...
|
|
||||||
var oTable = document.getElementById("span" + Node);
|
|
||||||
var oImg = document.getElementById("img" + Node);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
oImg.src = imgPlus.src;
|
|
||||||
oTable.style.display = "none";
|
|
||||||
}
|
|
||||||
|
|
||||||
function nodeIsVisible(Node){
|
|
||||||
switch(navigator.family){
|
|
||||||
case 'nn4':
|
|
||||||
// Nav 4.x code fork...
|
|
||||||
var oTable = document.layers["span" + Node];
|
|
||||||
break;
|
|
||||||
case 'ie4':
|
|
||||||
// IE 4/5 code fork...
|
|
||||||
var oTable = document.all["span" + Node];
|
|
||||||
break;
|
|
||||||
case 'gecko':
|
|
||||||
// Standards Compliant code fork...
|
|
||||||
var oTable = document.getElementById("span" + Node);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return (oTable && oTable.style.display == "block");
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleNodeVisibility(Node){
|
|
||||||
if (nodeIsVisible(Node)){
|
|
||||||
hideNode(Node);
|
|
||||||
}else{
|
|
||||||
showNode(Node);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="page-body">
|
|
||||||
|
|
||||||
<h2 class="file-name"><img src="../media/images/Page_logo.png" alt="File" style="vertical-align: middle">/class.krumo.php</h2>
|
|
||||||
|
|
||||||
<a name="sec-description"></a>
|
|
||||||
<div class="info-box">
|
|
||||||
<div class="info-box-title">Description</div>
|
|
||||||
<div class="nav-bar">
|
|
||||||
<span class="disabled">Description</span> |
|
|
||||||
<a href="#sec-classes">Classes</a>
|
|
||||||
| <a href="#sec-constants">Constants</a>
|
|
||||||
| <a href="#sec-functions">Functions</a>
|
|
||||||
</div>
|
|
||||||
<div class="info-box-body">
|
|
||||||
<!-- ========== Info from phpDoc block ========= -->
|
|
||||||
<p class="short-description">Krumo: Structured information display solution</p>
|
|
||||||
<p class="description"><p>Krumo is a debugging tool (PHP5 only), which displays structured information about any PHP variable. It is a nice replacement for print_r() or var_dump() which are used by a lot of PHP developers.</p></p>
|
|
||||||
<ul class="tags">
|
|
||||||
<li><span class="field">author:</span> Kaloyan K. Tsvetkov <<a href="mailto:kaloyan@kaloyan.info">kaloyan@kaloyan.info</a>></li>
|
|
||||||
<li><span class="field">version:</span> $Id: _class.krumo.php.html 25 2007-12-02 07:44:35Z Mrasnika $</li>
|
|
||||||
<li><span class="field">license:</span> <a href="http://opensource.org/licenses/lgpl-license.php">GNU Lesser General Public License Version 2.1</a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<a name="sec-classes"></a>
|
|
||||||
<div class="info-box">
|
|
||||||
<div class="info-box-title">Classes</div>
|
|
||||||
<div class="nav-bar">
|
|
||||||
<a href="#sec-description">Description</a> |
|
|
||||||
<span class="disabled">Classes</span>
|
|
||||||
| <a href="#sec-constants">Constants</a>
|
|
||||||
| <a href="#sec-functions">Functions</a>
|
|
||||||
</div>
|
|
||||||
<div class="info-box-body">
|
|
||||||
<table cellpadding="2" cellspacing="0" class="class-table">
|
|
||||||
<tr>
|
|
||||||
<th class="class-table-header">Class</th>
|
|
||||||
<th class="class-table-header">Description</th>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td style="padding-right: 2em; vertical-align: top; white-space: nowrap">
|
|
||||||
<img src="../media/images/Class.png"
|
|
||||||
alt=" class"
|
|
||||||
title=" class"/>
|
|
||||||
<a href="../Krumo/krumo.html">krumo</a>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
Krumo API
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<a name="sec-constants"></a>
|
|
||||||
<div class="info-box">
|
|
||||||
<div class="info-box-title">Constants</div>
|
|
||||||
<div class="nav-bar">
|
|
||||||
<a href="#sec-description">Description</a> |
|
|
||||||
<a href="#sec-classes">Classes</a>
|
|
||||||
| <span class="disabled">Constants</span>
|
|
||||||
| <a href="#sec-functions">Functions</a>
|
|
||||||
</div>
|
|
||||||
<div class="info-box-body">
|
|
||||||
<a name="defineDIR_SEP"><!-- --></a>
|
|
||||||
<div class="oddrow">
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<img src="../media/images/Constant.png" />
|
|
||||||
<span class="const-title">
|
|
||||||
<span class="const-name">DIR_SEP</span> = DIRECTORY_SEPARATOR
|
|
||||||
(line <span class="line-number">22</span>)
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- ========== Info from phpDoc block ========= -->
|
|
||||||
<p class="short-description">backward compatibility: the DIR_SEP constant isn't used anymore</p>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<a name="defineKRUMO_DIR"><!-- --></a>
|
|
||||||
<div class="evenrow">
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<img src="../media/images/Constant.png" />
|
|
||||||
<span class="const-title">
|
|
||||||
<span class="const-name">KRUMO_DIR</span> = dirname(__FILE__).DIRECTORY_SEPARATOR
|
|
||||||
(line <span class="line-number">39</span>)
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- ========== Info from phpDoc block ========= -->
|
|
||||||
<p class="short-description">Set the KRUMO_DIR constant up with the absolute path to Krumo files. If it is not defined, include_path will be used. Set KRUMO_DIR only if any other module or application has not already set it up.</p>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<a name="defineKRUMO_TRUNCATE_LENGTH"><!-- --></a>
|
|
||||||
<div class="oddrow">
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<img src="../media/images/Constant.png" />
|
|
||||||
<span class="const-title">
|
|
||||||
<span class="const-name">KRUMO_TRUNCATE_LENGTH</span> = 50
|
|
||||||
(line <span class="line-number">48</span>)
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- ========== Info from phpDoc block ========= -->
|
|
||||||
<p class="short-description">This constant sets the maximum strings of strings that will be shown as they are. Longer strings will be truncated with this length, and their `full form` will be shown in a child node.</p>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<a name="definePATH_SEPARATOR"><!-- --></a>
|
|
||||||
<div class="evenrow">
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<img src="../media/images/Constant.png" />
|
|
||||||
<span class="const-title">
|
|
||||||
<span class="const-name">PATH_SEPARATOR</span> = OS_WINDOWS?';':':'
|
|
||||||
(line <span class="line-number">28</span>)
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- ========== Info from phpDoc block ========= -->
|
|
||||||
<p class="short-description">backward compatibility: the PATH_SEPARATOR constant is availble since 4.3.0RC2</p>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<a name="sec-functions"></a>
|
|
||||||
<div class="info-box">
|
|
||||||
<div class="info-box-title">Functions</div>
|
|
||||||
<div class="nav-bar">
|
|
||||||
<a href="#sec-description">Description</a> |
|
|
||||||
<a href="#sec-classes">Classes</a>
|
|
||||||
| <a href="#sec-constants">Constants</a>
|
|
||||||
| <span class="disabled">Functions</span>
|
|
||||||
</div>
|
|
||||||
<div class="info-box-body">
|
|
||||||
<a name="functionkrumo" id="functionkrumo"><!-- --></a>
|
|
||||||
<div class="oddrow">
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<img src="../media/images/Function.png" />
|
|
||||||
<span class="method-title">krumo</span> (line <span class="line-number">1295</span>)
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- ========== Info from phpDoc block ========= -->
|
|
||||||
<p class="short-description">Alias of <a href="../Krumo/krumo.html#methoddump">krumo::dump()</a></p>
|
|
||||||
<ul class="tags">
|
|
||||||
<li><span class="field">see:</span> <a href="../Krumo/krumo.html#methoddump">krumo::dump()</a></li>
|
|
||||||
</ul>
|
|
||||||
<div class="method-signature">
|
|
||||||
<span class="method-result">void</span>
|
|
||||||
<span class="method-name">
|
|
||||||
krumo
|
|
||||||
</span>
|
|
||||||
([<span class="var-type">mixed</span> <span class="var-name">$data,...</span> = <span class="var-default"></span>])
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<ul class="parameters">
|
|
||||||
<li>
|
|
||||||
<span class="var-type">mixed</span>
|
|
||||||
<span class="var-name">$data,...</span> </li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p class="notes" id="credit">
|
|
||||||
Documentation generated on Sun, 02 Dec 2007 09:43:24 +0200 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.0a2</a>
|
|
||||||
</p>
|
|
||||||
</div></body>
|
|
||||||
@@ -1,269 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<head>
|
|
||||||
<!-- template designed by Marco Von Ballmoos -->
|
|
||||||
<title>Docs for page class.krumo.php</title>
|
|
||||||
<link rel="stylesheet" href="../media/stylesheet.css" />
|
|
||||||
<script src="../media/lib/classTree.js"></script>
|
|
||||||
<script language="javascript" type="text/javascript">
|
|
||||||
var imgPlus = new Image();
|
|
||||||
var imgMinus = new Image();
|
|
||||||
imgPlus.src = "../media/images/plus.png";
|
|
||||||
imgMinus.src = "../media/images/minus.png";
|
|
||||||
|
|
||||||
function showNode(Node){
|
|
||||||
switch(navigator.family){
|
|
||||||
case 'nn4':
|
|
||||||
// Nav 4.x code fork...
|
|
||||||
var oTable = document.layers["span" + Node];
|
|
||||||
var oImg = document.layers["img" + Node];
|
|
||||||
break;
|
|
||||||
case 'ie4':
|
|
||||||
// IE 4/5 code fork...
|
|
||||||
var oTable = document.all["span" + Node];
|
|
||||||
var oImg = document.all["img" + Node];
|
|
||||||
break;
|
|
||||||
case 'gecko':
|
|
||||||
// Standards Compliant code fork...
|
|
||||||
var oTable = document.getElementById("span" + Node);
|
|
||||||
var oImg = document.getElementById("img" + Node);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
oImg.src = imgMinus.src;
|
|
||||||
oTable.style.display = "block";
|
|
||||||
}
|
|
||||||
|
|
||||||
function hideNode(Node){
|
|
||||||
switch(navigator.family){
|
|
||||||
case 'nn4':
|
|
||||||
// Nav 4.x code fork...
|
|
||||||
var oTable = document.layers["span" + Node];
|
|
||||||
var oImg = document.layers["img" + Node];
|
|
||||||
break;
|
|
||||||
case 'ie4':
|
|
||||||
// IE 4/5 code fork...
|
|
||||||
var oTable = document.all["span" + Node];
|
|
||||||
var oImg = document.all["img" + Node];
|
|
||||||
break;
|
|
||||||
case 'gecko':
|
|
||||||
// Standards Compliant code fork...
|
|
||||||
var oTable = document.getElementById("span" + Node);
|
|
||||||
var oImg = document.getElementById("img" + Node);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
oImg.src = imgPlus.src;
|
|
||||||
oTable.style.display = "none";
|
|
||||||
}
|
|
||||||
|
|
||||||
function nodeIsVisible(Node){
|
|
||||||
switch(navigator.family){
|
|
||||||
case 'nn4':
|
|
||||||
// Nav 4.x code fork...
|
|
||||||
var oTable = document.layers["span" + Node];
|
|
||||||
break;
|
|
||||||
case 'ie4':
|
|
||||||
// IE 4/5 code fork...
|
|
||||||
var oTable = document.all["span" + Node];
|
|
||||||
break;
|
|
||||||
case 'gecko':
|
|
||||||
// Standards Compliant code fork...
|
|
||||||
var oTable = document.getElementById("span" + Node);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return (oTable && oTable.style.display == "block");
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleNodeVisibility(Node){
|
|
||||||
if (nodeIsVisible(Node)){
|
|
||||||
hideNode(Node);
|
|
||||||
}else{
|
|
||||||
showNode(Node);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="page-body">
|
|
||||||
|
|
||||||
<h2 class="file-name"><img src="../media/images/Page_logo.png" alt="File" style="vertical-align: middle">/class.krumo.php</h2>
|
|
||||||
|
|
||||||
<a name="sec-description"></a>
|
|
||||||
<div class="info-box">
|
|
||||||
<div class="info-box-title">Description</div>
|
|
||||||
<div class="nav-bar">
|
|
||||||
<span class="disabled">Description</span> |
|
|
||||||
<a href="#sec-classes">Classes</a>
|
|
||||||
| <a href="#sec-constants">Constants</a>
|
|
||||||
| <a href="#sec-functions">Functions</a>
|
|
||||||
</div>
|
|
||||||
<div class="info-box-body">
|
|
||||||
<!-- ========== Info from phpDoc block ========= -->
|
|
||||||
<p class="short-description">Krumo: Structured information display solution</p>
|
|
||||||
<p class="description"><p>Krumo is a debugging tool (PHP4/PHP5), which displays structured information about any PHP variable. It is a nice replacement for print_r() or var_dump() which are used by a lot of PHP developers.</p></p>
|
|
||||||
<ul class="tags">
|
|
||||||
<li><span class="field">version:</span> $Id: _class_krumo_php.html 8 2007-06-16 06:51:42Z mrasnika $</li>
|
|
||||||
<li><span class="field">license:</span> <a href="http://opensource.org/licenses/lgpl-license.php">GNU Lesser General Public License Version 2.1</a></li>
|
|
||||||
<li><span class="field">author:</span> Kaloyan K. Tsvetkov <<a href="mailto:kaloyan@kaloyan.info">kaloyan@kaloyan.info</a>></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<a name="sec-classes"></a>
|
|
||||||
<div class="info-box">
|
|
||||||
<div class="info-box-title">Classes</div>
|
|
||||||
<div class="nav-bar">
|
|
||||||
<a href="#sec-description">Description</a> |
|
|
||||||
<span class="disabled">Classes</span>
|
|
||||||
| <a href="#sec-constants">Constants</a>
|
|
||||||
| <a href="#sec-functions">Functions</a>
|
|
||||||
</div>
|
|
||||||
<div class="info-box-body">
|
|
||||||
<table cellpadding="2" cellspacing="0" class="class-table">
|
|
||||||
<tr>
|
|
||||||
<th class="class-table-header">Class</th>
|
|
||||||
<th class="class-table-header">Description</th>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td style="padding-right: 2em; vertical-align: top; white-space: nowrap">
|
|
||||||
<img src="../media/images/Class.png"
|
|
||||||
alt=" class"
|
|
||||||
title=" class"/>
|
|
||||||
<a href="../Krumo/krumo.html">krumo</a>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
Krumo API
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<a name="sec-constants"></a>
|
|
||||||
<div class="info-box">
|
|
||||||
<div class="info-box-title">Constants</div>
|
|
||||||
<div class="nav-bar">
|
|
||||||
<a href="#sec-description">Description</a> |
|
|
||||||
<a href="#sec-classes">Classes</a>
|
|
||||||
| <span class="disabled">Constants</span>
|
|
||||||
| <a href="#sec-functions">Functions</a>
|
|
||||||
</div>
|
|
||||||
<div class="info-box-body">
|
|
||||||
<a name="defineDIR_SEP"><!-- --></a>
|
|
||||||
<div class="oddrow">
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<img src="../media/images/Constant.png" />
|
|
||||||
<span class="const-title">
|
|
||||||
<span class="const-name">DIR_SEP</span> = DIRECTORY_SEPARATOR
|
|
||||||
(line <span class="line-number">22</span>)
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- ========== Info from phpDoc block ========= -->
|
|
||||||
<p class="short-description">backward compatibility: the DIR_SEP constant isn't used anymore</p>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<a name="defineKRUMO_DIR"><!-- --></a>
|
|
||||||
<div class="evenrow">
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<img src="../media/images/Constant.png" />
|
|
||||||
<span class="const-title">
|
|
||||||
<span class="const-name">KRUMO_DIR</span> = dirname(__FILE__).DIRECTORY_SEPARATOR
|
|
||||||
(line <span class="line-number">39</span>)
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- ========== Info from phpDoc block ========= -->
|
|
||||||
<p class="short-description">Set the KRUMO_DIR constant up with the absolute path to Krumo files. If it is not defined, include_path will be used. Set KRUMO_DIR only if any other module or application has not already set it up.</p>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<a name="defineKRUMO_TRUNCATE_LENGTH"><!-- --></a>
|
|
||||||
<div class="oddrow">
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<img src="../media/images/Constant.png" />
|
|
||||||
<span class="const-title">
|
|
||||||
<span class="const-name">KRUMO_TRUNCATE_LENGTH</span> = 50
|
|
||||||
(line <span class="line-number">48</span>)
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- ========== Info from phpDoc block ========= -->
|
|
||||||
<p class="short-description">This constant sets the maximum strings of strings that will be shown as they are. Longer strings will be truncated with this length, and their `full form` will be shown in a child node.</p>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<a name="definePATH_SEPARATOR"><!-- --></a>
|
|
||||||
<div class="evenrow">
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<img src="../media/images/Constant.png" />
|
|
||||||
<span class="const-title">
|
|
||||||
<span class="const-name">PATH_SEPARATOR</span> = OS_WINDOWS?';':':'
|
|
||||||
(line <span class="line-number">28</span>)
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- ========== Info from phpDoc block ========= -->
|
|
||||||
<p class="short-description">backward compatibility: the PATH_SEPARATOR constant is availble since 4.3.0RC2</p>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<a name="sec-functions"></a>
|
|
||||||
<div class="info-box">
|
|
||||||
<div class="info-box-title">Functions</div>
|
|
||||||
<div class="nav-bar">
|
|
||||||
<a href="#sec-description">Description</a> |
|
|
||||||
<a href="#sec-classes">Classes</a>
|
|
||||||
| <a href="#sec-constants">Constants</a>
|
|
||||||
| <span class="disabled">Functions</span>
|
|
||||||
</div>
|
|
||||||
<div class="info-box-body">
|
|
||||||
<a name="functionkrumo" id="functionkrumo"><!-- --></a>
|
|
||||||
<div class="oddrow">
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<img src="../media/images/Function.png" />
|
|
||||||
<span class="method-title">krumo</span> (line <span class="line-number">1296</span>)
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- ========== Info from phpDoc block ========= -->
|
|
||||||
<p class="short-description">Alias of <a href="../Krumo/krumo.html#methoddump">krumo::dump()</a></p>
|
|
||||||
<ul class="tags">
|
|
||||||
<li><span class="field">see:</span> <a href="../Krumo/krumo.html#methoddump">krumo::dump()</a></li>
|
|
||||||
</ul>
|
|
||||||
<div class="method-signature">
|
|
||||||
<span class="method-result">void</span>
|
|
||||||
<span class="method-name">
|
|
||||||
krumo
|
|
||||||
</span>
|
|
||||||
([<span class="var-type">mixed</span> <span class="var-name">$data,...
|
|
||||||
</span> = <span class="var-default"></span>])
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<ul class="parameters">
|
|
||||||
<li>
|
|
||||||
<span class="var-type">mixed</span>
|
|
||||||
<span class="var-name">$data,...
|
|
||||||
</span> </li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p class="notes" id="credit">
|
|
||||||
Documentation generated on Sat, 16 Jun 2007 09:50:08 +0300 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.3.0RC4</a>
|
|
||||||
</p>
|
|
||||||
</div></body>
|
|
||||||
900
gulliver/thirdparty/krumo/docs/Krumo/krumo.html
vendored
@@ -1,900 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<head>
|
|
||||||
<!-- template designed by Marco Von Ballmoos -->
|
|
||||||
<title>Docs For Class krumo</title>
|
|
||||||
<link rel="stylesheet" href="../media/stylesheet.css" />
|
|
||||||
<script src="../media/lib/classTree.js"></script>
|
|
||||||
<script language="javascript" type="text/javascript">
|
|
||||||
var imgPlus = new Image();
|
|
||||||
var imgMinus = new Image();
|
|
||||||
imgPlus.src = "../media/images/plus.png";
|
|
||||||
imgMinus.src = "../media/images/minus.png";
|
|
||||||
|
|
||||||
function showNode(Node){
|
|
||||||
switch(navigator.family){
|
|
||||||
case 'nn4':
|
|
||||||
// Nav 4.x code fork...
|
|
||||||
var oTable = document.layers["span" + Node];
|
|
||||||
var oImg = document.layers["img" + Node];
|
|
||||||
break;
|
|
||||||
case 'ie4':
|
|
||||||
// IE 4/5 code fork...
|
|
||||||
var oTable = document.all["span" + Node];
|
|
||||||
var oImg = document.all["img" + Node];
|
|
||||||
break;
|
|
||||||
case 'gecko':
|
|
||||||
// Standards Compliant code fork...
|
|
||||||
var oTable = document.getElementById("span" + Node);
|
|
||||||
var oImg = document.getElementById("img" + Node);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
oImg.src = imgMinus.src;
|
|
||||||
oTable.style.display = "block";
|
|
||||||
}
|
|
||||||
|
|
||||||
function hideNode(Node){
|
|
||||||
switch(navigator.family){
|
|
||||||
case 'nn4':
|
|
||||||
// Nav 4.x code fork...
|
|
||||||
var oTable = document.layers["span" + Node];
|
|
||||||
var oImg = document.layers["img" + Node];
|
|
||||||
break;
|
|
||||||
case 'ie4':
|
|
||||||
// IE 4/5 code fork...
|
|
||||||
var oTable = document.all["span" + Node];
|
|
||||||
var oImg = document.all["img" + Node];
|
|
||||||
break;
|
|
||||||
case 'gecko':
|
|
||||||
// Standards Compliant code fork...
|
|
||||||
var oTable = document.getElementById("span" + Node);
|
|
||||||
var oImg = document.getElementById("img" + Node);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
oImg.src = imgPlus.src;
|
|
||||||
oTable.style.display = "none";
|
|
||||||
}
|
|
||||||
|
|
||||||
function nodeIsVisible(Node){
|
|
||||||
switch(navigator.family){
|
|
||||||
case 'nn4':
|
|
||||||
// Nav 4.x code fork...
|
|
||||||
var oTable = document.layers["span" + Node];
|
|
||||||
break;
|
|
||||||
case 'ie4':
|
|
||||||
// IE 4/5 code fork...
|
|
||||||
var oTable = document.all["span" + Node];
|
|
||||||
break;
|
|
||||||
case 'gecko':
|
|
||||||
// Standards Compliant code fork...
|
|
||||||
var oTable = document.getElementById("span" + Node);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return (oTable && oTable.style.display == "block");
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleNodeVisibility(Node){
|
|
||||||
if (nodeIsVisible(Node)){
|
|
||||||
hideNode(Node);
|
|
||||||
}else{
|
|
||||||
showNode(Node);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="page-body">
|
|
||||||
|
|
||||||
<h2 class="class-name"><img src="../media/images/Class_logo.png"
|
|
||||||
alt=" Class"
|
|
||||||
title=" Class"
|
|
||||||
style="vertical-align: middle"> krumo</h2>
|
|
||||||
|
|
||||||
<a name="sec-description"></a>
|
|
||||||
<div class="info-box">
|
|
||||||
<div class="info-box-title">Description</div>
|
|
||||||
<div class="nav-bar">
|
|
||||||
<span class="disabled">Description</span> |
|
|
||||||
<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="info-box-body">
|
|
||||||
<!-- ========== Info from phpDoc block ========= -->
|
|
||||||
<p class="short-description">Krumo API</p>
|
|
||||||
<p class="description"><p>This class stores the Krumo API for rendering and displaying the structured information it is reporting</p></p>
|
|
||||||
<p class="notes">
|
|
||||||
Located in <a class="field" href="_class.krumo.php.html">/class.krumo.php</a> (line <span class="field">61</span>)
|
|
||||||
</p>
|
|
||||||
|
|
||||||
|
|
||||||
<pre></pre>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="sec-method-summary"></a>
|
|
||||||
<div class="info-box">
|
|
||||||
<div class="info-box-title">Method Summary</span></div>
|
|
||||||
<div class="nav-bar">
|
|
||||||
<a href="#sec-description">Description</a> |
|
|
||||||
<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
|
|
||||||
</div>
|
|
||||||
<div class="info-box-body">
|
|
||||||
<div class="method-summary">
|
|
||||||
|
|
||||||
<div class="method-definition">
|
|
||||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<a href="#backtrace" title="details" class="method-name">backtrace</a>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="method-definition">
|
|
||||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<a href="#classes" title="details" class="method-name">classes</a>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="method-definition">
|
|
||||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<a href="#conf" title="details" class="method-name">conf</a>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="method-definition">
|
|
||||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<a href="#cookie" title="details" class="method-name">cookie</a>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="method-definition">
|
|
||||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<a href="#defines" title="details" class="method-name">defines</a>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="method-definition">
|
|
||||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
|
||||||
static <span class="method-result">boolean</span>
|
|
||||||
<a href="#disable" title="details" class="method-name">disable</a>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="method-definition">
|
|
||||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<a href="#dump" title="details" class="method-name">dump</a>
|
|
||||||
(<span class="var-type"></span> <span class="var-name">$data</span>, <span class="var-type">mixed</span> <span class="var-name">$data,...</span>)
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="method-definition">
|
|
||||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
|
||||||
static <span class="method-result">boolean</span>
|
|
||||||
<a href="#enable" title="details" class="method-name">enable</a>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="method-definition">
|
|
||||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<a href="#env" title="details" class="method-name">env</a>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="method-definition">
|
|
||||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<a href="#extensions" title="details" class="method-name">extensions</a>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="method-definition">
|
|
||||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<a href="#functions" title="details" class="method-name">functions</a>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="method-definition">
|
|
||||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<a href="#get" title="details" class="method-name">get</a>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="method-definition">
|
|
||||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<a href="#headers" title="details" class="method-name">headers</a>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="method-definition">
|
|
||||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<a href="#includes" title="details" class="method-name">includes</a>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="method-definition">
|
|
||||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<a href="#ini" title="details" class="method-name">ini</a>
|
|
||||||
(<span class="var-type">string</span> <span class="var-name">$ini_file</span>)
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="method-definition">
|
|
||||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<a href="#interfaces" title="details" class="method-name">interfaces</a>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="method-definition">
|
|
||||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<a href="#path" title="details" class="method-name">path</a>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="method-definition">
|
|
||||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<a href="#phpini" title="details" class="method-name">phpini</a>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="method-definition">
|
|
||||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<a href="#post" title="details" class="method-name">post</a>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="method-definition">
|
|
||||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<a href="#request" title="details" class="method-name">request</a>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="method-definition">
|
|
||||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<a href="#server" title="details" class="method-name">server</a>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="method-definition">
|
|
||||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<a href="#session" title="details" class="method-name">session</a>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="method-definition">
|
|
||||||
<img src="../media/images/StaticMethod.png" alt=" "/>
|
|
||||||
static <span class="method-result">string</span>
|
|
||||||
<a href="#version" title="details" class="method-name">version</a>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<a name="sec-methods"></a>
|
|
||||||
<div class="info-box">
|
|
||||||
<div class="info-box-title">Methods</div>
|
|
||||||
<div class="nav-bar">
|
|
||||||
<a href="#sec-description">Description</a> |
|
|
||||||
<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="info-box-body">
|
|
||||||
<A NAME='method_detail'></A>
|
|
||||||
<a name="methodbacktrace" id="backtrace"><!-- --></a>
|
|
||||||
<div class="evenrow">
|
|
||||||
|
|
||||||
<div class="method-header">
|
|
||||||
<img src="../media/images/StaticMethod.png" />
|
|
||||||
<span class="method-title">static backtrace</span> (line <span class="line-number">82</span>)
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- ========== Info from phpDoc block ========= -->
|
|
||||||
<p class="short-description">Prints a debug backtrace</p>
|
|
||||||
<ul class="tags">
|
|
||||||
<li><span class="field">access:</span> public</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<div class="method-signature">
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<span class="method-name">
|
|
||||||
backtrace
|
|
||||||
</span>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<a name="methodclasses" id="classes"><!-- --></a>
|
|
||||||
<div class="oddrow">
|
|
||||||
|
|
||||||
<div class="method-header">
|
|
||||||
<img src="../media/images/StaticMethod.png" />
|
|
||||||
<span class="method-title">static classes</span> (line <span class="line-number">101</span>)
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- ========== Info from phpDoc block ========= -->
|
|
||||||
<p class="short-description">Prints a list of all currently declared classes.</p>
|
|
||||||
<ul class="tags">
|
|
||||||
<li><span class="field">access:</span> public</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<div class="method-signature">
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<span class="method-name">
|
|
||||||
classes
|
|
||||||
</span>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<a name="methodconf" id="conf"><!-- --></a>
|
|
||||||
<div class="evenrow">
|
|
||||||
|
|
||||||
<div class="method-header">
|
|
||||||
<img src="../media/images/StaticMethod.png" />
|
|
||||||
<span class="method-title">static conf</span> (line <span class="line-number">297</span>)
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- ========== Info from phpDoc block ========= -->
|
|
||||||
<p class="short-description">Prints a list of all your configuration settings.</p>
|
|
||||||
<ul class="tags">
|
|
||||||
<li><span class="field">access:</span> public</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<div class="method-signature">
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<span class="method-name">
|
|
||||||
conf
|
|
||||||
</span>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<a name="methodcookie" id="cookie"><!-- --></a>
|
|
||||||
<div class="oddrow">
|
|
||||||
|
|
||||||
<div class="method-header">
|
|
||||||
<img src="../media/images/StaticMethod.png" />
|
|
||||||
<span class="method-title">static cookie</span> (line <span class="line-number">441</span>)
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- ========== Info from phpDoc block ========= -->
|
|
||||||
<p class="short-description">Prints a list of all the values from the <em>$_COOKIE</em> array.</p>
|
|
||||||
<ul class="tags">
|
|
||||||
<li><span class="field">access:</span> public</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<div class="method-signature">
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<span class="method-name">
|
|
||||||
cookie
|
|
||||||
</span>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<a name="methoddefines" id="defines"><!-- --></a>
|
|
||||||
<div class="evenrow">
|
|
||||||
|
|
||||||
<div class="method-header">
|
|
||||||
<img src="../media/images/StaticMethod.png" />
|
|
||||||
<span class="method-title">static defines</span> (line <span class="line-number">197</span>)
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- ========== Info from phpDoc block ========= -->
|
|
||||||
<p class="short-description">Prints a list of all currently declared constants.</p>
|
|
||||||
<ul class="tags">
|
|
||||||
<li><span class="field">access:</span> public</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<div class="method-signature">
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<span class="method-name">
|
|
||||||
defines
|
|
||||||
</span>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<a name="methoddisable" id="disable"><!-- --></a>
|
|
||||||
<div class="oddrow">
|
|
||||||
|
|
||||||
<div class="method-header">
|
|
||||||
<img src="../media/images/StaticMethod.png" />
|
|
||||||
<span class="method-title">static disable</span> (line <span class="line-number">747</span>)
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- ========== Info from phpDoc block ========= -->
|
|
||||||
<p class="short-description">Disable Krumo</p>
|
|
||||||
<ul class="tags">
|
|
||||||
<li><span class="field">access:</span> public</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<div class="method-signature">
|
|
||||||
static <span class="method-result">boolean</span>
|
|
||||||
<span class="method-name">
|
|
||||||
disable
|
|
||||||
</span>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<a name="methoddump" id="dump"><!-- --></a>
|
|
||||||
<div class="evenrow">
|
|
||||||
|
|
||||||
<div class="method-header">
|
|
||||||
<img src="../media/images/StaticMethod.png" />
|
|
||||||
<span class="method-title">static dump</span> (line <span class="line-number">548</span>)
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- ========== Info from phpDoc block ========= -->
|
|
||||||
<p class="short-description">Dump information about a variable</p>
|
|
||||||
<ul class="tags">
|
|
||||||
<li><span class="field">access:</span> public</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<div class="method-signature">
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<span class="method-name">
|
|
||||||
dump
|
|
||||||
</span>
|
|
||||||
(<span class="var-type"></span> <span class="var-name">$data</span>, <span class="var-type">mixed</span> <span class="var-name">$data,...</span>)
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<ul class="parameters">
|
|
||||||
<li>
|
|
||||||
<span class="var-type">mixed</span>
|
|
||||||
<span class="var-name">$data,...</span> </li>
|
|
||||||
<li>
|
|
||||||
<span class="var-type"></span>
|
|
||||||
<span class="var-name">$data</span> </li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<a name="methodenable" id="enable"><!-- --></a>
|
|
||||||
<div class="oddrow">
|
|
||||||
|
|
||||||
<div class="method-header">
|
|
||||||
<img src="../media/images/StaticMethod.png" />
|
|
||||||
<span class="method-title">static enable</span> (line <span class="line-number">736</span>)
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- ========== Info from phpDoc block ========= -->
|
|
||||||
<p class="short-description">Enable Krumo</p>
|
|
||||||
<ul class="tags">
|
|
||||||
<li><span class="field">access:</span> public</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<div class="method-signature">
|
|
||||||
static <span class="method-result">boolean</span>
|
|
||||||
<span class="method-name">
|
|
||||||
enable
|
|
||||||
</span>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<a name="methodenv" id="env"><!-- --></a>
|
|
||||||
<div class="evenrow">
|
|
||||||
|
|
||||||
<div class="method-header">
|
|
||||||
<img src="../media/images/StaticMethod.png" />
|
|
||||||
<span class="method-title">static env</span> (line <span class="line-number">465</span>)
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- ========== Info from phpDoc block ========= -->
|
|
||||||
<p class="short-description">Prints a list of all the values from the <em>$_ENV</em> array.</p>
|
|
||||||
<ul class="tags">
|
|
||||||
<li><span class="field">access:</span> public</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<div class="method-signature">
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<span class="method-name">
|
|
||||||
env
|
|
||||||
</span>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<a name="methodextensions" id="extensions"><!-- --></a>
|
|
||||||
<div class="oddrow">
|
|
||||||
|
|
||||||
<div class="method-header">
|
|
||||||
<img src="../media/images/StaticMethod.png" />
|
|
||||||
<span class="method-title">static extensions</span> (line <span class="line-number">221</span>)
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- ========== Info from phpDoc block ========= -->
|
|
||||||
<p class="short-description">Prints a list of all currently loaded PHP extensions.</p>
|
|
||||||
<ul class="tags">
|
|
||||||
<li><span class="field">access:</span> public</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<div class="method-signature">
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<span class="method-name">
|
|
||||||
extensions
|
|
||||||
</span>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<a name="methodfunctions" id="functions"><!-- --></a>
|
|
||||||
<div class="evenrow">
|
|
||||||
|
|
||||||
<div class="method-header">
|
|
||||||
<img src="../media/images/StaticMethod.png" />
|
|
||||||
<span class="method-title">static functions</span> (line <span class="line-number">173</span>)
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- ========== Info from phpDoc block ========= -->
|
|
||||||
<p class="short-description">Prints a list of all currently declared functions.</p>
|
|
||||||
<ul class="tags">
|
|
||||||
<li><span class="field">access:</span> public</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<div class="method-signature">
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<span class="method-name">
|
|
||||||
functions
|
|
||||||
</span>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<a name="methodget" id="get"><!-- --></a>
|
|
||||||
<div class="oddrow">
|
|
||||||
|
|
||||||
<div class="method-header">
|
|
||||||
<img src="../media/images/StaticMethod.png" />
|
|
||||||
<span class="method-title">static get</span> (line <span class="line-number">369</span>)
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- ========== Info from phpDoc block ========= -->
|
|
||||||
<p class="short-description">Prints a list of all the values from the <em>$_GET</em> array.</p>
|
|
||||||
<ul class="tags">
|
|
||||||
<li><span class="field">access:</span> public</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<div class="method-signature">
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<span class="method-name">
|
|
||||||
get
|
|
||||||
</span>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<a name="methodheaders" id="headers"><!-- --></a>
|
|
||||||
<div class="evenrow">
|
|
||||||
|
|
||||||
<div class="method-header">
|
|
||||||
<img src="../media/images/StaticMethod.png" />
|
|
||||||
<span class="method-title">static headers</span> (line <span class="line-number">245</span>)
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- ========== Info from phpDoc block ========= -->
|
|
||||||
<p class="short-description">Prints a list of all HTTP request headers.</p>
|
|
||||||
<ul class="tags">
|
|
||||||
<li><span class="field">access:</span> public</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<div class="method-signature">
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<span class="method-name">
|
|
||||||
headers
|
|
||||||
</span>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<a name="methodincludes" id="includes"><!-- --></a>
|
|
||||||
<div class="oddrow">
|
|
||||||
|
|
||||||
<div class="method-header">
|
|
||||||
<img src="../media/images/StaticMethod.png" />
|
|
||||||
<span class="method-title">static includes</span> (line <span class="line-number">149</span>)
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- ========== Info from phpDoc block ========= -->
|
|
||||||
<p class="short-description">Prints a list of all currently included (or required) files.</p>
|
|
||||||
<ul class="tags">
|
|
||||||
<li><span class="field">access:</span> public</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<div class="method-signature">
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<span class="method-name">
|
|
||||||
includes
|
|
||||||
</span>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<a name="methodini" id="ini"><!-- --></a>
|
|
||||||
<div class="evenrow">
|
|
||||||
|
|
||||||
<div class="method-header">
|
|
||||||
<img src="../media/images/StaticMethod.png" />
|
|
||||||
<span class="method-title">static ini</span> (line <span class="line-number">515</span>)
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- ========== Info from phpDoc block ========= -->
|
|
||||||
<p class="short-description">Prints a list of all the values from an INI file.</p>
|
|
||||||
<ul class="tags">
|
|
||||||
<li><span class="field">access:</span> public</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<div class="method-signature">
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<span class="method-name">
|
|
||||||
ini
|
|
||||||
</span>
|
|
||||||
(<span class="var-type">string</span> <span class="var-name">$ini_file</span>)
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<ul class="parameters">
|
|
||||||
<li>
|
|
||||||
<span class="var-type">string</span>
|
|
||||||
<span class="var-name">$ini_file</span> </li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<a name="methodinterfaces" id="interfaces"><!-- --></a>
|
|
||||||
<div class="oddrow">
|
|
||||||
|
|
||||||
<div class="method-header">
|
|
||||||
<img src="../media/images/StaticMethod.png" />
|
|
||||||
<span class="method-title">static interfaces</span> (line <span class="line-number">125</span>)
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- ========== Info from phpDoc block ========= -->
|
|
||||||
<p class="short-description">Prints a list of all currently declared interfaces (PHP5 only).</p>
|
|
||||||
<ul class="tags">
|
|
||||||
<li><span class="field">access:</span> public</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<div class="method-signature">
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<span class="method-name">
|
|
||||||
interfaces
|
|
||||||
</span>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<a name="methodpath" id="path"><!-- --></a>
|
|
||||||
<div class="evenrow">
|
|
||||||
|
|
||||||
<div class="method-header">
|
|
||||||
<img src="../media/images/StaticMethod.png" />
|
|
||||||
<span class="method-title">static path</span> (line <span class="line-number">321</span>)
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- ========== Info from phpDoc block ========= -->
|
|
||||||
<p class="short-description">Prints a list of the specified directories under your <em>include_path</em> option.</p>
|
|
||||||
<ul class="tags">
|
|
||||||
<li><span class="field">access:</span> public</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<div class="method-signature">
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<span class="method-name">
|
|
||||||
path
|
|
||||||
</span>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<a name="methodphpini" id="phpini"><!-- --></a>
|
|
||||||
<div class="oddrow">
|
|
||||||
|
|
||||||
<div class="method-header">
|
|
||||||
<img src="../media/images/StaticMethod.png" />
|
|
||||||
<span class="method-title">static phpini</span> (line <span class="line-number">269</span>)
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- ========== Info from phpDoc block ========= -->
|
|
||||||
<p class="short-description">Prints a list of the configuration settings read from <em>php.ini</em></p>
|
|
||||||
<ul class="tags">
|
|
||||||
<li><span class="field">access:</span> public</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<div class="method-signature">
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<span class="method-name">
|
|
||||||
phpini
|
|
||||||
</span>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<a name="methodpost" id="post"><!-- --></a>
|
|
||||||
<div class="evenrow">
|
|
||||||
|
|
||||||
<div class="method-header">
|
|
||||||
<img src="../media/images/StaticMethod.png" />
|
|
||||||
<span class="method-title">static post</span> (line <span class="line-number">393</span>)
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- ========== Info from phpDoc block ========= -->
|
|
||||||
<p class="short-description">Prints a list of all the values from the <em>$_POST</em> array.</p>
|
|
||||||
<ul class="tags">
|
|
||||||
<li><span class="field">access:</span> public</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<div class="method-signature">
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<span class="method-name">
|
|
||||||
post
|
|
||||||
</span>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<a name="methodrequest" id="request"><!-- --></a>
|
|
||||||
<div class="oddrow">
|
|
||||||
|
|
||||||
<div class="method-header">
|
|
||||||
<img src="../media/images/StaticMethod.png" />
|
|
||||||
<span class="method-title">static request</span> (line <span class="line-number">345</span>)
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- ========== Info from phpDoc block ========= -->
|
|
||||||
<p class="short-description">Prints a list of all the values from the <em>$_REQUEST</em> array.</p>
|
|
||||||
<ul class="tags">
|
|
||||||
<li><span class="field">access:</span> public</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<div class="method-signature">
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<span class="method-name">
|
|
||||||
request
|
|
||||||
</span>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<a name="methodserver" id="server"><!-- --></a>
|
|
||||||
<div class="evenrow">
|
|
||||||
|
|
||||||
<div class="method-header">
|
|
||||||
<img src="../media/images/StaticMethod.png" />
|
|
||||||
<span class="method-title">static server</span> (line <span class="line-number">417</span>)
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- ========== Info from phpDoc block ========= -->
|
|
||||||
<p class="short-description">Prints a list of all the values from the <em>$_SERVER</em> array.</p>
|
|
||||||
<ul class="tags">
|
|
||||||
<li><span class="field">access:</span> public</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<div class="method-signature">
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<span class="method-name">
|
|
||||||
server
|
|
||||||
</span>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<a name="methodsession" id="session"><!-- --></a>
|
|
||||||
<div class="oddrow">
|
|
||||||
|
|
||||||
<div class="method-header">
|
|
||||||
<img src="../media/images/StaticMethod.png" />
|
|
||||||
<span class="method-title">static session</span> (line <span class="line-number">489</span>)
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- ========== Info from phpDoc block ========= -->
|
|
||||||
<p class="short-description">Prints a list of all the values from the <em>$_SESSION</em> array.</p>
|
|
||||||
<ul class="tags">
|
|
||||||
<li><span class="field">access:</span> public</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<div class="method-signature">
|
|
||||||
static <span class="method-result">void</span>
|
|
||||||
<span class="method-name">
|
|
||||||
session
|
|
||||||
</span>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<a name="methodversion" id="version"><!-- --></a>
|
|
||||||
<div class="evenrow">
|
|
||||||
|
|
||||||
<div class="method-header">
|
|
||||||
<img src="../media/images/StaticMethod.png" />
|
|
||||||
<span class="method-title">static version</span> (line <span class="line-number">70</span>)
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- ========== Info from phpDoc block ========= -->
|
|
||||||
<p class="short-description">Return Krumo version</p>
|
|
||||||
<ul class="tags">
|
|
||||||
<li><span class="field">access:</span> public</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<div class="method-signature">
|
|
||||||
static <span class="method-result">string</span>
|
|
||||||
<span class="method-name">
|
|
||||||
version
|
|
||||||
</span>
|
|
||||||
()
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<p class="notes" id="credit">
|
|
||||||
Documentation generated on Sun, 02 Dec 2007 09:43:24 +0200 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.0a2</a>
|
|
||||||
</p>
|
|
||||||
</div></body>
|
|
||||||
13
gulliver/thirdparty/krumo/docs/blank.html
vendored
@@ -1,13 +0,0 @@
|
|||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Krumo</title>
|
|
||||||
<link rel="stylesheet" href="media/stylesheet.css" />
|
|
||||||
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div align="center"><h1>Krumo</h1></div>
|
|
||||||
<b>Welcome to Krumo!</b><br />
|
|
||||||
<br />
|
|
||||||
This documentation was generated by <a href="http://www.phpdoc.org">phpDocumentor v1.4.0a2</a><br />
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<head>
|
|
||||||
<!-- template designed by Marco Von Ballmoos -->
|
|
||||||
<title></title>
|
|
||||||
<link rel="stylesheet" href="media/stylesheet.css" />
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Start of Class Data -->
|
|
||||||
<H2>
|
|
||||||
|
|
||||||
</H2>
|
|
||||||
<h2>Root class krumo</h2>
|
|
||||||
<ul>
|
|
||||||
<li><a href="Krumo/krumo.html">krumo</a></li></ul>
|
|
||||||
|
|
||||||
<p class="notes" id="credit">
|
|
||||||
Documentation generated on Sun, 02 Dec 2007 09:43:24 +0200 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.0a2</a>
|
|
||||||
</p>
|
|
||||||
</body>
|
|
||||||
392
gulliver/thirdparty/krumo/docs/elementindex.html
vendored
@@ -1,392 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<head>
|
|
||||||
<!-- template designed by Marco Von Ballmoos -->
|
|
||||||
<title></title>
|
|
||||||
<link rel="stylesheet" href="media/stylesheet.css" />
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<a name="top"></a>
|
|
||||||
<h2>Full index</h2>
|
|
||||||
<h3>Package indexes</h3>
|
|
||||||
<ul>
|
|
||||||
<li><a href="elementindex_Krumo.html">Krumo</a></li>
|
|
||||||
</ul>
|
|
||||||
<br />
|
|
||||||
<div class="index-letter-menu">
|
|
||||||
<a class="index-letter" href="elementindex.html#b">b</a>
|
|
||||||
<a class="index-letter" href="elementindex.html#c">c</a>
|
|
||||||
<a class="index-letter" href="elementindex.html#d">d</a>
|
|
||||||
<a class="index-letter" href="elementindex.html#e">e</a>
|
|
||||||
<a class="index-letter" href="elementindex.html#f">f</a>
|
|
||||||
<a class="index-letter" href="elementindex.html#g">g</a>
|
|
||||||
<a class="index-letter" href="elementindex.html#h">h</a>
|
|
||||||
<a class="index-letter" href="elementindex.html#i">i</a>
|
|
||||||
<a class="index-letter" href="elementindex.html#k">k</a>
|
|
||||||
<a class="index-letter" href="elementindex.html#p">p</a>
|
|
||||||
<a class="index-letter" href="elementindex.html#r">r</a>
|
|
||||||
<a class="index-letter" href="elementindex.html#s">s</a>
|
|
||||||
<a class="index-letter" href="elementindex.html#v">v</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<a name="b"></a>
|
|
||||||
<div class="index-letter-section">
|
|
||||||
<div style="float: left" class="index-letter-title">b</div>
|
|
||||||
<div style="float: right"><a href="#top">top</a></div>
|
|
||||||
<div style="clear: both"></div>
|
|
||||||
</div>
|
|
||||||
<dl>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">backtrace</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodbacktrace">krumo::backtrace()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Prints a debug backtrace</div>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
<a name="c"></a>
|
|
||||||
<div class="index-letter-section">
|
|
||||||
<div style="float: left" class="index-letter-title">c</div>
|
|
||||||
<div style="float: right"><a href="#top">top</a></div>
|
|
||||||
<div style="clear: both"></div>
|
|
||||||
</div>
|
|
||||||
<dl>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">classes</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodclasses">krumo::classes()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Prints a list of all currently declared classes.</div>
|
|
||||||
</dd>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Page.png" alt="Page" title="Page" /></title>
|
|
||||||
<span class="include-title">class.krumo.php</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/_class_krumo_php.html">class.krumo.php</a> in class.krumo.php</div>
|
|
||||||
</dd>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">conf</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodconf">krumo::conf()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Prints a list of all your configuration settings.</div>
|
|
||||||
</dd>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">cookie</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodcookie">krumo::cookie()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Prints a list of all the values from the <em>$_COOKIE</em> array.</div>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
<a name="d"></a>
|
|
||||||
<div class="index-letter-section">
|
|
||||||
<div style="float: left" class="index-letter-title">d</div>
|
|
||||||
<div style="float: right"><a href="#top">top</a></div>
|
|
||||||
<div style="clear: both"></div>
|
|
||||||
</div>
|
|
||||||
<dl>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">defines</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methoddefines">krumo::defines()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Prints a list of all currently declared constants.</div>
|
|
||||||
</dd>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
|
|
||||||
<span class="const-title">DIR_SEP</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/_class_krumo_php.html#defineDIR_SEP">DIR_SEP</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">backward compatibility: the DIR_SEP constant isn't used anymore</div>
|
|
||||||
</dd>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">disable</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methoddisable">krumo::disable()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Disable Krumo</div>
|
|
||||||
</dd>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">dump</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methoddump">krumo::dump()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Dump information about a variable</div>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
<a name="e"></a>
|
|
||||||
<div class="index-letter-section">
|
|
||||||
<div style="float: left" class="index-letter-title">e</div>
|
|
||||||
<div style="float: right"><a href="#top">top</a></div>
|
|
||||||
<div style="clear: both"></div>
|
|
||||||
</div>
|
|
||||||
<dl>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">enable</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodenable">krumo::enable()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Enable Krumo</div>
|
|
||||||
</dd>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">env</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodenv">krumo::env()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Prints a list of all the values from the <em>$_ENV</em> array.</div>
|
|
||||||
</dd>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">extensions</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodextensions">krumo::extensions()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Prints a list of all currently loaded PHP extensions.</div>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
<a name="f"></a>
|
|
||||||
<div class="index-letter-section">
|
|
||||||
<div style="float: left" class="index-letter-title">f</div>
|
|
||||||
<div style="float: right"><a href="#top">top</a></div>
|
|
||||||
<div style="clear: both"></div>
|
|
||||||
</div>
|
|
||||||
<dl>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">functions</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodfunctions">krumo::functions()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Prints a list of all currently declared functions.</div>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
<a name="g"></a>
|
|
||||||
<div class="index-letter-section">
|
|
||||||
<div style="float: left" class="index-letter-title">g</div>
|
|
||||||
<div style="float: right"><a href="#top">top</a></div>
|
|
||||||
<div style="clear: both"></div>
|
|
||||||
</div>
|
|
||||||
<dl>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">get</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodget">krumo::get()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Prints a list of all the values from the <em>$_GET</em> array.</div>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
<a name="h"></a>
|
|
||||||
<div class="index-letter-section">
|
|
||||||
<div style="float: left" class="index-letter-title">h</div>
|
|
||||||
<div style="float: right"><a href="#top">top</a></div>
|
|
||||||
<div style="clear: both"></div>
|
|
||||||
</div>
|
|
||||||
<dl>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">headers</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodheaders">krumo::headers()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Prints a list of all HTTP request headers.</div>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
<a name="i"></a>
|
|
||||||
<div class="index-letter-section">
|
|
||||||
<div style="float: left" class="index-letter-title">i</div>
|
|
||||||
<div style="float: right"><a href="#top">top</a></div>
|
|
||||||
<div style="clear: both"></div>
|
|
||||||
</div>
|
|
||||||
<dl>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">includes</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodincludes">krumo::includes()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Prints a list of all currently included (or required) files.</div>
|
|
||||||
</dd>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">ini</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodini">krumo::ini()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Prints a list of all the values from an INI file.</div>
|
|
||||||
</dd>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">interfaces</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodinterfaces">krumo::interfaces()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Prints a list of all currently declared interfaces (PHP5 only).</div>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
<a name="k"></a>
|
|
||||||
<div class="index-letter-section">
|
|
||||||
<div style="float: left" class="index-letter-title">k</div>
|
|
||||||
<div style="float: right"><a href="#top">top</a></div>
|
|
||||||
<div style="clear: both"></div>
|
|
||||||
</div>
|
|
||||||
<dl>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Function.png" alt="Function" title="Function" /></title>
|
|
||||||
<span class="method-title">krumo</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/_class_krumo_php.html#functionkrumo">krumo()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Alias of <a href="Krumo/krumo.html#methoddump">krumo::dump()</a></div>
|
|
||||||
</dd>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Class.png" alt="Class" title="Class" /></title>
|
|
||||||
krumo
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html">krumo</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Krumo API</div>
|
|
||||||
</dd>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
|
|
||||||
<span class="const-title">KRUMO_DIR</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/_class_krumo_php.html#defineKRUMO_DIR">KRUMO_DIR</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Set the KRUMO_DIR constant up with the absolute path to Krumo files. If it is not defined, include_path will be used. Set KRUMO_DIR only if any other module or application has not already set it up.</div>
|
|
||||||
</dd>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
|
|
||||||
<span class="const-title">KRUMO_TRUNCATE_LENGTH</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/_class_krumo_php.html#defineKRUMO_TRUNCATE_LENGTH">KRUMO_TRUNCATE_LENGTH</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">This constant sets the maximum strings of strings that will be shown as they are. Longer strings will be truncated with this length, and their `full form` will be shown in a child node.</div>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
<a name="p"></a>
|
|
||||||
<div class="index-letter-section">
|
|
||||||
<div style="float: left" class="index-letter-title">p</div>
|
|
||||||
<div style="float: right"><a href="#top">top</a></div>
|
|
||||||
<div style="clear: both"></div>
|
|
||||||
</div>
|
|
||||||
<dl>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">path</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodpath">krumo::path()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Prints a list of the specified directories under your <em>include_path</em> option.</div>
|
|
||||||
</dd>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
|
|
||||||
<span class="const-title">PATH_SEPARATOR</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/_class_krumo_php.html#definePATH_SEPARATOR">PATH_SEPARATOR</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">backward compatibility: the PATH_SEPARATOR constant is availble since 4.3.0RC2</div>
|
|
||||||
</dd>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">phpini</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodphpini">krumo::phpini()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Prints a list of the configuration settings read from <em>php.ini</em></div>
|
|
||||||
</dd>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">post</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodpost">krumo::post()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Prints a list of all the values from the <em>$_POST</em> array.</div>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
<a name="r"></a>
|
|
||||||
<div class="index-letter-section">
|
|
||||||
<div style="float: left" class="index-letter-title">r</div>
|
|
||||||
<div style="float: right"><a href="#top">top</a></div>
|
|
||||||
<div style="clear: both"></div>
|
|
||||||
</div>
|
|
||||||
<dl>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">request</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodrequest">krumo::request()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Prints a list of all the values from the <em>$_REQUEST</em> array.</div>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
<a name="s"></a>
|
|
||||||
<div class="index-letter-section">
|
|
||||||
<div style="float: left" class="index-letter-title">s</div>
|
|
||||||
<div style="float: right"><a href="#top">top</a></div>
|
|
||||||
<div style="clear: both"></div>
|
|
||||||
</div>
|
|
||||||
<dl>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">server</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodserver">krumo::server()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Prints a list of all the values from the <em>$_SERVER</em> array.</div>
|
|
||||||
</dd>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">session</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodsession">krumo::session()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Prints a list of all the values from the <em>$_SESSION</em> array.</div>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
<a name="v"></a>
|
|
||||||
<div class="index-letter-section">
|
|
||||||
<div style="float: left" class="index-letter-title">v</div>
|
|
||||||
<div style="float: right"><a href="#top">top</a></div>
|
|
||||||
<div style="clear: both"></div>
|
|
||||||
</div>
|
|
||||||
<dl>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">version</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodversion">krumo::version()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Return Krumo version</div>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
|
|
||||||
<div class="index-letter-menu">
|
|
||||||
<a class="index-letter" href="elementindex.html#b">b</a>
|
|
||||||
<a class="index-letter" href="elementindex.html#c">c</a>
|
|
||||||
<a class="index-letter" href="elementindex.html#d">d</a>
|
|
||||||
<a class="index-letter" href="elementindex.html#e">e</a>
|
|
||||||
<a class="index-letter" href="elementindex.html#f">f</a>
|
|
||||||
<a class="index-letter" href="elementindex.html#g">g</a>
|
|
||||||
<a class="index-letter" href="elementindex.html#h">h</a>
|
|
||||||
<a class="index-letter" href="elementindex.html#i">i</a>
|
|
||||||
<a class="index-letter" href="elementindex.html#k">k</a>
|
|
||||||
<a class="index-letter" href="elementindex.html#p">p</a>
|
|
||||||
<a class="index-letter" href="elementindex.html#r">r</a>
|
|
||||||
<a class="index-letter" href="elementindex.html#s">s</a>
|
|
||||||
<a class="index-letter" href="elementindex.html#v">v</a>
|
|
||||||
</div>
|
|
||||||
@@ -1,389 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<head>
|
|
||||||
<!-- template designed by Marco Von Ballmoos -->
|
|
||||||
<title></title>
|
|
||||||
<link rel="stylesheet" href="media/stylesheet.css" />
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<a name="top"></a>
|
|
||||||
<h2>[Krumo] element index</h2>
|
|
||||||
<a href="elementindex.html">All elements</a>
|
|
||||||
<br />
|
|
||||||
<div class="index-letter-menu">
|
|
||||||
<a class="index-letter" href="elementindex_Krumo.html#b">b</a>
|
|
||||||
<a class="index-letter" href="elementindex_Krumo.html#c">c</a>
|
|
||||||
<a class="index-letter" href="elementindex_Krumo.html#d">d</a>
|
|
||||||
<a class="index-letter" href="elementindex_Krumo.html#e">e</a>
|
|
||||||
<a class="index-letter" href="elementindex_Krumo.html#f">f</a>
|
|
||||||
<a class="index-letter" href="elementindex_Krumo.html#g">g</a>
|
|
||||||
<a class="index-letter" href="elementindex_Krumo.html#h">h</a>
|
|
||||||
<a class="index-letter" href="elementindex_Krumo.html#i">i</a>
|
|
||||||
<a class="index-letter" href="elementindex_Krumo.html#k">k</a>
|
|
||||||
<a class="index-letter" href="elementindex_Krumo.html#p">p</a>
|
|
||||||
<a class="index-letter" href="elementindex_Krumo.html#r">r</a>
|
|
||||||
<a class="index-letter" href="elementindex_Krumo.html#s">s</a>
|
|
||||||
<a class="index-letter" href="elementindex_Krumo.html#v">v</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<a name="b"></a>
|
|
||||||
<div class="index-letter-section">
|
|
||||||
<div style="float: left" class="index-letter-title">b</div>
|
|
||||||
<div style="float: right"><a href="#top">top</a></div>
|
|
||||||
<div style="clear: both"></div>
|
|
||||||
</div>
|
|
||||||
<dl>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">backtrace</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodbacktrace">krumo::backtrace()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Prints a debug backtrace</div>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
<a name="c"></a>
|
|
||||||
<div class="index-letter-section">
|
|
||||||
<div style="float: left" class="index-letter-title">c</div>
|
|
||||||
<div style="float: right"><a href="#top">top</a></div>
|
|
||||||
<div style="clear: both"></div>
|
|
||||||
</div>
|
|
||||||
<dl>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">classes</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodclasses">krumo::classes()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Prints a list of all currently declared classes.</div>
|
|
||||||
</dd>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Page.png" alt="Page" title="Page" /></title>
|
|
||||||
<span class="include-title">class.krumo.php</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/_class_krumo_php.html">class.krumo.php</a> in class.krumo.php</div>
|
|
||||||
</dd>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">conf</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodconf">krumo::conf()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Prints a list of all your configuration settings.</div>
|
|
||||||
</dd>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">cookie</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodcookie">krumo::cookie()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Prints a list of all the values from the <em>$_COOKIE</em> array.</div>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
<a name="d"></a>
|
|
||||||
<div class="index-letter-section">
|
|
||||||
<div style="float: left" class="index-letter-title">d</div>
|
|
||||||
<div style="float: right"><a href="#top">top</a></div>
|
|
||||||
<div style="clear: both"></div>
|
|
||||||
</div>
|
|
||||||
<dl>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">defines</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methoddefines">krumo::defines()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Prints a list of all currently declared constants.</div>
|
|
||||||
</dd>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
|
|
||||||
<span class="const-title">DIR_SEP</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/_class_krumo_php.html#defineDIR_SEP">DIR_SEP</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">backward compatibility: the DIR_SEP constant isn't used anymore</div>
|
|
||||||
</dd>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">disable</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methoddisable">krumo::disable()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Disable Krumo</div>
|
|
||||||
</dd>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">dump</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methoddump">krumo::dump()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Dump information about a variable</div>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
<a name="e"></a>
|
|
||||||
<div class="index-letter-section">
|
|
||||||
<div style="float: left" class="index-letter-title">e</div>
|
|
||||||
<div style="float: right"><a href="#top">top</a></div>
|
|
||||||
<div style="clear: both"></div>
|
|
||||||
</div>
|
|
||||||
<dl>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">enable</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodenable">krumo::enable()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Enable Krumo</div>
|
|
||||||
</dd>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">env</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodenv">krumo::env()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Prints a list of all the values from the <em>$_ENV</em> array.</div>
|
|
||||||
</dd>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">extensions</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodextensions">krumo::extensions()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Prints a list of all currently loaded PHP extensions.</div>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
<a name="f"></a>
|
|
||||||
<div class="index-letter-section">
|
|
||||||
<div style="float: left" class="index-letter-title">f</div>
|
|
||||||
<div style="float: right"><a href="#top">top</a></div>
|
|
||||||
<div style="clear: both"></div>
|
|
||||||
</div>
|
|
||||||
<dl>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">functions</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodfunctions">krumo::functions()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Prints a list of all currently declared functions.</div>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
<a name="g"></a>
|
|
||||||
<div class="index-letter-section">
|
|
||||||
<div style="float: left" class="index-letter-title">g</div>
|
|
||||||
<div style="float: right"><a href="#top">top</a></div>
|
|
||||||
<div style="clear: both"></div>
|
|
||||||
</div>
|
|
||||||
<dl>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">get</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodget">krumo::get()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Prints a list of all the values from the <em>$_GET</em> array.</div>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
<a name="h"></a>
|
|
||||||
<div class="index-letter-section">
|
|
||||||
<div style="float: left" class="index-letter-title">h</div>
|
|
||||||
<div style="float: right"><a href="#top">top</a></div>
|
|
||||||
<div style="clear: both"></div>
|
|
||||||
</div>
|
|
||||||
<dl>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">headers</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodheaders">krumo::headers()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Prints a list of all HTTP request headers.</div>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
<a name="i"></a>
|
|
||||||
<div class="index-letter-section">
|
|
||||||
<div style="float: left" class="index-letter-title">i</div>
|
|
||||||
<div style="float: right"><a href="#top">top</a></div>
|
|
||||||
<div style="clear: both"></div>
|
|
||||||
</div>
|
|
||||||
<dl>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">includes</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodincludes">krumo::includes()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Prints a list of all currently included (or required) files.</div>
|
|
||||||
</dd>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">ini</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodini">krumo::ini()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Prints a list of all the values from an INI file.</div>
|
|
||||||
</dd>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">interfaces</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodinterfaces">krumo::interfaces()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Prints a list of all currently declared interfaces (PHP5 only).</div>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
<a name="k"></a>
|
|
||||||
<div class="index-letter-section">
|
|
||||||
<div style="float: left" class="index-letter-title">k</div>
|
|
||||||
<div style="float: right"><a href="#top">top</a></div>
|
|
||||||
<div style="clear: both"></div>
|
|
||||||
</div>
|
|
||||||
<dl>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Function.png" alt="Function" title="Function" /></title>
|
|
||||||
<span class="method-title">krumo</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/_class_krumo_php.html#functionkrumo">krumo()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Alias of <a href="Krumo/krumo.html#methoddump">krumo::dump()</a></div>
|
|
||||||
</dd>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Class.png" alt="Class" title="Class" /></title>
|
|
||||||
krumo
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html">krumo</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Krumo API</div>
|
|
||||||
</dd>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
|
|
||||||
<span class="const-title">KRUMO_DIR</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/_class_krumo_php.html#defineKRUMO_DIR">KRUMO_DIR</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Set the KRUMO_DIR constant up with the absolute path to Krumo files. If it is not defined, include_path will be used. Set KRUMO_DIR only if any other module or application has not already set it up.</div>
|
|
||||||
</dd>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
|
|
||||||
<span class="const-title">KRUMO_TRUNCATE_LENGTH</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/_class_krumo_php.html#defineKRUMO_TRUNCATE_LENGTH">KRUMO_TRUNCATE_LENGTH</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">This constant sets the maximum strings of strings that will be shown as they are. Longer strings will be truncated with this length, and their `full form` will be shown in a child node.</div>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
<a name="p"></a>
|
|
||||||
<div class="index-letter-section">
|
|
||||||
<div style="float: left" class="index-letter-title">p</div>
|
|
||||||
<div style="float: right"><a href="#top">top</a></div>
|
|
||||||
<div style="clear: both"></div>
|
|
||||||
</div>
|
|
||||||
<dl>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">path</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodpath">krumo::path()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Prints a list of the specified directories under your <em>include_path</em> option.</div>
|
|
||||||
</dd>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
|
|
||||||
<span class="const-title">PATH_SEPARATOR</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/_class_krumo_php.html#definePATH_SEPARATOR">PATH_SEPARATOR</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">backward compatibility: the PATH_SEPARATOR constant is availble since 4.3.0RC2</div>
|
|
||||||
</dd>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">phpini</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodphpini">krumo::phpini()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Prints a list of the configuration settings read from <em>php.ini</em></div>
|
|
||||||
</dd>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">post</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodpost">krumo::post()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Prints a list of all the values from the <em>$_POST</em> array.</div>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
<a name="r"></a>
|
|
||||||
<div class="index-letter-section">
|
|
||||||
<div style="float: left" class="index-letter-title">r</div>
|
|
||||||
<div style="float: right"><a href="#top">top</a></div>
|
|
||||||
<div style="clear: both"></div>
|
|
||||||
</div>
|
|
||||||
<dl>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">request</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodrequest">krumo::request()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Prints a list of all the values from the <em>$_REQUEST</em> array.</div>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
<a name="s"></a>
|
|
||||||
<div class="index-letter-section">
|
|
||||||
<div style="float: left" class="index-letter-title">s</div>
|
|
||||||
<div style="float: right"><a href="#top">top</a></div>
|
|
||||||
<div style="clear: both"></div>
|
|
||||||
</div>
|
|
||||||
<dl>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">server</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodserver">krumo::server()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Prints a list of all the values from the <em>$_SERVER</em> array.</div>
|
|
||||||
</dd>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">session</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodsession">krumo::session()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Prints a list of all the values from the <em>$_SESSION</em> array.</div>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
<a name="v"></a>
|
|
||||||
<div class="index-letter-section">
|
|
||||||
<div style="float: left" class="index-letter-title">v</div>
|
|
||||||
<div style="float: right"><a href="#top">top</a></div>
|
|
||||||
<div style="clear: both"></div>
|
|
||||||
</div>
|
|
||||||
<dl>
|
|
||||||
<dt class="field">
|
|
||||||
<img src="media/images/Method.png" alt="Method" title="Method" /></title>
|
|
||||||
<span class="method-title">version</span>
|
|
||||||
</dt>
|
|
||||||
<dd class="index-item-body">
|
|
||||||
<div class="index-item-details"><a href="Krumo/krumo.html#methodversion">krumo::version()</a> in class.krumo.php</div>
|
|
||||||
<div class="index-item-description">Return Krumo version</div>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
|
|
||||||
<div class="index-letter-menu">
|
|
||||||
<a class="index-letter" href="elementindex_Krumo.html#b">b</a>
|
|
||||||
<a class="index-letter" href="elementindex_Krumo.html#c">c</a>
|
|
||||||
<a class="index-letter" href="elementindex_Krumo.html#d">d</a>
|
|
||||||
<a class="index-letter" href="elementindex_Krumo.html#e">e</a>
|
|
||||||
<a class="index-letter" href="elementindex_Krumo.html#f">f</a>
|
|
||||||
<a class="index-letter" href="elementindex_Krumo.html#g">g</a>
|
|
||||||
<a class="index-letter" href="elementindex_Krumo.html#h">h</a>
|
|
||||||
<a class="index-letter" href="elementindex_Krumo.html#i">i</a>
|
|
||||||
<a class="index-letter" href="elementindex_Krumo.html#k">k</a>
|
|
||||||
<a class="index-letter" href="elementindex_Krumo.html#p">p</a>
|
|
||||||
<a class="index-letter" href="elementindex_Krumo.html#r">r</a>
|
|
||||||
<a class="index-letter" href="elementindex_Krumo.html#s">s</a>
|
|
||||||
<a class="index-letter" href="elementindex_Krumo.html#v">v</a>
|
|
||||||
</div>
|
|
||||||
15
gulliver/thirdparty/krumo/docs/errors.html
vendored
@@ -1,15 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<head>
|
|
||||||
<!-- template designed by Marco Von Ballmoos -->
|
|
||||||
<title>phpDocumentor Parser Errors and Warnings</title>
|
|
||||||
<link rel="stylesheet" href="media/stylesheet.css" />
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<a href="#Post-parsing">Post-parsing</a><br>
|
|
||||||
<p class="notes" id="credit">
|
|
||||||
Documentation generated on Sun, 02 Dec 2007 09:43:25 +0200 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.0a2</a>
|
|
||||||
</p>
|
|
||||||
</body>
|
|
||||||
24
gulliver/thirdparty/krumo/docs/index.html
vendored
@@ -1,24 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
||||||
<!DOCTYPE html
|
|
||||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//FR"
|
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<head>
|
|
||||||
<!-- Generated by phpDocumentor on Sat, 16 Jun 2007 09:50:08 +0300 -->
|
|
||||||
<title>Krumo</title>
|
|
||||||
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<FRAMESET rows='120,*'>
|
|
||||||
<FRAME src='packages.html' name='left_top' frameborder="1" bordercolor="#999999">
|
|
||||||
<FRAMESET cols='25%,*'>
|
|
||||||
<FRAME src='li_Krumo.html' name='left_bottom' frameborder="1" bordercolor="#999999">
|
|
||||||
<FRAME src='blank.html' name='right' frameborder="1" bordercolor="#999999">
|
|
||||||
</FRAMESET>
|
|
||||||
<NOFRAMES>
|
|
||||||
<H2>Frame Alert</H2>
|
|
||||||
<P>This document is designed to be viewed using the frames feature.
|
|
||||||
If you see this message, you are using a non-frame-capable web client.</P>
|
|
||||||
</NOFRAMES>
|
|
||||||
</FRAMESET>
|
|
||||||
</HTML>
|
|
||||||
155
gulliver/thirdparty/krumo/docs/li_Krumo.html
vendored
@@ -1,155 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<head>
|
|
||||||
<!-- template designed by Marco Von Ballmoos -->
|
|
||||||
<title></title>
|
|
||||||
<link rel="stylesheet" href="media/stylesheet.css" />
|
|
||||||
<script src="media/lib/classTree.js"></script>
|
|
||||||
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
|
|
||||||
<script language="javascript" type="text/javascript">
|
|
||||||
var imgPlus = new Image();
|
|
||||||
var imgMinus = new Image();
|
|
||||||
imgPlus.src = "media/images/plus.png";
|
|
||||||
imgMinus.src = "media/images/minus.png";
|
|
||||||
|
|
||||||
function showNode(Node){
|
|
||||||
switch(navigator.family){
|
|
||||||
case 'nn4':
|
|
||||||
// Nav 4.x code fork...
|
|
||||||
var oTable = document.layers["span" + Node];
|
|
||||||
var oImg = document.layers["img" + Node];
|
|
||||||
break;
|
|
||||||
case 'ie4':
|
|
||||||
// IE 4/5 code fork...
|
|
||||||
var oTable = document.all["span" + Node];
|
|
||||||
var oImg = document.all["img" + Node];
|
|
||||||
break;
|
|
||||||
case 'gecko':
|
|
||||||
// Standards Compliant code fork...
|
|
||||||
var oTable = document.getElementById("span" + Node);
|
|
||||||
var oImg = document.getElementById("img" + Node);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
oImg.src = imgMinus.src;
|
|
||||||
oTable.style.display = "block";
|
|
||||||
}
|
|
||||||
|
|
||||||
function hideNode(Node){
|
|
||||||
switch(navigator.family){
|
|
||||||
case 'nn4':
|
|
||||||
// Nav 4.x code fork...
|
|
||||||
var oTable = document.layers["span" + Node];
|
|
||||||
var oImg = document.layers["img" + Node];
|
|
||||||
break;
|
|
||||||
case 'ie4':
|
|
||||||
// IE 4/5 code fork...
|
|
||||||
var oTable = document.all["span" + Node];
|
|
||||||
var oImg = document.all["img" + Node];
|
|
||||||
break;
|
|
||||||
case 'gecko':
|
|
||||||
// Standards Compliant code fork...
|
|
||||||
var oTable = document.getElementById("span" + Node);
|
|
||||||
var oImg = document.getElementById("img" + Node);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
oImg.src = imgPlus.src;
|
|
||||||
oTable.style.display = "none";
|
|
||||||
}
|
|
||||||
|
|
||||||
function nodeIsVisible(Node){
|
|
||||||
switch(navigator.family){
|
|
||||||
case 'nn4':
|
|
||||||
// Nav 4.x code fork...
|
|
||||||
var oTable = document.layers["span" + Node];
|
|
||||||
break;
|
|
||||||
case 'ie4':
|
|
||||||
// IE 4/5 code fork...
|
|
||||||
var oTable = document.all["span" + Node];
|
|
||||||
break;
|
|
||||||
case 'gecko':
|
|
||||||
// Standards Compliant code fork...
|
|
||||||
var oTable = document.getElementById("span" + Node);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return (oTable && oTable.style.display == "block");
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleNodeVisibility(Node){
|
|
||||||
if (nodeIsVisible(Node)){
|
|
||||||
hideNode(Node);
|
|
||||||
}else{
|
|
||||||
showNode(Node);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<h3 class="package-title">Krumo</h3>
|
|
||||||
<div class="tree">
|
|
||||||
<script language="Javascript">
|
|
||||||
if (document.getElementById) {
|
|
||||||
var tree = new WebFXTree('<span class="package">Krumo</span>');
|
|
||||||
tree.setBehavior('classic');
|
|
||||||
tree.openIcon = 'media/images/package.png';
|
|
||||||
tree.icon = 'media/images/package.png';
|
|
||||||
|
|
||||||
|
|
||||||
var class_trees = new WebFXTreeItem('Class trees', 'classtrees_Krumo.html');
|
|
||||||
class_trees.openIcon = 'media/images/Index.png';
|
|
||||||
class_trees.icon = 'media/images/Index.png';
|
|
||||||
tree.add(class_trees);
|
|
||||||
|
|
||||||
var elements = new WebFXTreeItem('Index of elements', 'elementindex_Krumo.html');
|
|
||||||
elements.openIcon = 'media/images/Index.png';
|
|
||||||
elements.icon = 'media/images/Index.png';
|
|
||||||
tree.add(elements);
|
|
||||||
|
|
||||||
var parent_node;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var tree_classe = new WebFXTreeItem('Class(es)', '');
|
|
||||||
tree_classe.openIcon = 'media/images/class_folder.png';
|
|
||||||
tree_classe.icon = 'media/images/class_folder.png';
|
|
||||||
|
|
||||||
var classe = new WebFXTreeItem('krumo', 'Krumo/krumo.html');
|
|
||||||
classe.openIcon = 'media/images/Class.png';
|
|
||||||
classe.icon = 'media/images/Class.png';
|
|
||||||
tree_classe.add(classe);
|
|
||||||
|
|
||||||
tree.add(tree_classe);
|
|
||||||
|
|
||||||
var tree_function = new WebFXTreeItem('Function(s)', '');
|
|
||||||
tree_function.openIcon = 'media/images/function_folder.png';
|
|
||||||
tree_function.icon = 'media/images/function_folder.png';
|
|
||||||
|
|
||||||
var fic = new WebFXTreeItem('krumo', 'Krumo/_class.krumo.php.html#functionkrumo');
|
|
||||||
fic.openIcon = 'media/images/Function.png';
|
|
||||||
fic.icon = 'media/images/Function.png';
|
|
||||||
tree_function.add(fic);
|
|
||||||
|
|
||||||
tree.add(tree_function);
|
|
||||||
|
|
||||||
var tree_file = new WebFXTreeItem('File(s)', '');
|
|
||||||
tree_file.openIcon = 'media/images/folder.png';
|
|
||||||
tree_file.icon = 'media/images/folder.png';
|
|
||||||
|
|
||||||
var file = new WebFXTreeItem('class.krumo.php', 'Krumo/_class.krumo.php.html');
|
|
||||||
file.openIcon = 'media/images/Page.png';
|
|
||||||
file.icon = 'media/images/Page.png';
|
|
||||||
tree_file.add(file);
|
|
||||||
|
|
||||||
tree.add(tree_file);
|
|
||||||
|
|
||||||
|
|
||||||
document.write(tree);
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</div>
|
|
||||||
<p class="notes">
|
|
||||||
Generated by
|
|
||||||
<a href="http://www.phpdoc.org" target="_blank">phpDocumentor <span class="field">1.4.0a2</span></a>
|
|
||||||
</p>
|
|
||||||
</body>
|
|
||||||
32
gulliver/thirdparty/krumo/docs/media/banner.css
vendored
@@ -1,32 +0,0 @@
|
|||||||
body
|
|
||||||
{
|
|
||||||
background-color: #EEEEEE;
|
|
||||||
margin: 0px;
|
|
||||||
padding: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Banner (top bar) classes */
|
|
||||||
|
|
||||||
.banner { }
|
|
||||||
|
|
||||||
.banner-menu
|
|
||||||
{
|
|
||||||
clear: both;
|
|
||||||
padding: .5em;
|
|
||||||
border-top: 2px solid #AAAAAA;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner-title
|
|
||||||
{
|
|
||||||
text-align: right;
|
|
||||||
font-size: 20pt;
|
|
||||||
font-weight: bold;
|
|
||||||
margin: .2em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.package-selector
|
|
||||||
{
|
|
||||||
background-color: #DDDDDD;
|
|
||||||
border: 1px solid #AAAAAA;
|
|
||||||
color: #000090;
|
|
||||||
}
|
|
||||||
|
Before Width: | Height: | Size: 620 B |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 696 B |
|
Before Width: | Height: | Size: 848 B |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 874 B |
|
Before Width: | Height: | Size: 570 B |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 752 B |
|
Before Width: | Height: | Size: 865 B |
|
Before Width: | Height: | Size: 956 B |
|
Before Width: | Height: | Size: 596 B |
|
Before Width: | Height: | Size: 712 B |
BIN
gulliver/thirdparty/krumo/docs/media/images/I.png
vendored
|
Before Width: | Height: | Size: 148 B |
|
Before Width: | Height: | Size: 584 B |
|
Before Width: | Height: | Size: 1.1 KiB |