|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00024 require_once 'Zend/Server/Reflection/Function.php'; 00025 00029 require_once 'Zend/Server/Reflection/Class.php'; 00030 00041 class Zend_Server_Reflection 00042 { 00060 public static function reflectClass($class, $argv = false, $namespace = '') 00061 { 00062 if (is_object($class)) { 00063 $reflection = new ReflectionObject($class); 00064 } elseif (class_exists($class)) { 00065 $reflection = new ReflectionClass($class); 00066 } else { 00067 require_once 'Zend/Server/Reflection/Exception.php'; 00068 throw new Zend_Server_Reflection_Exception('Invalid class or object passed to attachClass()'); 00069 } 00070 00071 if ($argv && !is_array($argv)) { 00072 require_once 'Zend/Server/Reflection/Exception.php'; 00073 throw new Zend_Server_Reflection_Exception('Invalid argv argument passed to reflectClass'); 00074 } 00075 00076 return new Zend_Server_Reflection_Class($reflection, $namespace, $argv); 00077 } 00078 00096 public static function reflectFunction($function, $argv = false, $namespace = '') 00097 { 00098 if (!is_string($function) || !function_exists($function)) { 00099 require_once 'Zend/Server/Reflection/Exception.php'; 00100 throw new Zend_Server_Reflection_Exception('Invalid function "' . $function . '" passed to reflectFunction'); 00101 } 00102 00103 00104 if ($argv && !is_array($argv)) { 00105 require_once 'Zend/Server/Reflection/Exception.php'; 00106 throw new Zend_Server_Reflection_Exception('Invalid argv argument passed to reflectClass'); 00107 } 00108 00109 return new Zend_Server_Reflection_Function(new ReflectionFunction($function), $namespace, $argv); 00110 } 00111 }