| 13 |
* $Id$ |
* $Id$ |
| 14 |
* |
* |
| 15 |
* $Log$ |
* $Log$ |
| 16 |
|
* Revision 1.9 2005/08/11 14:06:26 jonen |
| 17 |
|
* + added generic array-key sorting function |
| 18 |
|
* |
| 19 |
|
* Revision 1.8 2004/07/21 12:56:19 joko |
| 20 |
|
* php5 compatibility |
| 21 |
|
* |
| 22 |
|
* Revision 1.7 2003/06/25 23:41:14 joko |
| 23 |
|
* now using "global $Dumper_mode" |
| 24 |
|
* |
| 25 |
* Revision 1.6 2003/04/16 16:24:23 joko |
* Revision 1.6 2003/04/16 16:24:23 joko |
| 26 |
* + odd and even from php.net |
* + odd and even from php.net |
| 27 |
* |
* |
| 187 |
} |
} |
| 188 |
|
|
| 189 |
function Dumper() { |
function Dumper() { |
| 190 |
|
global $Dumper_mode; |
| 191 |
$arg_list = func_get_args(); |
$arg_list = func_get_args(); |
| 192 |
$count = 1; |
$count = 1; |
| 193 |
|
|
| 205 |
ob_end_clean(); |
ob_end_clean(); |
| 206 |
|
|
| 207 |
//print "mode: " . $this->Dumper_mode . "<br/>"; |
//print "mode: " . $this->Dumper_mode . "<br/>"; |
| 208 |
//if ($this->Dumper_mode == HTML) { |
if ($Dumper_mode == 'single_line') { |
| 209 |
|
$var_dump = str_replace("\n", ' ', $var_dump); |
| 210 |
|
} else { |
| 211 |
$var_dump = str_replace("\n", '<br/>', $var_dump); |
$var_dump = str_replace("\n", '<br/>', $var_dump); |
| 212 |
$var_dump = str_replace(" ", ' ', $var_dump); |
$var_dump = str_replace(" ", ' ', $var_dump); |
| 213 |
//} |
} |
| 214 |
|
|
| 215 |
//if (sizeof($args) == 1) { $var_dump .= '<br/>'; } |
//if (sizeof($args) == 1) { $var_dump .= '<br/>'; } |
| 216 |
|
|
| 435 |
|
|
| 436 |
// from: http://www.php.net/manual/en/function.method-exists.php |
// from: http://www.php.net/manual/en/function.method-exists.php |
| 437 |
function class_has_method($className, $methodName) { |
function class_has_method($className, $methodName) { |
| 438 |
$bool_exists = (in_array(strtolower($methodName), get_class_methods($className))); |
|
| 439 |
|
// new as of 2004-07-21: php5 compatibility |
| 440 |
|
// taken from http://php.net/manual/en/function.version-compare.php |
| 441 |
|
if (version_compare(phpversion(), "5.0.0", "<")) { |
| 442 |
|
$methodName = strtolower($methodName); |
| 443 |
|
} |
| 444 |
|
|
| 445 |
|
$bool_exists = (in_array($methodName, get_class_methods($className))); |
| 446 |
return $bool_exists; |
return $bool_exists; |
| 447 |
} |
} |
| 448 |
|
|
| 541 |
*/ |
*/ |
| 542 |
|
|
| 543 |
if (!class_exists($classname)) { |
if (!class_exists($classname)) { |
| 544 |
user_error("Class '$classname' doesn't exist."); |
php::log( "Class '$classname' doesn't exist.", PEAR_LOG_ERR ); |
| 545 |
return; |
return; |
| 546 |
} |
} |
| 547 |
|
|
| 724 |
function even($var) { |
function even($var) { |
| 725 |
return ($var % 2 == 0); |
return ($var % 2 == 0); |
| 726 |
} |
} |
| 727 |
|
|
| 728 |
|
// modified version from: http://de.php.net/manual/en/function.array-multisort.php |
| 729 |
|
// compare values of two array-keys |
| 730 |
|
// usage: asort($array, "comparar_caption"); |
| 731 |
|
function comparar_caption($a, $b, $key_name="caption") { |
| 732 |
|
return strnatcasecmp($a[$key_name], $b[$key_name]); |
| 733 |
|
} |
| 734 |
|
|
| 735 |
|
|
| 736 |
} |
} |
| 737 |
|
|