getParameters(); $this->info = $params[$param]->info; $this->name = $this->info['name']; } } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionparameter.tostring.php * ) * * To string. Warning: This function is currently not documented; only its * argument list is available. * */ public function __toString() { // TODO return ""; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionparameter.export.php ) * * Exports. Warning: This function is currently not documented; only its * argument list is available. * * @func mixed The function name. * @param mixed The parameter name. * @ret mixed Setting to TRUE will return the export, as opposed * to emitting it. Setting to FALSE (the default) will * do the opposite. * * @return mixed The exported reflection. */ public static function export($func, $param, $ret=false) { $obj = new ReflectionParameter($func, $param); $str = (string)$obj; if ($ret) { return $str; } print $str; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionparameter.getname.php * ) * * Gets the name of the parameter. * * @return mixed The name of the reflected parameter. */ public function getName() { return $this->info['name']; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionparameter.ispassedbyreference.php ) * * Checks if the parameter is passed in by reference. Warning: This * function is currently not documented; only its argument list is * available. * * @return mixed TRUE if the parameter is passed in by reference, * otherwise FALSE */ public function isPassedByReference() { return isset($this->info['ref']); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionparameter.getdeclaringclass.php ) * * Gets the declaring class. Warning: This function is currently not * documented; only its argument list is available. * * @return mixed A ReflectionClass object. */ public function getDeclaringClass() { if (empty($this->info['class'])) { return null; } return new ReflectionClass($this->info['class']); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionparameter.getdeclaringfunction.php ) * * Gets the declaring function. Warning: This function is currently not * documented; only its argument list is available. * * @return mixed A ReflectionFunction object. */ public function getDeclaringFunction() { if (empty($this->info['class'])) { return new ReflectionFunction($this->info['function']); } return new ReflectionMethod($this->info['class'], $this->info['function']); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionparameter.getclass.php * ) * * Gets a class. Warning: This function is currently not documented; only * its argument list is available. * * @return mixed A ReflectionClass object. */ public function getClass() { if (empty($this->info['type'])) { return null; } $ltype = strtolower($this->info['type']); if (hphp_scalar_typehints_enabled()) { $nonClassTypehints = array( 'bool' => 1, 'boolean' => 1, 'int' => 1, 'integer' => 1, 'real' => 1, 'double' => 1, 'float' => 1, 'string' => 1, 'array' => 1 ); if (isset($nonClassTypehints[$ltype])) { return null; } } else if ($ltype === 'array') { return null; } return new ReflectionClass($this->info['type']); } public function getTypehintText() { if (isset($this->info['type'])) { return $this->info['type']; } return ''; } public function getTypeText() { if (isset($this->info['type_hint'])) { return $this->info['type_hint']; } return ''; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionparameter.isarray.php * ) * * Checks if the parameter expects an array. * * @return mixed TRUE if an array is expected, FALSE otherwise. */ public function isArray() { return $this->info['type'] == 'array'; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionparameter.allowsnull.php ) * * Checks whether the parameter allows NULL. Warning: This function is * currently not documented; only its argument list is available. * * @return mixed TRUE if NULL is allowed, otherwise FALSE */ public function allowsNull() { return isset($this->info['nullable']); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionparameter.isoptional.php ) * * Checks if the parameter is optional. * * @return mixed TRUE if the parameter is optional, otherwise FALSE */ public function isOptional() { return array_key_exists('default', $this->info); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionparameter.isdefaultvalueavailable.php * ) * * Checks if a default value for the parameter is available. * * @return mixed TRUE if a default value is available, otherwise * FALSE */ public function isDefaultValueAvailable() { return array_key_exists('default', $this->info); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionparameter.getdefaultvalue.php ) * * Gets the default value of the parameter for a user-defined function or * method. If the parameter is not optional a ReflectionException will be * thrown. * * @return mixed The parameters default value. */ public function getDefaultValue() { if (!$this->isOptional()) { throw new ReflectionException('Parameter is not optional'); } $defaultValue = $this->info['default']; if ($defaultValue instanceof stdclass) { if (isset($defaultValue->class)) { return hphp_get_class_constant($defaultValue->class, $defaultValue->name); } hphp_throw_fatal_error($defaultValue->msg); } return $defaultValue; } /** * @deprecated */ public function getDefaultValueText() { return $this->getDefaultValueConstantName(); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionparameter.getdefaultvalueconstantname.php * ) * * WarningThis function is currently not documented; only its argument * list is available. * * @return mixed Returns string on success or NULL on failure. */ public function getDefaultValueConstantName() { if (isset($this->info['defaultText'])) { return $this->info['defaultText']; } return ''; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionparameter.getposition.php ) * * Gets the position of the parameter. * * @return mixed The position of the parameter, left to right, * starting at position #0. */ public function getPosition() { return $this->info['index']; } public function getAttribute($name) { $attrs = $this->info['attributes']; return isset($attrs[$name]) ? $attrs[$name] : null; } public function getAttributes() { return $this->info['attributes']; } public function getAttributeRecursive($name) { $attrs = $this->getAttributesRecursive(); return isset($attrs[$name]) ? $attrs[$name] : null; } public function getAttributesRecursive() { if (!isset($this->info['class'])) { return $this->getAttributes(); } $attrs = array(); $class = $this->getDeclaringClass(); $function_name = $this->info['function']; $index = $this->info['index']; self::collectAttributes(&$attrs, $class, $function_name, $index); return $attrs; } private static function collectAttributes(&$attrs, $class, $function_name, $index) { if ($class->hasMethod($function_name)) { $method = $class->getMethod($function_name); $params = $method->getParameters(); if (count($params) >= $index) { $attrs += $params[$index]->getAttributes(); } } $parent = $class->getParentClass(); if ($parent) { self::collectAttributes( &$attrs, $parent, $function_name, $index); } } } /////////////////////////////////////////////////////////////////////////////// // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/class.reflectionfunctionabstract.php ) * * A parent class to ReflectionFunction, read its description for details. * */ class ReflectionFunctionAbstract { public $info; // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionfunctionabstract.getname.php ) * * Get the name of the function. Warning: This function is currently not * documented; only its argument list is available. * * @return mixed The name of the function. */ public function getName() { return $this->info['name']; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionfunctionabstract.isinternal.php ) * * Checks whether the function is internal, as opposed to user-defined. * Warning: This function is currently not documented; only its argument * list is available. * * @return mixed TRUE if it's internal, otherwise FALSE */ public function isInternal() { return isset($this->info['internal']); } public function getClosure() { return $this->info['closure']; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionfunctionabstract.isclosure.php ) * * Checks whether it's a closure. Warning: This function is currently not * documented; only its argument list is available. * * @return mixed TRUE if it's a closure, otherwise FALSE */ public function isClosure() { return !empty($this->info['is_closure']); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionfunctionabstract.isgenerator.php ) * * Warning: This function is currently not documented; only its argument * list is available. * * @return mixed Returns TRUE if the function is generator, FALSE if * it is not or NULL on failure. */ public function isGenerator() { return !empty($this->info['is_generator']); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionfunctionabstract.isuserdefined.php ) * * Checks whether the function is user-defined, as opposed to internal. * Warning: This function is currently not documented; only its argument * list is available. * * @return mixed TRUE if it's user-defined, otherwise false; */ public function isUserDefined() { return !isset($this->info['internal']); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionfunctionabstract.getfilename.php ) * * Gets the file name from a user-defined function. Warning: This function * is currently not documented; only its argument list is available. * * @return mixed The file name. */ public function getFileName() { return $this->info['file']; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionfunctionabstract.getstartline.php ) * * Gets the starting line number of the function. Warning: This function * is currently not documented; only its argument list is available. * * @return mixed The starting line number. */ public function getStartLine() { return $this->info['line1']; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionfunctionabstract.getendline.php ) * * Get the ending line number. Warning: This function is currently not * documented; only its argument list is available. * * @return mixed The ending line number of the user defined function, * or FALSE if unknown. */ public function getEndLine() { return $this->info['line2']; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionfunctionabstract.getdoccomment.php ) * * Get a Doc comment from a function. Warning: This function is currently * not documented; only its argument list is available. * * @return mixed The doc comment if it exists, otherwise FALSE */ public function getDocComment() { return $this->info['doc']; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionfunctionabstract.getstaticvariables.php * ) * * Get the static variables. Warning: This function is currently not * documented; only its argument list is available. * * @return mixed An array of static variables. */ public function getStaticVariables() { return $this->info['static_variables']; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionfunctionabstract.returnsreference.php * ) * * Checks whether the function returns a reference. Warning: This function * is currently not documented; only its argument list is available. * * @return mixed TRUE if it returns a reference, otherwise FALSE */ public function returnsReference() { return isset($this->info['ref']); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionfunctionabstract.getparameters.php ) * * Get the parameters as an array of ReflectionParameter. Warning: This * function is currently not documented; only its argument list is * available. * * @return mixed The parameters, as a ReflectionParameter object. */ public function getParameters() { $ret = array(); foreach ($this->info['params'] as $name => $info) { $param = new ReflectionParameter(null, null); $param->info = $info; $param->name = $info['name']; $ret[] = $param; } return $ret; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionfunctionabstract.getnumberofparameters.php * ) * * Get the number of parameters that a function defines, both optional and * required. Warning: This function is currently not documented; only its * argument list is available. * * @return mixed The number of parameters. */ public function getNumberOfParameters() { return count($this->info['params']); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionfunctionabstract.getnumberofrequiredparameters.php * ) * * Get the number of required parameters that a function defines. Warning: * This function is currently not documented; only its argument list is * available. * * @return mixed The number of required parameters. */ public function getNumberOfRequiredParameters() { $count = 0; $params = $this->getParameters(); foreach ($params as $name => $param) { if ($param->isOptional()) { break; } $count++; } return $count; } public function getReturnTypeText() { if (isset($this->info['return_type'])) { return $this->info['return_type']; } return ''; } } /////////////////////////////////////////////////////////////////////////////// // function // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/class.reflectionfunction.php ) * * The ReflectionFunction class reports information about a function. * */ class ReflectionFunction extends ReflectionFunctionAbstract implements Reflector { const IS_DEPRECATED = 262144; // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionfunction.construct.php * ) * * Constructs a ReflectionFunction object. * * @name mixed The name of the function to reflect or a closure. * * @return mixed No value is returned. */ public function __construct($name) { if ($name instanceof Closure) { $this->info = hphp_get_closure_info($name); } else { $this->info = hphp_get_function_info($name); if (empty($this->info)) { throw new ReflectionException("Function $name does not exist"); } } } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionfunction.tostring.php * ) * * To string. * * @return mixed Returns ReflectionFunction::export()-like output for * the function. */ public function __toString() { //TODO return ""; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionfunction.export.php ) * * Exports a Reflected function. * * @name mixed The reflection to export. * @ret mixed Setting to TRUE will return the export, as opposed * to emitting it. Setting to FALSE (the default) will * do the opposite. * * @return mixed If the return parameter is set to TRUE, then the * export is returned as a string, otherwise NULL is * returned. */ public static function export($name, $ret=false) { $obj = new ReflectionFunction($name); $str = (string)$obj; if ($ret) { return $str; } print $str; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionfunction.invoke.php ) * * Invokes a reflected function. * * @return mixed Returns the result of the invoked function call. */ public function invoke() { $args = func_get_args(); if (isset($this->info['closureobj'])) { $closure = $this->info['closureobj']; return hphp_invoke_method($closure, get_class($closure), '__invoke', $args); } return hphp_invoke($this->info['name'], $args); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionfunction.invokeargs.php ) * * Invokes the function and pass its arguments as array. * * @args mixed The passed arguments to the function as an array, * much like call_user_func_array() works. * * @return mixed Returns the result of the invoked function */ public function invokeArgs($args) { if (isset($this->info['closureobj'])) { $closure = $this->info['closureobj']; return hphp_invoke_method($closure, get_class($closure), '__invoke', array_values($args)); } return hphp_invoke($this->info['name'], array_values($args)); } public function getAttribute($name) { $attrs = $this->info['attributes']; return isset($attrs[$name]) ? $attrs[$name] : null; } public function getAttributes() { return $this->info['attributes']; } public function getAttributeRecursive($name) { $attrs = $this->info['attributes']; return isset($attrs[$name]) ? $attrs[$name] : null; } public function getAttributesRecursive() { return $this->info['attributes']; } } /////////////////////////////////////////////////////////////////////////////// // class // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/class.reflectionclass.php ) * * The ReflectionClass class reports information about a class. * */ class ReflectionClass implements Reflector { const IS_IMPLICIT_ABSTRACT = 16 ; const IS_EXPLICIT_ABSTRACT = 32 ; const IS_FINAL = 64 ; public $name; private $info = null; private static $fetched = array(); // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionclass.construct.php ) * * Constructs a new ReflectionClass object. Warning: This function is * currently not documented; only its argument list is available. * * @name mixed Either a string containing the name of the class to * reflect, or an object. * * @return mixed No value is returned. */ public function __construct($name) { if (is_object($name)) { $name = get_class($name); } $this->name = hphp_get_original_class_name($name); if (empty($this->name)) { throw new ReflectionException("Class $name does not exist"); } } private function fetch($what) { if (!$this->info) { $this->info = self::fetch_recur($this->name); $this->info['properties'] += $this->info['private_properties']; } return $this->info[$what]; } private static function fetch_recur($name) { if (isset(self::$fetched[$name])) return self::$fetched[$name]; $info = hphp_get_class_info($name); if (empty($info)) { throw new ReflectionException("Class $name does not exist"); } $info['attributes_rec'] = $info['attributes']; $abstract = isset($info['abstract']) || isset($info['interface']); // flattening the trees, so it's easier for lookups foreach ($info['interfaces'] as $interface => $_) { $p = self::fetch_recur($interface); if ($abstract) $info['methods'] += $p['methods']; $info['constants'] += $p['constants']; $info['interfaces'] += $p['interfaces']; } $parent = $info['parent']; if (!empty($parent)) { $p = self::fetch_recur($parent); if (isset($p['interface'])) { $info['interfaces'][$parent] = 1; } else { $info['properties'] += $p['properties']; } $info['methods'] += $p['methods']; $info['constants'] += $p['constants']; $info['interfaces'] += $p['interfaces']; $info['attributes_rec'] += $p['attributes_rec']; } self::$fetched[$name] = $info; return $info; } private function check($what) { if (!$this->info) { $this->info = self::fetch_recur($this->name); } return isset($this->info[$what]); } private function test($what, $name) { $v = $this->fetch($what); return $v && isset($v[$name]); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionclass.tostring.php ) * * Returns the string representation of the ReflectionClass object. * * @return mixed A string representation of this ReflectionClass * instance. */ public function __toString() { return ""; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionclass.export.php ) * * Exports a reflected class. * * @name mixed The reflection to export. * @ret mixed Setting to TRUE will return the export, as opposed * to emitting it. Setting to FALSE (the default) will * do the opposite. * * @return mixed If the return parameter is set to TRUE, then the * export is returned as a string, otherwise NULL is * returned. */ public static function export($name, $ret=false) { $obj = new ReflectionClass($name); $str = (string)$obj; if ($ret) { return $str; } print $str; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionclass.getname.php ) * * Gets the class name. Warning: This function is currently not * documented; only its argument list is available. * * @return mixed The class name. */ public function getName() { return $this->name; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionclass.isinternal.php ) * * Checks if the class is defined internally by an extension, or the core, * as opposed to user-defined. * * @return mixed Returns TRUE on success or FALSE on failure. */ public function isInternal() { return $this->check('internal'); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionclass.isuserdefined.php ) * * Checks whether the class is user-defined, as opposed to internal. * * @return mixed Returns TRUE on success or FALSE on failure. */ public function isUserDefined() { return !$this->check('internal'); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionclass.isinstantiable.php ) * * Checks if the class is instantiable. * * @return mixed Returns TRUE on success or FALSE on failure. */ public function isInstantiable() { return !$this->check('abstract'); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionclass.hasconstant.php * ) * * Checks whether the class has a specific constant defined or not. * * @name mixed The name of the constant being checked for. * * @return mixed TRUE if the constant is defined, otherwise FALSE. */ public function hasConstant($name) { return $this->test('constants', $name); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionclass.hasmethod.php ) * * Checks whether a specific method is defined in a class. * * @name mixed Name of the method being checked for. * * @return mixed TRUE if it has the method, otherwise FALSE */ public function hasMethod($name) { return $this->test('methods', strtolower($name)); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionclass.hasproperty.php * ) * * Checks whether the specified property is defined. * * @name mixed Name of the property being checked for. * * @return mixed TRUE if it has the property, otherwise FALSE */ public function hasProperty($name) { return $this->test('properties', $name); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionclass.getfilename.php * ) * * Gets the filename of the file in which the class has been defined. * * @return mixed Returns the filename of the file in which the class * has been defined. If the class is defined in the PHP * core or in a PHP extension, FALSE is returned. */ public function getFileName() { return $this->fetch('file'); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionclass.getstartline.php * ) * * Get the starting line number. Warning: This function is currently not * documented; only its argument list is available. * * @return mixed The starting line number, as an integer. */ public function getStartLine() { return $this->fetch('line1'); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionclass.getendline.php ) * * Gets end line number from a user-defined class definition. * * @return mixed The ending line number of the user defined class, or * FALSE if unknown. */ public function getEndLine() { return $this->fetch('line2'); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionclass.getdoccomment.php ) * * Gets doc comments from a class. Warning: This function is currently not * documented; only its argument list is available. * * @return mixed The doc comment if it exists, otherwise FALSE */ public function getDocComment() { return $this->fetch('doc'); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionclass.getconstructor.php ) * * Gets the constructor of the reflected class. * * @return mixed A ReflectionMethod object reflecting the class' * constructor, or NULL if the class has no * constructor. */ public function getConstructor() { if ($this->hasMethod('__construct')) { return $this->getMethod('__construct'); } if (!$this->isTrait() && $this->hasMethod($name = $this->name)) { return $this->getMethod($name); } return null; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionclass.getmethod.php ) * * Gets a ReflectionMethod for a class method. * * @name mixed The method name to reflect. * * @return mixed A ReflectionMethod. */ public function getMethod($name) { if (!$this->info) { $method = hphp_get_method_info($this->name, $name); } else { $lname = strtolower($name); $methods = $this->info['methods']; if (isset($methods[$lname])) $method = $methods[$lname]; } if (empty($method)) { $class = $this->name; throw new ReflectionException("Method $class::$name does not exist"); } $ret = new ReflectionMethod(null, null); $ret->info = $method; $ret->name = $method['name']; $ret->class = $method['class']; return $ret; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionclass.getmethods.php ) * * Gets an array of methods for the class. * * @filter mixed Filter the results to include only methods with * certain attributes. Defaults to no filtering. * * Any combination of ReflectionMethod::IS_STATIC, * ReflectionMethod::IS_PUBLIC, * ReflectionMethod::IS_PROTECTED, * ReflectionMethod::IS_PRIVATE, * ReflectionMethod::IS_ABSTRACT, * ReflectionMethod::IS_FINAL. * * @return mixed An array of ReflectionMethod objects reflecting each * method. */ public function getMethods($filter = 0xFFFF) { $ret = array(); $methods = $this->fetch('methods'); foreach ($methods as $name => $_) { $m = $this->getMethod($name); if ((($filter & ReflectionMethod::IS_PUBLIC)) && $m->isPublic() || (($filter & ReflectionMethod::IS_PROTECTED)) && $m->isProtected() || (($filter & ReflectionMethod::IS_PRIVATE)) && $m->isPrivate() || (($filter & ReflectionMethod::IS_STATIC)) && $m->isStatic() || (($filter & ReflectionMethod::IS_FINAL)) && $m->isFinal() || (($filter & ReflectionMethod::IS_ABSTRACT && $m->isAbstract()))) { $ret[] = $m; } } return $ret; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionclass.getproperty.php * ) * * Gets a ReflectionProperty for a class's property. * * @name mixed The property name. * * @return mixed A ReflectionProperty. */ public function getProperty($name) { $properties = $this->fetch('properties'); if (!isset($properties[$name])) { $class = $this->info['name']; throw new ReflectionException("Property $class::$name does not exist"); } $ret = new ReflectionProperty(null, null); $ret->info = $properties[$name]; $ret->name = $name; $ret->class = $this->info['name']; return $ret; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionclass.getproperties.php ) * * Retrieves reflected properties. * * @filter mixed The optional filter, for filtering desired property * types. It's configured using the ReflectionProperty * constants, and defaults to all property types. * * @return mixed An array of ReflectionProperty objects. */ public function getProperties($filter = 0xFFFF) { $ret = array(); foreach ($this->fetch('properties') as $name => $_) { $p = $this->getProperty($name); if (($filter & ReflectionProperty::IS_PUBLIC) && $p->isPublic() || ($filter & ReflectionProperty::IS_PROTECTED) && $p->isProtected() || ($filter & ReflectionProperty::IS_PRIVATE) && $p->isPrivate() || ($filter & ReflectionProperty::IS_STATIC) && $p->isStatic()) { $ret[] = $p; } } return $ret; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionclass.getconstants.php * ) * * Gets defined constants from a class. Warning: This function is * currently not documented; only its argument list is available. * * @return mixed An array of constants. Constant name in key, * constant value in value. */ public function getConstants() { return $this->fetch('constants'); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionclass.getconstant.php * ) * * Gets the defined constant. Warning: This function is currently not * documented; only its argument list is available. * * @name mixed Name of the constant. * * @return mixed Value of the constant. */ public function getConstant($name) { $constants = $this->fetch('constants'); if (!isset($constants[$name])) { $class = $this->info['name']; throw new ReflectionException("Class constant $class::$name does not exist"); } return $constants[$name]; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionclass.getinterfaces.php ) * * Gets the interfaces. * * @return mixed An associative array of interfaces, with keys as * interface names and the array values as * ReflectionClass objects. */ public function getInterfaces() { $ret = array(); foreach ($this->fetch('interfaces') as $name => $_) { $cls = new ReflectionClass($name); if ($cls->isInterface()) { $ret[$cls->getName()] = $cls; } } return $ret; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionclass.gettraits.php ) * * Warning: This function is currently not documented; only its argument * list is available. * * @return mixed Returns an array with trait names in keys and * instances of trait's ReflectionClass in values. * Returns NULL in case of an error. */ public function getTraits() { $ret = array(); foreach ($this->fetch('traits') as $name => $_) { $cls = new ReflectionClass($name); if ($cls->isTrait()) { $ret[$cls->getName()] = $cls; } } return $ret; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionclass.getinterfacenames.php ) * * Get the interface names. * * @return mixed A numerical array with interface names as the * values. */ public function getInterfaceNames() { $ret = array(); foreach ($this->fetch('interfaces') as $name => $_) { $cls = new ReflectionClass($name); if ($cls->isInterface()) { $ret[] = $cls->getName(); } } return $ret; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionclass.gettraitnames.php ) * * Warning: This function is currently not documented; only its argument * list is available. * * @return mixed Returns an array with trait names in values. Returns * NULL in case of an error. */ public function getTraitNames() { $ret = array(); foreach ($this->fetch('traits') as $name => $_) { $cls = new ReflectionClass($name); if ($cls->isTrait()) { $ret[] = $cls->getName(); } } return $ret; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionclass.gettraitaliases.php ) * * Warning: This function is currently not documented; only its argument * list is available. * * @return mixed Returns an array with new method names in keys and * original names (in the format "TraitName::original") * in values. Returns NULL in case of an error. */ public function getTraitAliases() { $ret = array(); foreach ($this->fetch('trait_aliases') as $old_name => $new_name) { $ret[$old_name] = $new_name; } return $ret; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionclass.isinterface.php * ) * * Checks whether the class is an interface. * * @return mixed Returns TRUE on success or FALSE on failure. */ public function isInterface() { return $this->check('interface'); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionclass.isabstract.php ) * * Checks if the class is abstract. * * @return mixed Returns TRUE on success or FALSE on failure. */ public function isAbstract() { return $this->check('abstract'); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionclass.isfinal.php ) * * Checks if a class is final. * * @return mixed Returns TRUE on success or FALSE on failure. */ public function isFinal() { return $this->check('final'); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionclass.istrait.php ) * * Warning: This function is currently not documented; only its argument * list is available. * * @return mixed Returns TRUE if this is a trait, FALSE otherwise. * Returns NULL in case of an error. */ public function isTrait() { return $this->check('trait'); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionclass.getmodifiers.php * ) * * Returns a bitfield of the access modifiers for this class. * * @return mixed Returns bitmask of modifier constants. */ public function getModifiers() { return $this->fetch('modifiers'); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionclass.isinstance.php ) * * Checks if an object is an instance of a class. * * @obj mixed The object being compared to. * * @return mixed Returns TRUE on success or FALSE on failure. */ public function isInstance($obj) { return hphp_instanceof($obj, $this->name); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionclass.newinstance.php * ) * * Creates a new instance of the class. The given arguments are passed to * the class constructor. * */ public function newInstance() { $args = func_get_args(); return hphp_create_object($this->name, $args); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionclass.newinstanceargs.php ) * * Creates a new instance of the class, the given arguments are passed to * the class constructor. * * @args mixed The parameters to be passed to the class constructor * as an array. * * @return mixed Returns a new instance of the class. */ public function newInstanceArgs($args) { return hphp_create_object($this->name, array_values($args)); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionclass.newinstancewithoutconstructor.php * ) * * Creates a new instance of the class without invoking the constructor. * */ public function newInstanceWithoutConstructor() { return hphp_create_object_without_constructor($this->name); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionclass.getparentclass.php ) * * Warning: This function is currently not documented; only its argument * list is available. * * @return mixed A ReflectionClass. */ public function getParentClass() { $parent = $this->fetch('parent'); if (empty($parent)) { return false; } return new ReflectionClass($parent); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionclass.issubclassof.php * ) * * Checks if the class is a subclass of a specified class or implements a * specified interface. * * @cls mixed The class name being checked against. * * @return mixed Returns TRUE on success or FALSE on failure. */ public function isSubclassOf($cls) { if ($cls instanceof ReflectionClass) { $cls = $cls->name; } foreach ($this->fetch('interfaces') as $name => $_) { if (strcasecmp($cls, $name) == 0) { return true; } } $parent = $this->fetch('parent'); if (empty($parent)) { return false; } if (strcasecmp($cls, $parent) == 0) { return true; } return $this->getParentClass()->isSubclassOf($cls); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionclass.getstaticproperties.php ) * * Get the static properties. Warning: This function is currently not * documented; only its argument list is available. * * @return mixed The static properties, as an array. */ public function getStaticProperties() { $ret = array(); foreach ($this->getProperties() as $prop) { if ($prop->isStatic()) { $ret[$prop->name] = $prop; } } return $ret; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionclass.getstaticpropertyvalue.php ) * * Gets the value of a static property on this class. * * @name mixed The name of the static property for which to return * a value. * @default mixed * * @return mixed The value of the static property. */ public function getStaticPropertyValue($name, $default = null) { if ($this->hasProperty($name) && $this->getProperty($name)->isStatic()) { return hphp_get_static_property($this->name, $name, false); } return $default; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionclass.setstaticpropertyvalue.php ) * * Sets static property value. Warning: This function is currently not * documented; only its argument list is available. * * @name mixed Property name. * @value mixed New property value. * * @return mixed No value is returned. */ public function setStaticPropertyValue($name, $value) { hphp_set_static_property($this->name, $name, $value, false); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionclass.getdefaultproperties.php ) * * Gets default properties from a class (including inherited properties). * * This method only works for static properties when used on internal * classes. The default value of a static class property can not be tracked * when using this method on user defined classes. * * @return mixed An array of default properties, with the key being * the name of the property and the value being the * default value of the property or NULL if the * property doesn't have a default value. The function * does not distinguish between static and non static * properties and does not take visibility modifiers * into account. */ public function getDefaultProperties() { $ret = array(); foreach ($this->getProperties() as $prop) { if ($prop->isDefault()) { $ret[$prop->name] = $prop; } } return $ret; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionclass.isiterateable.php ) * * Checks whether the class is iterateable. * * @return mixed Returns TRUE on success or FALSE on failure. */ public function isIterateable() { return $this->isSubclassOf('ArrayAccess'); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionclass.implementsinterface.php ) * * Checks whether it implements an interface. * * @cls mixed The interface name. * * @return mixed Returns TRUE on success or FALSE on failure. */ public function implementsInterface($cls) { if ($cls instanceof ReflectionClass) { $cls = $cls->name; } if (!interface_exists($cls)) { throw new ReflectionException("$cls is not an Interface"); } foreach ($this->fetch('interfaces') as $name => $_) { if (strcasecmp($cls, $name) == 0) { return true; } } return false; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionclass.getextension.php * ) * * Gets a ReflectionExtension object for the extension which defined the * class. * * @return mixed A ReflectionExtension object representing the * extension which defined the class, or NULL for * user-defined classes. */ public function getExtension() { return $this->fetch('extension'); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionclass.getextensionname.php ) * * Gets the name of the extension which defined the class. * * @return mixed The name of the extension which defined the class, * or FALSE for user-defined classes. */ public function getExtensionName() { return $this->fetch('extension')->getName(); } public function getAttribute($name) { $attrs = $this->fetch('attributes'); return isset($attrs[$name]) ? $attrs[$name] : null; } public function getAttributes() { return $this->fetch('attributes'); } public function getAttributeRecursive($name) { $attrs = $this->fetch('attributes_rec'); return isset($attrs[$name]) ? $attrs[$name] : null; } public function getAttributesRecursive() { return $this->fetch('attributes_rec'); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionclass.innamespace.php * ) * * Checks if this class is defined in a namespace. * * @return mixed Returns TRUE on success or FALSE on failure. */ public function inNamespace() { return strrpos($this->getName(), '\\') !== false; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionclass.getnamespacename.php ) * * Gets the namespace name. Warning: This function is currently not * documented; only its argument list is available. * * @return mixed The namespace name. */ public function getNamespaceName() { $pos = strrpos($this->getName(), '\\'); if ($pos === false) { return ''; } return substr($this->getName(), 0, $pos); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionclass.getshortname.php * ) * * Gets the short name of the class, the part without the namespace. * * @return mixed The class short name. */ public function getShortName() { $pos = strrpos($this->getName(), '\\'); if ($pos === false) { return $this->getName(); } return substr($this->getName(), $pos + 1); } } /////////////////////////////////////////////////////////////////////////////// // object // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/class.reflectionobject.php ) * * The ReflectionObject class reports information about an object. * */ class ReflectionObject extends ReflectionClass { // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionobject.export.php ) * * Exports a reflection. Warning: This function is currently not * documented; only its argument list is available. * * @obj mixed The reflection to export. * @ret mixed Setting to TRUE will return the export, as opposed * to emitting it. Setting to FALSE (the default) will * do the opposite. * * @return mixed If the return parameter is set to TRUE, then the * export is returned as a string, otherwise NULL is * returned. */ public static function export($obj, $ret=false) { $obj = new ReflectionObject($obj); $str = (string)$obj; if ($ret) { return $str; } print $str; } } /////////////////////////////////////////////////////////////////////////////// // property // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/class.reflectionproperty.php ) * * The ReflectionProperty class reports information about classes * properties. * */ class ReflectionProperty implements Reflector { const IS_STATIC = 1; const IS_PUBLIC = 256; const IS_PROTECTED = 512; const IS_PRIVATE = 1024; public $info; public $name; public $class; private $forceAccessible = false; // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionproperty.construct.php * ) * * Warning: This function is currently not documented; only its argument * list is available. * * @cls mixed The class name, that contains the property. * @name mixed The name of the property being reflected. * * @return mixed No value is returned. */ public function __construct($cls, $name) { if ($cls && $name) { if (!is_object($cls)) { $cls = new ReflectionClass($cls); } else { $cls = new ReflectionClass(get_class($cls)); } $prop = $cls->getProperty($name); if ($prop) { $this->info = $prop->info; $this->name = $prop->name; $this->class = $prop->class; } } } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionproperty.tostring.php * ) * * To string. Warning: This function is currently not documented; only its * argument list is available. * */ public function __toString() { return ""; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionproperty.export.php ) * * Exports a reflection. Warning: This function is currently not * documented; only its argument list is available. * * @cls mixed The reflection to export. * @name mixed The property name. * @ret mixed Setting to TRUE will return the export, as opposed * to emitting it. Setting to FALSE (the default) will * do the opposite. */ public static function export($cls, $name, $ret=false) { if (!is_object($cls)) { $cls = new ReflectionClass($cls); } else { $cls = new ReflectionClass(get_class($cls)); } $obj = $cls->getProperty($name); $str = (string)$obj; if ($ret) { return $str; } print $str; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionproperty.getname.php ) * * Gets the properties name. Warning: This function is currently not * documented; only its argument list is available. * * @return mixed The name of the reflected property. */ public function getName() { return $this->info['name']; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionproperty.ispublic.php * ) * * Checks whether the property is public. * * @return mixed TRUE if the property is public, FALSE otherwise. */ public function isPublic() { return $this->info['access'] == 'public'; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionproperty.isprivate.php * ) * * Checks whether the property is private. * * @return mixed TRUE if the property is private, FALSE otherwise. */ public function isPrivate() { return $this->info['access'] == 'private'; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionproperty.isprotected.php ) * * Checks whether the property is protected. * * @return mixed TRUE if the property is protected, FALSE otherwise. */ public function isProtected() { return $this->info['access'] == 'protected'; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionproperty.isstatic.php * ) * * Checks whether the property is static. * * @return mixed TRUE if the property is static, FALSE otherwise. */ public function isStatic() { return isset($this->info['static']); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionproperty.isdefault.php * ) * * Checks whether the property is the default. * * @return mixed TRUE if the property was declared at compile-time, * or FALSE if it was created at run-time. */ public function isDefault() { return $this->info['default']; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionproperty.setaccessible.php ) * * Sets a property to be accessible. For example, it may allow protected * and private properties to be accessed. * * @accessible mixed TRUE to allow accessibility, or FALSE. * * @return mixed No value is returned. */ public function setAccessible($accessible) { $this->forceAccessible = $accessible; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionproperty.getmodifiers.php ) * * Gets the modifiers. Warning: This function is currently not documented; * only its argument list is available. * * @return mixed A numeric representation of the modifiers. */ public function getModifiers() { return $this->info['modifiers']; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionproperty.getvalue.php * ) * * Gets the properties value. * * @obj mixed If the property is non-static an object must be * provided to fetch the property from. If you want to * fetch the default property without providing an * object use ReflectionClass::getDefaultProperties() * instead. * * @return mixed The current value of the property. */ public function getValue($obj = null) { if ($this->isStatic()) { return hphp_get_static_property( $this->info['class'], $this->info['name'], $this->forceAccessible ); } if ($obj) { return hphp_get_property( $obj, $this->forceAccessible ? $this->info['class'] : null, $this->info['name'] ); } return null; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionproperty.setvalue.php * ) * * Sets (changes) the property's value. * * @obj mixed If the property is non-static an object must be * provided to change the property on. If the property * is static this parameter is left out and only value * needs to be provided. * @value mixed The new value. * * @return mixed No value is returned. */ public function setValue($obj, $value) { if ($this->isStatic()) { hphp_set_static_property( $this->info['class'], $this->info['name'], $value, $this->forceAccessible ); } else { hphp_set_property( $obj, $this->forceAccessible ? $this->info['class'] : null, $this->info['name'], $value ); } } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionproperty.getdeclaringclass.php ) * * Gets the declaring class. Warning: This function is currently not * documented; only its argument list is available. * * @return mixed A ReflectionClass object. */ public function getDeclaringClass() { if (empty($this->info['class'])) { return null; } return new ReflectionClass($this->info['class']); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionproperty.getdoccomment.php ) * * Gets the doc comment. Warning: This function is currently not * documented; only its argument list is available. * * @return mixed The doc comment. */ public function getDocComment() { return $this->info['doc']; } public function getTypeText() { if (isset($this->info['type'])) { return $this->info['type']; } return ''; } } /////////////////////////////////////////////////////////////////////////////// // method // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/class.reflectionmethod.php ) * * The ReflectionMethod class reports information about a method. * */ class ReflectionMethod extends ReflectionFunctionAbstract implements Reflector { const IS_STATIC = 1; const IS_PUBLIC = 256; const IS_PROTECTED = 512; const IS_PRIVATE = 1024; const IS_ABSTRACT = 2; const IS_FINAL = 4; public $name; public $class; // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionmethod.construct.php ) * * Constructs a new ReflectionMethod. * * @cls mixed Classname or object (instance of the class) that * contains the method. * @name mixed Name of the method. * * @return mixed No value is returned. */ public function __construct($cls, $name = '') { if (!$name && is_string($cls)) { $arr = explode('::', $cls); if (count($arr) == 2) { $cls = $arr[0]; $name = $arr[1]; } } if ($cls && $name) { $method = hphp_get_method_info($cls, $name); if (!$method) { throw new ReflectionException("Method $cls::$name does not exist"); } $this->info = $method; $this->name = $method['name']; $this->class = $method['class']; } } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionmethod.tostring.php ) * * Returns the string representation of the Reflection method object. * * @return mixed A string representation of this ReflectionMethod * instance. */ public function __toString() { //TODO return ""; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionmethod.export.php ) * * Exports a ReflectionMethod. Warning: This function is currently not * documented; only its argument list is available. * * @cls mixed The class name. * @name mixed The name of the method. * @ret mixed Setting to TRUE will return the export, as opposed * to emitting it. Setting to FALSE (the default) will * do the opposite. * * @return mixed If the return parameter is set to TRUE, then the * export is returned as a string, otherwise NULL is * returned. */ public static function export($cls, $name, $ret=false) { if (!is_object($cls)) { $cls = new ReflectionClass($cls); } else { $cls = new ReflectionClass(get_class($cls)); } $obj = $cls->getMethod($name); $str = (string)$obj; if ($ret) { return $str; } print $str; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionmethod.invoke.php ) * * Invokes a reflected method. * * @obj mixed The object to invoke the method on. For static * methods, pass null to this parameter. * * @return mixed Returns the method result. */ public function invoke($obj) { $args = func_get_args(); array_shift($args); return hphp_invoke_method($obj, $this->info['class'], $this->info['name'], $args); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionmethod.invokeargs.php * ) * * Invokes the reflected method and pass its arguments as array. * * @obj mixed The object to invoke the method on. In case of * static methods, you can pass null to this parameter. * @args mixed The parameters to be passed to the function, as an * array. * * @return mixed Returns the method result. */ public function invokeArgs($obj, $args) { return hphp_invoke_method($obj, $this->info['class'], $this->info['name'], array_values($args)); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionmethod.isfinal.php ) * * Checks if the method is final. * * @return mixed TRUE if the method is final, otherwise FALSE */ public function isFinal() { return isset($this->info['final']); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionmethod.isabstract.php * ) * * Checks if the method is abstract. * * @return mixed TRUE if the method is abstract, otherwise FALSE */ public function isAbstract() { return isset($this->info['abstract']); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionmethod.ispublic.php ) * * Checks if the method is public. * * @return mixed TRUE if the method is public, otherwise FALSE */ public function isPublic() { return $this->info['access'] == "public"; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionmethod.isprivate.php ) * * Checks if the method is private. Warning: This function is currently * not documented; only its argument list is available. * * @return mixed TRUE if the method is private, otherwise FALSE */ public function isPrivate() { return $this->info['access'] == "private"; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionmethod.isprotected.php * ) * * Checks if the method is protected. * * @return mixed TRUE if the method is protected, otherwise FALSE */ public function isProtected() { return $this->info['access'] == "protected"; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionmethod.isstatic.php ) * * Checks if the method is static. * * @return mixed TRUE if the method is static, otherwise FALSE */ public function isStatic() { return isset($this->info['static']); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionmethod.isconstructor.php ) * * Checks if the method is a constructor. * * @return mixed TRUE if the method is a constructor, otherwise FALSE */ public function isConstructor() { return isset($this->info['constructor']); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionmethod.isdestructor.php ) * * Checks if the method is a destructor. * * @return mixed TRUE if the method is a destructor, otherwise FALSE */ public function isDestructor() { return $this->getName() == '__destruct'; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionmethod.getmodifiers.php ) * * Returns a bitfield of the access modifiers for this method. * * @return mixed A numeric representation of the modifiers. The * modifiers are listed below. The actual meanings of * these modifiers are described in the predefined * constants. */ public function getModifiers() { return $this->info['modifiers']; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionmethod.getclosure.php * ) * * Warning: This function is currently not documented; only its argument * list is available. * * @return mixed Returns Closure. Returns NULL in case of an error. */ public function getClosure() { return $this->info['closure']; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionmethod.getdeclaringclass.php ) * * Gets the declaring class for the reflected method. * * @return mixed A ReflectionClass object of the class that the * reflected method is part of. */ public function getDeclaringClass() { if (empty($this->info['class'])) { return null; } return new ReflectionClass($this->info['class']); } public function getAttribute($name) { $attrs = $this->info['attributes']; return isset($attrs[$name]) ? $attrs[$name] : null; } public function getAttributes() { return $this->info['attributes']; } public function getAttributeRecursive($name) { $attrs = $this->info['attributes']; if (isset($attrs[$name])) { return $attrs[$name]; } $p = get_parent_class($this->class); if ($p === false) { return null; } $rm = new ReflectionMethod($p, $this->name); if ($rm->isPrivate()) { return null; } return $rm->getAttributeRecursive($name); } public function getAttributesRecursive() { $attrs = $this->info['attributes']; $p = get_parent_class($this->class); if ($p !== false) { $rm = new ReflectionMethod($p, $this->name); if (!$rm->isPrivate()) { $attrs += $rm->getAttributesRecursive(); } } return $attrs; } } /////////////////////////////////////////////////////////////////////////////// // extension // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/class.reflectionextension.php ) * * The ReflectionExtension class reports information about an extension. * */ class ReflectionExtension implements Reflector { private $name; private $info; // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionextension.construct.php ) * * Construct a ReflectionExtension object. * * @name mixed Name of the extension. * * @return mixed A ReflectionExtension object. */ public function __construct($name) { $this->info = hphp_get_extension_info($name); } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionextension.tostring.php * ) * * Exports a reflected extension and returns it as a string. This is the * same as the ReflectionExtension::export() with the return set to TRUE. * * @return mixed Returns the exported extension as a string, in the * same way as the ReflectionExtension::export(). */ public function __toString() { return ""; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionextension.export.php ) * * Exports a reflected extension. The output format of this function is * the same as the CLI argument --re [extension]. * * @name mixed The reflection to export. * @ret mixed Setting to TRUE will return the export, as opposed * to emitting it. Setting to FALSE (the default) will * do the opposite. * * @return mixed If the return parameter is set to TRUE, then the * export is returned as a string, otherwise NULL is * returned. */ public static function export($name, $ret=false) { $obj = new ReflectionExtension($name); $str = (string)$obj; if ($ret) { return $str; } print $str; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionextension.getname.php * ) * * Gets the extensions name. * * @return mixed The extensions name. */ public function getName() { return $this->info['name']; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionextension.getversion.php ) * * Gets the version of the extension. * * @return mixed The version of the extension. */ public function getVersion() { return $this->info['version']; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionextension.getfunctions.php ) * * Get defined functions from an extension. * * @return mixed An associative array of ReflectionFunction objects, * for each function defined in the extension with the * keys being the function names. If no function are * defined, an empty array is returned. */ public function getFunctions() { return $this->info['functions']; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionextension.getconstants.php ) * * Get defined constants from an extension. * * @return mixed An associative array with constant names as keys. */ public function getConstants() { return $this->info['constants']; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionextension.getinientries.php ) * * Get the ini entries for an extension. * * @return mixed An associative array with the ini entries as keys, * with their defined values as values. */ public function getINIEntries() { return $this->info['ini']; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionextension.getclasses.php ) * * Gets a list of classes from an extension. * * @return mixed An array of ReflectionClass objects, one for each * class within the extension. If no classes are * defined, an empty array is returned. */ public function getClasses() { return $this->info['classes']; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from * http://php.net/manual/en/reflectionextension.getclassnames.php ) * * Gets a listing of class names as defined in the extension. * * @return mixed An array of class names, as defined in the * extension. If no classes are defined, an empty array * is returned. */ public function getClassNames() { $ret = array(); foreach ($this->info['classes'] as $cls) { $ret[] = $cls->getName(); } return $ret; } // This doc comment block generated by idl/sysdoc.php /** * ( excerpt from http://php.net/manual/en/reflectionextension.info.php ) * * Prints out the " phpinfo()" snippet for the given extension. * * @return mixed Information about the extension. */ public function info() { return $this->info['info']; } }