--- t3lib\class.t3lib_div.trunk.php Sat Aug 28 11:38:25 2010 +++ t3lib\class.t3lib_div.php Sat Aug 28 12:22:38 2010 @@ -431,6 +431,43 @@ + + + + + + /************************* + * + * TYPE FUNCTIONS + * + *************************/ + + /** + * Returns the type-information for $input. + * + * @param mixed input to test for type + * @return string type of input as string + */ + public static function getType ($input) { + $type = 'string'; + if (is_array($input)) $type = 'array'; + elseif (is_object($input)) $type = 'object'; + elseif (is_resource($input)) $type = 'resource'; + elseif (is_int($input)) $type = 'int'; + elseif (is_float($input)) $type = 'float'; + elseif (is_bool($input)) $type = 'bool'; + return $type; + } + + + + + + + + + + /************************* * * IMAGE FUNCTIONS @@ -2178,6 +2215,52 @@ } return $out; } + + + + + + + + + + + + + + + + + /************************* + * + * OBJECT-FUNCTIONS + * + *************************/ + + + /** + * Returns an Array with Information about an Object. + * For Details look at the Function below and the used PHP-Functions in the PHP-Manual. + * + * @param mixed Should be of Type Object but can be of any Type. + * @return array Object-Information or empty if $input is no Object + */ + public static function getObjectEnv($input) { + $obj = array(); + if (is_object($input)) { + $class = get_class($input); + $obj = array( + 'Type' => 'object', + 'Classname' => $class, + 'Parent Class' => get_parent_class($class), + 'Methods' => get_class_methods($class), + 'Class Variables' => get_class_vars($class), + 'Object Variables' => get_object_vars($input), + 'Implemented Interfaces' => class_implements($class) + ); + } + return $obj; + }