Get rid of ext_hhvm_noinline.cpp, part 2
[hiphop-php.git] / bin / systemlib.php
blob415f177273cb7ba3262d58e09b42a033f7463bc1
1 <?php
2 // @generated
5 // default base
6 class stdClass {
9 // used in unserialize() for unknown classes
10 class __PHP_Incomplete_Class {
11 public $__PHP_Incomplete_Class_Name;
14 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
15 /**
16 * ( excerpt from http://php.net/manual/en/class.exception.php )
18 * Exception is the base class for all Exceptions.
21 class Exception {
22 protected $message = ''; // exception message
23 protected $code = 0; // user defined exception code
24 protected $previous = null;
25 protected $file; // source filename of exception
26 protected $line; // source line of exception
27 protected $trace; // full stacktrace
28 private $inited = false;
30 private static $traceOpts = false;
32 /**
33 * This cannot be implemented in __construct, because a derived class may
34 * implement its own __construct, losing the stacktrace. The runtime has
35 * special logic to call the __init__ method on instances of Exception before
36 * calling __construct just to make sure $this->trace is always populated.
38 final function __init__() {
39 if ($this->inited) {
40 return;
42 $this->initTrace();
43 $this->inited = true;
46 function __construct($message = '', $code = 0, Exception $previous = null) {
47 $this->message = $message;
48 $this->code = $code;
49 $this->previous = $previous;
52 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
53 /**
54 * ( excerpt from http://php.net/manual/en/exception.getmessage.php )
56 * Returns the Exception message.
58 * @return mixed Returns the Exception message as a string.
60 function getMessage() {
61 return $this->message;
64 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
65 /**
66 * ( excerpt from http://php.net/manual/en/exception.getprevious.php )
68 * Returns the previous Exception.
70 * @return mixed Returns the previous Exception if available or NULL otherwise.
72 final function getPrevious() {
73 return $this->previous;
76 final function setPrevious(Exception $previous) {
77 $this->previous = $previous;
80 final function setPreviousChain(Exception $previous) {
81 $cur = $this;
82 $next = $cur->getPrevious();
83 while ($next instanceof Exception) {
84 $cur = $next;
85 $next = $cur->getPrevious;
87 $cur->setPrevious($previous);
90 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
91 /**
92 * ( excerpt from http://php.net/manual/en/exception.getcode.php )
94 * Returns the Exception code.
96 * @return mixed Returns the Exception code as a integer.
98 function getCode() {
99 return $this->code;
102 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
104 * ( excerpt from http://php.net/manual/en/exception.getfile.php )
106 * Get the name of the file the exception was thrown from.
108 * @return mixed Returns the filename in which the exception was
109 * thrown.
111 final function getFile() {
112 return $this->file;
115 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
117 * ( excerpt from http://php.net/manual/en/exception.getline.php )
119 * Returns line number where the exception was thrown.
121 * @return mixed Returns the line number where the exception was
122 * thrown.
124 final function getLine() {
125 return $this->line;
128 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
130 * ( excerpt from http://php.net/manual/en/exception.gettrace.php )
132 * Returns the Exception stack trace.
134 * @return mixed Returns the Exception stack trace as an array.
136 final function getTrace() {
137 return $this->trace;
140 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
142 * ( excerpt from http://php.net/manual/en/exception.gettraceasstring.php )
144 * Returns the Exception stack trace as a string.
146 * @return mixed Returns the Exception stack trace as a string.
148 final function getTraceAsString() {
149 // works with the new FrameInjection-based stacktrace.
150 $i = 0;
151 $s = "";
152 foreach ($this->getTrace() as $frame) {
153 if (!is_array($frame)) continue;
154 $s .= "#$i " .
155 (isset($frame['file']) ? $frame['file'] : "") . "(" .
156 (isset($frame['line']) ? $frame['line'] : "") . "): " .
157 (isset($frame['class']) ? $frame['class'] . $frame['type'] : "") .
158 $frame['function'] . "()\n";
159 $i++;
161 $s .= "#$i {main}";
162 return $s;
165 /* Overrideable */
166 // formated string for display
167 function __toString() {
168 return "exception '" . get_class($this) . "' with message '" .
169 $this->getMessage() . "' in " . $this->getFile() . ":" .
170 $this->getLine() . "\nStack trace:\n" . $this->getTraceAsString();
174 * Derived classes may override the methods below if different behavior
175 * for initializing the trace is desired
177 protected function initTrace() {
178 $this->trace = debug_backtrace(static::getTraceOptions());
179 // Remove top stack frames up to and including Exception::__init__,
180 // set the 'file' and 'line' properties appropriately
181 while (!empty($this->trace)) {
182 $top = array_shift($this->trace);
183 if (isset($top['class']) && isset($top['function']) &&
184 strcasecmp($top['class'], 'exception') === 0 &&
185 strcasecmp($top['function'], '__init__') === 0) {
186 if (isset($top['file'])) $this->file = $top['file'];
187 if (isset($top['line'])) $this->line = $top['line'];
188 return;
193 public static function getTraceOptions() {
194 return self::$traceOpts;
197 public static function setTraceOptions($opts) {
198 self::$traceOpts = $opts;
202 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
204 * ( excerpt from http://php.net/manual/en/class.logicexception.php )
206 * Exception thrown if a logic expression is invalid
209 class LogicException extends Exception {}
210 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
212 * ( excerpt from
213 * http://php.net/manual/en/class.badfunctioncallexception.php )
215 * Exception thrown if a callback refers to an undefined function or if
216 * some arguments are missing
219 class BadFunctionCallException extends LogicException {}
220 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
222 * ( excerpt from http://php.net/manual/en/class.badmethodcallexception.php
225 * Exception thrown if a callback refers to an undefined method or if some
226 * arguments are missing
229 class BadMethodCallException extends BadFunctionCallException {}
230 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
232 * ( excerpt from http://php.net/manual/en/class.domainexception.php )
234 * Exception thrown if a value does not adhere to a defined valid data
235 * domain
238 class DomainException extends LogicException {}
239 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
241 * ( excerpt from
242 * http://php.net/manual/en/class.invalidargumentexception.php )
244 * Exception thrown if an argument does not match with the expected value
247 class InvalidArgumentException extends LogicException {}
248 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
250 * ( excerpt from http://php.net/manual/en/class.lengthexception.php )
252 * Exception thrown if a length is invalid
255 class LengthException extends LogicException {}
256 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
258 * ( excerpt from http://php.net/manual/en/class.outofrangeexception.php )
260 * Exception thrown when a value does not match with a range
263 class OutOfRangeException extends LogicException {}
264 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
266 * ( excerpt from http://php.net/manual/en/class.runtimeexception.php )
268 * Exception thrown if an error which can only be found on runtime occurs
271 class RuntimeException extends Exception {}
272 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
274 * ( excerpt from http://php.net/manual/en/class.outofboundsexception.php )
276 * Exception thrown if a value is not a valid key
279 class OutOfBoundsException extends RuntimeException {}
280 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
282 * ( excerpt from http://php.net/manual/en/class.overflowexception.php )
284 * Exception thrown when you add an element into a full container
287 class OverflowException extends RuntimeException {}
288 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
290 * ( excerpt from http://php.net/manual/en/class.rangeexception.php )
292 * Exception thrown when an invalid range is given.
295 class RangeException extends RuntimeException {}
296 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
298 * ( excerpt from http://php.net/manual/en/class.underflowexception.php )
300 * Exception thrown when you try to remove an element of an empty
301 * container
304 class UnderflowException extends RuntimeException {}
305 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
307 * ( excerpt from
308 * http://php.net/manual/en/class.unexpectedvalueexception.php )
310 * Exception thrown if a value does not match with a set of values
313 class UnexpectedValueException extends RuntimeException {}
315 class InvalidOperationException extends RuntimeException {}
317 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
319 * ( excerpt from http://php.net/manual/en/class.errorexception.php )
321 * An Error Exception.
324 class ErrorException extends Exception {
325 protected $severity;
326 public function __construct($message = "", $code = 0, $severity = 0,
327 $filename = null, $lineno = null) {
328 parent::__construct($message, $code);
329 $this->severity = $severity;
330 if ($filename !== null) {
331 $this->file = $filename;
333 if ($lineno !== null) {
334 $this->line = $lineno;
338 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
340 * ( excerpt from http://php.net/manual/en/errorexception.getseverity.php )
342 * Returns the severity of the exception.
344 * @return mixed Returns the severity level of the exception.
346 final public function getSeverity() { return $this->severity; }
349 class DOMException extends Exception {
350 public function __construct($message, $code) {
351 parent::__construct($message, $code);
355 class PDOException extends Exception {
356 public function __construct() {
361 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
363 * ( excerpt from http://php.net/manual/en/class.arrayaccess.php )
365 * Interface to provide accessing objects as arrays.
368 interface ArrayAccess {
369 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
371 * ( excerpt from http://php.net/manual/en/arrayaccess.offsetexists.php )
373 * Whether or not an offset exists.
375 * This method is executed when using isset() or empty() on objects
376 * implementing ArrayAccess.
378 * When using empty() ArrayAccess::offsetGet() will be called and checked
379 * if empty only if ArrayAccess::offsetExists() returns TRUE.
381 * @index mixed An offset to check for.
383 * @return mixed Returns TRUE on success or FALSE on failure.
385 * The return value will be casted to boolean if
386 * non-boolean was returned.
388 public function offsetExists($index);
389 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
391 * ( excerpt from http://php.net/manual/en/arrayaccess.offsetget.php )
393 * Returns the value at specified offset.
395 * This method is executed when checking if offset is empty().
397 * @index mixed The offset to retrieve.
399 * @return mixed Can return all value types.
401 public function offsetGet($index);
402 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
404 * ( excerpt from http://php.net/manual/en/arrayaccess.offsetset.php )
406 * Assigns a value to the specified offset.
408 * @index mixed The offset to assign the value to.
409 * @newvalue mixed The value to set.
411 * @return mixed No value is returned.
413 public function offsetSet($index, $newvalue);
414 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
416 * ( excerpt from http://php.net/manual/en/arrayaccess.offsetunset.php )
418 * Unsets an offset.
420 * This method will not be called when type-casting to (unset)
422 * @index mixed The offset to unset.
424 * @return mixed No value is returned.
426 public function offsetUnset($index);
429 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
431 * ( excerpt from http://php.net/manual/en/class.countable.php )
433 * Classes implementing Countable can be used with the count() function.
436 interface Countable {
437 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
439 * ( excerpt from http://php.net/manual/en/countable.count.php )
441 * This method is executed when using the count() function on an object
442 * implementing Countable.
444 * @return mixed The custom count as an integer.
446 * The return value is cast to an integer.
448 public function count();
451 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
453 * ( excerpt from http://php.net/manual/en/class.serializable.php )
455 * Interface for customized serializing.
457 * Classes that implement this interface no longer support __sleep() and
458 * __wakeup(). The method serialize is called whenever an instance needs to
459 * be serialized. This does not invoke __destruct() or has any other side
460 * effect unless programmed inside the method. When the data is
461 * unserialized the class is known and the appropriate unserialize() method
462 * is called as a constructor instead of calling __construct(). If you need
463 * to execute the standard constructor you may do so in the method.
466 interface Serializable {
467 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
469 * ( excerpt from http://php.net/manual/en/serializable.serialize.php )
471 * Should return the string representation of the object.
473 * This method acts as the destructor of the object. The __destruct()
474 * method will not be called after this method.
476 * @return mixed Returns the string representation of the object or
477 * NULL
479 public function serialize();
480 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
482 * ( excerpt from http://php.net/manual/en/serializable.unserialize.php )
484 * Called during unserialization of the object.
486 * This method acts as the constructor of the object. The __construct()
487 * method will not be called after this method.
489 * @serialized mixed The string representation of the object.
491 * @return mixed Returns the original value unserialized.
493 public function unserialize($serialized);
496 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
498 * ( excerpt from http://php.net/manual/en/class.jsonserializable.php )
501 interface JsonSerializable {
502 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
504 * ( excerpt from http://php.net/manual/en/jsonserializable.jsonserialize.php )
506 * Specify data which should be serialized to JSON
509 public function jsonSerialize();
512 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
514 * ( excerpt from http://php.net/manual/en/class.traversable.php )
516 * Interface to detect if a class is traversable using foreach.
518 * Abstract base interface that cannot be implemented alone. Instead it
519 * must be implemented by either IteratorAggregate or Iterator.
521 * Internal (built-in) classes that implement this interface can be used
522 * in a foreach construct and do not need to implement IteratorAggregate or
523 * Iterator.
525 * This is an internal engine interface which cannot be implemented in PHP
526 * scripts. Either IteratorAggregate or Iterator must be used instead.
529 interface Traversable {
532 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
534 * ( excerpt from http://php.net/manual/en/class.iterator.php )
536 * Interface for external iterators or objects that can be iterated
537 * themselves internally.
540 interface Iterator extends Traversable {
541 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
543 * ( excerpt from http://php.net/manual/en/iterator.current.php )
545 * Returns the current element.
547 * @return mixed Can return any type.
549 public function current();
550 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
552 * ( excerpt from http://php.net/manual/en/iterator.key.php )
554 * Returns the key of the current element.
556 * @return mixed Returns scalar on success, or NULL on failure.
558 public function key();
559 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
561 * ( excerpt from http://php.net/manual/en/iterator.next.php )
563 * Moves the current position to the next element.
565 * This method is called after each foreach loop.
567 * @return mixed Any returned value is ignored.
569 public function next();
570 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
572 * ( excerpt from http://php.net/manual/en/iterator.rewind.php )
574 * Rewinds back to the first element of the Iterator.
576 * This is the first method called when starting a foreach loop. It will
577 * not be executed after foreach loops.
579 * @return mixed Any returned value is ignored.
581 public function rewind();
582 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
584 * ( excerpt from http://php.net/manual/en/iterator.valid.php )
586 * This method is called after Iterator::rewind() and Iterator::next() to
587 * check if the current position is valid.
589 * @return mixed The return value will be casted to boolean and then
590 * evaluated. Returns TRUE on success or FALSE on
591 * failure.
593 public function valid();
596 interface KeyedIterator extends Iterator {
599 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
601 * ( excerpt from http://php.net/manual/en/class.seekableiterator.php )
603 * The Seekable iterator.
606 interface SeekableIterator extends Iterator {
607 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
609 * ( excerpt from http://php.net/manual/en/seekableiterator.seek.php )
611 * Seeks to a given position in the iterator.
613 * @position mixed The position to seek to.
615 * @return mixed No value is returned.
617 public function seek($position);
620 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
622 * ( excerpt from http://php.net/manual/en/class.outeriterator.php )
624 * Classes implementing OuterIterator can be used to iterate over
625 * iterators.
628 interface OuterIterator extends Iterator {
629 public function getInnerIterator();
632 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
634 * ( excerpt from http://php.net/manual/en/class.recursiveiterator.php )
636 * Classes implementing RecursiveIterator can be used to iterate over
637 * iterators recursively.
640 interface RecursiveIterator extends Iterator {
641 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
643 * ( excerpt from
644 * http://php.net/manual/en/recursiveiterator.getchildren.php )
646 * Returns an iterator for the current iterator entry.
648 * @return mixed An iterator for the current entry.
650 public function getChildren();
651 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
653 * ( excerpt from
654 * http://php.net/manual/en/recursiveiterator.haschildren.php )
656 * Returns if an iterator can be created fot the current entry.
657 * RecursiveIterator::getChildren().
659 * @return mixed Returns TRUE if the current entry can be iterated
660 * over, otherwise returns FALSE.
662 public function hasChildren();
665 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
667 * ( excerpt from
668 * http://php.net/manual/en/class.recursiveiteratoriterator.php )
670 * Can be used to iterate through recursive iterators.
673 class RecursiveIteratorIterator implements OuterIterator, Traversable {
675 private $rsrc;
677 const LEAVES_ONLY = 0;
678 const SELF_FIRST = 1;
679 const CHILD_FIRST = 2;
680 const CATCH_GET_CHILD = 16;
682 public function __construct($iterator,
683 $mode = RecursiveIteratorIterator::LEAVES_ONLY,
684 $flags = 0) {
685 hphp_recursiveiteratoriterator___construct($this, $iterator, $mode, $flags);
687 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
689 * ( excerpt from
690 * http://php.net/manual/en/recursiveiteratoriterator.getinneriterator.php
693 * Gets the current active sub iterator. WarningThis function is currently
694 * not documented; only its argument list is available.
696 * @return mixed The current active sub iterator.
698 public function getInnerIterator() {
699 return hphp_recursiveiteratoriterator_getinneriterator($this);
701 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
703 * ( excerpt from
704 * http://php.net/manual/en/recursiveiteratoriterator.current.php )
707 * @return mixed The current elements value.
709 public function current() {
710 return hphp_recursiveiteratoriterator_current($this);
712 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
714 * ( excerpt from
715 * http://php.net/manual/en/recursiveiteratoriterator.key.php )
718 * @return mixed The current key.
720 public function key() {
721 return hphp_recursiveiteratoriterator_key($this);
723 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
725 * ( excerpt from
726 * http://php.net/manual/en/recursiveiteratoriterator.next.php )
729 * @return mixed No value is returned.
731 public function next() {
732 hphp_recursiveiteratoriterator_next($this);
734 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
736 * ( excerpt from
737 * http://php.net/manual/en/recursiveiteratoriterator.rewind.php )
740 * @return mixed No value is returned.
742 public function rewind() {
743 hphp_recursiveiteratoriterator_rewind($this);
745 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
747 * ( excerpt from
748 * http://php.net/manual/en/recursiveiteratoriterator.valid.php )
751 * @return mixed TRUE if the current position is valid, otherwise
752 * FALSE
754 public function valid() {
755 return hphp_recursiveiteratoriterator_valid($this);
759 ///////////////////////////////////////////////////////////////////////////////
761 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
763 * ( excerpt from http://php.net/manual/en/class.arrayiterator.php )
765 * This iterator allows to unset and modify values and keys while
766 * iterating over Arrays and Objects.
768 * When you want to iterate over the same array multiple times you need to
769 * instantiate ArrayObject and let it create ArrayIterator instances that
770 * refer to it either by using foreach or by calling its getIterator()
771 * method manually.
774 class ArrayIterator implements ArrayAccess, SeekableIterator, Countable {
775 protected $arr;
776 protected $flags;
778 const STD_PROP_LIST = 1;
779 const ARRAY_AS_PROPS = 2;
781 public function __construct($array, $flags = 0) {
782 $this->arr = $array;
783 $this->flags = $flags;
784 reset($this->arr);
787 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
789 * ( excerpt from http://php.net/manual/en/arrayiterator.append.php )
791 * Appends value as the last element. WarningThis function is currently
792 * not documented; only its argument list is available.
794 * @value mixed The value to append.
796 * @return mixed No value is returned.
798 public function append($value) {
799 $this->arr[] = $value;
802 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
804 * ( excerpt from http://php.net/manual/en/arrayiterator.asort.php )
806 * Sorts an array by values. WarningThis function is currently not
807 * documented; only its argument list is available.
809 * @return mixed No value is returned.
811 public function asort() {
812 return asort($this->arr, $this->flags);
815 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
817 * ( excerpt from http://php.net/manual/en/arrayiterator.count.php )
819 * Gets the number of elements in the array, or the number of public
820 * properties in the object. WarningThis function is currently not
821 * documented; only its argument list is available.
823 * @return mixed The number.
825 public function count() {
826 return count($this->arr);
829 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
831 * ( excerpt from http://php.net/manual/en/arrayiterator.current.php )
833 * Get the current array entry.
835 * @return mixed The current array entry.
837 public function current() {
838 return current($this->arr);
841 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
843 * ( excerpt from http://php.net/manual/en/arrayiterator.getarraycopy.php )
845 * Get a copy of an array. WarningThis function is currently not
846 * documented; only its argument list is available.
848 * @return mixed A copy of the array, or array of public properties
849 * if ArrayIterator refers to an object.
851 public function getArrayCopy() {
852 return $this->arr;
855 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
857 * ( excerpt from http://php.net/manual/en/arrayiterator.getflags.php )
859 * Get the current flags. WarningThis function is currently not
860 * documented; only its argument list is available.
862 * @return mixed The current flags.
864 public function getFlags() {
865 return $this->flags;
868 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
870 * ( excerpt from http://php.net/manual/en/arrayiterator.key.php )
872 * This function returns the current array key
874 * @return mixed The current array key.
876 public function key() {
877 return key($this->arr);
880 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
882 * ( excerpt from http://php.net/manual/en/arrayiterator.ksort.php )
884 * Sorts an array by the keys. WarningThis function is currently not
885 * documented; only its argument list is available.
887 * @return mixed No value is returned.
889 public function ksort() {
890 return ksort($this->arr, $this->flags);
893 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
895 * ( excerpt from http://php.net/manual/en/arrayiterator.natcasesort.php )
897 * Sort the entries by values using a case insensitive "natural order"
898 * algorithm. WarningThis function is currently not documented; only its
899 * argument list is available.
901 * @return mixed No value is returned.
903 public function natcasesort() {
904 return natcasesort($this->arr);
907 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
909 * ( excerpt from http://php.net/manual/en/arrayiterator.natsort.php )
911 * Sort the entries by values using "natural order" algorithm. WarningThis
912 * function is currently not documented; only its argument list is
913 * available.
915 * @return mixed No value is returned.
917 public function natsort() {
918 return natsort($this->arr);
921 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
923 * ( excerpt from http://php.net/manual/en/arrayiterator.next.php )
925 * The iterator to the next entry.
927 * @return mixed No value is returned.
929 public function next() {
930 next($this->arr);
933 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
935 * ( excerpt from http://php.net/manual/en/arrayiterator.offsetexists.php )
937 * Checks if the offset exists. WarningThis function is currently not
938 * documented; only its argument list is available.
940 * @index mixed The offset being checked.
942 * @return mixed TRUE if the offset exists, otherwise FALSE
944 public function offsetExists($index) {
945 return isset($this->arr[$index]);
948 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
950 * ( excerpt from http://php.net/manual/en/arrayiterator.offsetget.php )
952 * Gets the value from the provided offset. WarningThis function is
953 * currently not documented; only its argument list is available.
955 * @index mixed The offset to get the value from.
957 * @return mixed The value at offset index.
959 public function offsetGet($index) {
960 return $this->arr[$index];
963 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
965 * ( excerpt from http://php.net/manual/en/arrayiterator.offsetset.php )
967 * Sets a value for a given offset. WarningThis function is currently not
968 * documented; only its argument list is available.
970 * @index mixed The index to set for.
971 * @newval mixed The new value to store at the index.
973 * @return mixed No value is returned.
975 public function offsetSet($index, $newval) {
976 $this->arr[$index] = $newval;
979 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
981 * ( excerpt from http://php.net/manual/en/arrayiterator.offsetunset.php )
983 * Unsets a value for an offset. WarningThis function is currently not
984 * documented; only its argument list is available.
986 * @index mixed The offset to unset.
988 * @return mixed No value is returned.
990 public function offsetUnset($index) {
991 unset($this->arr[$index]);
994 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
996 * ( excerpt from http://php.net/manual/en/arrayiterator.rewind.php )
998 * This rewinds the iterator to the beginning.
1000 * @return mixed No value is returned.
1002 public function rewind() {
1003 reset($this->arr);
1006 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1008 * ( excerpt from http://php.net/manual/en/arrayiterator.seek.php )
1011 * @position mixed The position to seek to.
1013 * @return mixed No value is returned.
1015 public function seek($position) {
1016 reset($this->arr);
1017 for ($i = 0; $i < $position; $i++) {
1018 if (!next($this->arr)) {
1019 break;
1024 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1026 * ( excerpt from http://php.net/manual/en/arrayiterator.setflags.php )
1028 * Sets behaviour flags. WarningThis function is currently not documented;
1029 * only its argument list is available.
1031 * @flags mixed A bitmask as follows: 0 = Properties of the object
1032 * have their normal functionality when accessed as
1033 * list (var_dump, foreach, etc.). 1 = Array indices
1034 * can be accessed as properties in read/write.
1036 * @return mixed No value is returned.
1038 public function setFlags($flags) {
1039 $this->flags = $flags;
1042 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1044 * ( excerpt from http://php.net/manual/en/arrayiterator.uasort.php )
1046 * Sort the entries by values using user defined function. WarningThis
1047 * function is currently not documented; only its argument list is
1048 * available.
1050 * @cmp_function
1051 * mixed The compare function used for the sort.
1053 * @return mixed No value is returned.
1055 public function uasort($cmp_function) {
1056 return uasort($this->arr, $cmp_function);
1059 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1061 * ( excerpt from http://php.net/manual/en/arrayiterator.uksort.php )
1063 * Sort the entries by key using user defined function. WarningThis
1064 * function is currently not documented; only its argument list is
1065 * available.
1067 * @cmp_function
1068 * mixed The compare function used for the sort.
1070 * @return mixed No value is returned.
1072 public function uksort($cmp_function) {
1073 return uksort($this->arr, $cmp_function);
1076 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1078 * ( excerpt from http://php.net/manual/en/arrayiterator.valid.php )
1080 * Checks if the array contains any more entries.
1082 * @return mixed No value is returned.
1084 public function valid() {
1085 return key($this->arr) !== null;
1089 // http://www.php.net/~helly/php/ext/spl/iteratoriterator_8inc-source.html
1090 class IteratorIterator implements OuterIterator {
1091 private $iterator;
1093 public function __construct(Traversable $iterator) {
1094 if ($iterator instanceof IteratorAggregate) {
1095 $iterator = $iterator->getIterator();
1097 if ($iterator instanceof Iterator) {
1098 $this->iterator = $iterator;
1099 } else {
1100 throw new Exception(
1101 "Need to pass a Traversable that is convertable to an iterator");
1105 public function getInnerIterator() {
1106 return $this->iterator;
1109 public function valid() {
1110 return $this->iterator->valid();
1113 public function key() {
1114 return $this->iterator->key();
1117 public function current() {
1118 return $this->iterator->current();
1121 public function next() {
1122 return $this->iterator->next();
1125 public function rewind() {
1126 return $this->iterator->rewind();
1129 public function __call($func, $params) {
1130 return call_user_func_array(array($this->iterator, $func), $params);
1134 // http://www.php.net/~helly/php/ext/spl/filteriterator_8inc-source.html
1135 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1137 * ( excerpt from http://php.net/manual/en/class.filteriterator.php )
1139 * This abstract iterator filters out unwanted values. This class should
1140 * be extended to implement custom iterator filters. The
1141 * FilterIterator::accept() must be implemented in the subclass.
1144 abstract class FilterIterator extends IteratorIterator {
1145 private $it;
1147 public function __construct(Iterator $it) {
1148 $this->it = $it;
1151 public function rewind() {
1152 $this->it->rewind();
1153 $this->fetch();
1156 abstract function accept();
1158 private function fetch() {
1159 while ($this->it->valid()) {
1160 if ($this->accept()) {
1161 return;
1163 $this->it->next();
1167 public function next() {
1168 $this->it->next();
1169 $this->fetch();
1172 public function valid() {
1173 return $this->it->valid();
1176 public function key() {
1177 return $this->it->key();
1180 public function current() {
1181 return $this->it->current();
1184 protected function __clone() {
1185 // disallow clone
1188 public function getInnerIterator() {
1189 return $this->it;
1192 public function __call($func, $params) {
1193 return call_user_func_array(array($this->it, $func), $params);
1197 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1199 * ( excerpt from http://php.net/manual/en/class.iteratoraggregate.php )
1201 * Interface to create an external Iterator.
1204 interface IteratorAggregate extends Traversable {
1205 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1207 * ( excerpt from
1208 * http://php.net/manual/en/iteratoraggregate.getiterator.php )
1210 * Returns an external iterator.
1212 * @return mixed An instance of an object implementing Iterator or
1213 * Traversable
1215 public function getIterator();
1218 interface Iterable extends IteratorAggregate {
1221 interface KeyedIterable extends Iterable {
1224 ///////////////////////////////////////////////////////////////////////////////
1225 // http://www.php.net/~helly/php/ext/spl/appenditerator_8inc-source.html
1227 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1229 * ( excerpt from http://php.net/manual/en/class.appenditerator.php )
1231 * An Iterator that iterates over several iterators one after the other.
1234 class AppendIterator implements OuterIterator {
1235 private $iterators;
1237 function __construct() {
1238 $this->iterators = new ArrayIterator(array());
1241 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1243 * ( excerpt from http://php.net/manual/en/appenditerator.append.php )
1245 * Appends an iterator. WarningThis function is currently not documented;
1246 * only its argument list is available.
1248 * @it mixed The iterator to append.
1250 * @return mixed No value is returned.
1252 function append(Iterator $it) {
1253 $this->iterators->append($it);
1256 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1258 * ( excerpt from
1259 * http://php.net/manual/en/appenditerator.getinneriterator.php )
1261 * Get an inner iterator WarningThis function is currently not documented;
1262 * only its argument list is available.
1264 * @return mixed The current inner Iterator.
1266 function getInnerIterator() {
1267 return $this->iterators->current();
1270 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1272 * ( excerpt from http://php.net/manual/en/appenditerator.rewind.php )
1274 * Rewind to the first element of the first inner Iterator. WarningThis
1275 * function is currently not documented; only its argument list is
1276 * available.
1278 * @return mixed No value is returned.
1280 function rewind() {
1281 $this->iterators->rewind();
1282 if ($this->iterators->valid()) {
1283 $this->getInnerIterator()->rewind();
1287 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1289 * ( excerpt from http://php.net/manual/en/appenditerator.valid.php )
1291 * Checks validity of the current element. WarningThis function is
1292 * currently not documented; only its argument list is available.
1294 * @return mixed Returns TRUE on success or FALSE on failure.
1296 function valid() {
1297 return $this->iterators->valid() && $this->getInnerIterator()->valid();
1300 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1302 * ( excerpt from http://php.net/manual/en/appenditerator.current.php )
1304 * Gets the current value. WarningThis function is currently not
1305 * documented; only its argument list is available.
1307 * @return mixed The current value if it is valid or NULL otherwise.
1309 function current() {
1310 /* Using $this->valid() would be exactly the same; it would omit
1311 * the access to a non valid element in the inner iterator. Since
1312 * the user didn't respect the valid() return value false this
1313 * must be intended hence we go on. */
1314 return $this->iterators->valid() ?
1315 $this->getInnerIterator()->current() : NULL;
1318 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1320 * ( excerpt from http://php.net/manual/en/appenditerator.key.php )
1322 * Get the current key WarningThis function is currently not documented;
1323 * only its argument list is available.
1325 * @return mixed The current key if it is valid or NULL otherwise.
1327 function key() {
1328 return $this->iterators->valid() ? $this->getInnerIterator()->key() : NULL;
1331 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1333 * ( excerpt from http://php.net/manual/en/appenditerator.next.php )
1335 * Moves to the next element. If this means to another Iterator then it
1336 * rewinds that Iterator. WarningThis function is currently not documented;
1337 * only its argument list is available.
1339 * @return mixed No value is returned.
1341 function next() {
1342 if (!$this->iterators->valid()){
1343 return; /* done all */
1345 $this->getInnerIterator()->next();
1346 if ($this->getInnerIterator()->valid()) {
1347 return; /* found valid element in current inner iterator */
1349 $this->iterators->next();
1350 while ($this->iterators->valid()) {
1351 $this->getInnerIterator()->rewind();
1352 if ($this->getInnerIterator()->valid()) {
1353 return; /* found element as first elemet in another iterator */
1355 $this->iterators->next();
1359 function __call($func, $params) {
1360 return call_user_func_array(array($this->getInnerIterator(), $func),
1361 $params);
1366 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1368 * ( excerpt from http://php.net/manual/en/class.splfileinfo.php )
1370 * The SplFileInfo class offers a high-level object oriented interface to
1371 * information for an individual file.
1374 class SplFileInfo {
1375 private $rsrc;
1377 public function __construct($file_name) {
1378 hphp_splfileinfo___construct($this, $file_name);
1381 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1383 * ( excerpt from http://php.net/manual/en/splfileinfo.getpath.php )
1385 * Returns the path to the file, omitting the filename and any trailing
1386 * slash.
1388 * @return mixed Returns the path to the file.
1390 public function getPath() {
1391 return hphp_splfileinfo_getpath($this);
1394 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1396 * ( excerpt from http://php.net/manual/en/splfileinfo.getfilename.php )
1398 * Gets the filename without any path information.
1400 * @return mixed The filename.
1402 public function getFilename() {
1403 return hphp_splfileinfo_getfilename($this);
1406 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1408 * ( excerpt from http://php.net/manual/en/splfileinfo.getfileinfo.php )
1410 * This method gets an SplFileInfo object for the referenced file.
1412 * @class_name mixed Name of an SplFileInfo derived class to use.
1414 * @return mixed An SplFileInfo object created for the file.
1416 public function getFileInfo($class_name = "") {
1417 return hphp_splfileinfo_getfileinfo($this, $class_name);
1420 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1422 * ( excerpt from http://php.net/manual/en/splfileinfo.getbasename.php )
1424 * This method returns the base name of the file, directory, or link
1425 * without path info.
1427 * @suffix mixed Optional suffix to omit from the base name returned.
1429 * @return mixed Returns the base name without path information.
1431 public function getBasename($suffix = "") {
1432 return hphp_splfileinfo_getbasename($this, $suffix);
1435 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1437 * ( excerpt from http://php.net/manual/en/splfileinfo.getpathname.php )
1439 * Returns the path to the file.
1441 * @return mixed The path to the file.
1443 public function getPathname() {
1444 return hphp_splfileinfo_getpathname($this);
1447 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1449 * ( excerpt from http://php.net/manual/en/splfileinfo.getpathinfo.php )
1451 * Gets an SplFileInfo object for the parent of the current file.
1453 * @class_name mixed Name of an SplFileInfo derived class to use.
1455 * @return mixed Returns an SplFileInfo object for the parent path of
1456 * the file.
1458 public function getPathInfo($class_name = "") {
1459 return hphp_splfileinfo_getpathinfo($this, $class_name);
1462 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1464 * ( excerpt from http://php.net/manual/en/splfileinfo.getperms.php )
1466 * Gets the file permissions for the file.
1468 * @return mixed Returns the file permissions.
1470 public function getPerms() {
1471 return hphp_splfileinfo_getperms($this);
1474 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1476 * ( excerpt from http://php.net/manual/en/splfileinfo.getinode.php )
1478 * Gets the inode number for the filesystem object.
1480 * @return mixed Returns the inode number for the filesystem object.
1482 public function getInode() {
1483 return hphp_splfileinfo_getinode($this);
1486 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1488 * ( excerpt from http://php.net/manual/en/splfileinfo.getsize.php )
1490 * Returns the filesize in bytes for the file referenced.
1492 * @return mixed The filesize in bytes.
1494 public function getSize() {
1495 return hphp_splfileinfo_getsize($this);
1498 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1500 * ( excerpt from http://php.net/manual/en/splfileinfo.getowner.php )
1502 * Gets the file owner. The owner ID is returned in numerical format.
1504 * @return mixed The owner id in numerical format.
1506 public function getOwner() {
1507 return hphp_splfileinfo_getowner($this);
1510 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1512 * ( excerpt from http://php.net/manual/en/splfileinfo.getgroup.php )
1514 * Gets the file group. The group ID is returned in numerical format.
1516 * @return mixed The group id in numerical format.
1518 public function getGroup() {
1519 return hphp_splfileinfo_getgroup($this);
1522 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1524 * ( excerpt from http://php.net/manual/en/splfileinfo.getatime.php )
1526 * Gets the last access time for the file.
1528 * @return mixed Returns the time the file was last accessed.
1530 public function getATime() {
1531 return hphp_splfileinfo_getatime($this);
1534 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1536 * ( excerpt from http://php.net/manual/en/splfileinfo.getmtime.php )
1538 * Returns the time when the contents of the file were changed. The time
1539 * returned is a Unix timestamp.
1541 * @return mixed Returns the last modified time for the file, in a
1542 * Unix timestamp.
1544 public function getMTime() {
1545 return hphp_splfileinfo_getmtime($this);
1548 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1550 * ( excerpt from http://php.net/manual/en/splfileinfo.getctime.php )
1552 * Returns the inode change time for the file. The time returned is a Unix
1553 * timestamp.
1555 * @return mixed The last change time, in a Unix timestamp.
1557 public function getCTime() {
1558 return hphp_splfileinfo_getctime($this);
1561 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1563 * ( excerpt from http://php.net/manual/en/splfileinfo.gettype.php )
1565 * Returns the type of the file referenced.
1567 * @return mixed A string representing the type of the entry. May be
1568 * one of file, link, or dir
1570 public function getType() {
1571 return hphp_splfileinfo_gettype($this);
1574 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1576 * ( excerpt from http://php.net/manual/en/splfileinfo.iswritable.php )
1578 * Checks if the current entry is writable.
1580 * @return mixed Returns TRUE if writable, FALSE otherwise;
1582 public function isWritable() {
1583 return hphp_splfileinfo_iswritable($this);
1586 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1588 * ( excerpt from http://php.net/manual/en/splfileinfo.isreadable.php )
1590 * Check if the file is readable.
1592 * @return mixed Returns TRUE if readable, FALSE otherwise.
1594 public function isReadable() {
1595 return hphp_splfileinfo_isreadable($this);
1598 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1600 * ( excerpt from http://php.net/manual/en/splfileinfo.isexecutable.php )
1602 * Checks if the file is executable.
1604 * @return mixed Returns TRUE if executable, FALSE otherwise.
1606 public function isExecutable() {
1607 return hphp_splfileinfo_isexecutable($this);
1610 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1612 * ( excerpt from http://php.net/manual/en/splfileinfo.isfile.php )
1614 * Checks if the file referenced by this SplFileInfo object exists and is
1615 * a regular file.
1617 * @return mixed Returns TRUE if the file exists and is a regular
1618 * file (not a link), FALSE otherwise.
1620 public function isFile() {
1621 return hphp_splfileinfo_isfile($this);
1624 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1626 * ( excerpt from http://php.net/manual/en/splfileinfo.isdir.php )
1628 * This method can be used to determine if the file is a directory.
1630 * @return mixed Returns TRUE if a directory, FALSE otherwise.
1632 public function isDir() {
1633 return hphp_splfileinfo_isdir($this);
1636 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1638 * ( excerpt from http://php.net/manual/en/splfileinfo.islink.php )
1640 * Use this method to check if the file referenced by the SplFileInfo
1641 * object is a link.
1643 * @return mixed Returns TRUE if the file is a link, FALSE otherwise.
1645 public function isLink() {
1646 return hphp_splfileinfo_islink($this);
1649 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1651 * ( excerpt from http://php.net/manual/en/splfileinfo.getlinktarget.php )
1653 * Gets the target of a filesystem link.
1655 * The target may not be the real path on the filesystem. Use
1656 * SplFileInfo::getRealPath() to determine the true path on the filesystem.
1658 * @return mixed Returns the target of the filesystem link.
1660 public function getLinkTarget() {
1661 return hphp_splfileinfo_getlinktarget($this);
1664 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1666 * ( excerpt from http://php.net/manual/en/splfileinfo.getrealpath.php )
1668 * This method expands all symbolic links, resolves relative references
1669 * and returns the real path to the file.
1671 * @return mixed Returns the path to the file.
1673 public function getRealPath() {
1674 return hphp_splfileinfo_getrealpath($this);
1677 public function __toString() {
1678 return hphp_splfileinfo___tostring($this);
1681 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1683 * ( excerpt from http://php.net/manual/en/splfileinfo.openfile.php )
1685 * Creates an SplFileObject object of the file. This is useful because
1686 * SplFileObject contains additional methods for manipulating the file
1687 * whereas SplFileInfo is only useful for gaining information, like whether
1688 * the file is writable.
1690 * @mode mixed The mode for opening the file. See the fopen()
1691 * documentation for descriptions of possible modes.
1692 * The default is read only.
1693 * @use_include_path
1694 * mixed When set to TRUE, the filename is also searched for
1695 * within the include_path
1696 * @context mixed Refer to the context section of the manual for a
1697 * description of contexts.
1699 * @return mixed The opened file as an SplFileObject object.
1701 public function openFile($mode = 'r', $use_include_path = false,
1702 $context = null) {
1703 return hphp_splfileinfo_openfile($this, $mode,
1704 $use_include_path, $context);
1707 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1709 * ( excerpt from http://php.net/manual/en/splfileinfo.setfileclass.php )
1711 * Set the class name which SplFileInfo will use to open files with when
1712 * openFile() is called. The class name passed to this method must be
1713 * derived from SplFileObject.
1715 * @class_name mixed The class name to use when openFile() is called.
1717 * @return mixed No value is returned.
1719 public function setFileClass($class_name = "SplFileObject") {
1720 hphp_splfileinfo_setfileclass($this, $class_name);
1723 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1725 * ( excerpt from http://php.net/manual/en/splfileinfo.setinfoclass.php )
1727 * Use this method to set a custom class which will be used when
1728 * getFileInfo and getPathInfo are called. The class name passed to this
1729 * method must be derived from SplFileInfo.
1731 * @class_name mixed The class name to use.
1733 * @return mixed No value is returned.
1735 public function setInfoClass($class_name = "SplFileInfo") {
1736 hphp_splfileinfo_setinfoclass($this, $class_name);
1740 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1742 * ( excerpt from http://php.net/manual/en/class.splfileobject.php )
1744 * The SplFileObject class offers an object oriented interface for a file.
1747 class SplFileObject extends SplFileInfo implements RecursiveIterator,
1748 Traversable, SeekableIterator {
1750 const DROP_NEW_LINE = 1;
1751 const READ_AHEAD = 2;
1752 const SKIP_EMPTY = 6;
1753 const READ_CSV = 8;
1755 public function __construct($filename, $open_mode = 'r',
1756 $use_include_path = false,
1757 $context = null) {
1758 hphp_splfileobject___construct($this, $filename, $open_mode,
1759 $use_include_path, $context);
1762 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1764 * ( excerpt from http://php.net/manual/en/splfileobject.current.php )
1766 * Retrieves the current line of the file.
1768 * @return mixed Retrieves the current line of the file. If the
1769 * SplFileObject::READ_CSV flag is set, this method
1770 * returns an array containing the current line parsed
1771 * as CSV data.
1773 public function current() {
1774 return hphp_splfileobject_current($this);
1777 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1779 * ( excerpt from http://php.net/manual/en/splfileobject.eof.php )
1781 * Determine whether the end of file has been reached
1783 * @return mixed Returns TRUE if file is at EOF, FALSE otherwise.
1785 public function eof() {
1786 return hphp_splfileobject_eof($this);
1789 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1791 * ( excerpt from http://php.net/manual/en/splfileobject.fflush.php )
1793 * Forces a write of all buffered output to the file.
1795 * @return mixed Returns TRUE on success or FALSE on failure.
1797 public function fflush() {
1798 return hphp_splfileobject_fflush($this);
1801 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1803 * ( excerpt from http://php.net/manual/en/splfileobject.fgetc.php )
1805 * Gets a character from the file.
1807 * @return mixed Returns a string containing a single character read
1808 * from the file or FALSE on EOF. WarningThis function
1809 * may return Boolean FALSE, but may also return a
1810 * non-Boolean value which evaluates to FALSE, such as
1811 * 0 or "". Please read the section on Booleans for
1812 * more information. Use the === operator for testing
1813 * the return value of this function.
1815 public function fgetc() {
1816 return hphp_splfileobject_fgetc($this);
1819 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1821 * ( excerpt from http://php.net/manual/en/splfileobject.fgetcsv.php )
1823 * Gets a line from the file which is in CSV format and returns an array
1824 * containing the fields read.
1826 * @delimiter mixed The field delimiter (one character only). Defaults
1827 * as a comma or the value set using
1828 * SplFileObject::setCsvControl().
1829 * @enclosure mixed The field enclosure character (one character only).
1830 * Defaults as a double quotation mark or the value set
1831 * using SplFileObject::setCsvControl().
1832 * @escape mixed The escape character (one character only). Defaults
1833 * as a backslash (\) or the value set using
1834 * SplFileObject::setCsvControl().
1836 * @return mixed Returns an indexed array containing the fields read,
1837 * or FALSE on error.
1839 * A blank line in a CSV file will be returned as an
1840 * array comprising a single NULL field unless using
1841 * SplFileObject::SKIP_EMPTY |
1842 * SplFileObject::DROP_NEW_LINE, in which case empty
1843 * lines are skipped.
1845 public function fgetcsv($delimiter = ",", $enclosure = "\"",
1846 $escape = "\\") {
1847 return hphp_splfileobject_fgetcsv($this, $delimiter,
1848 $enclosure, $escape);
1851 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1853 * ( excerpt from http://php.net/manual/en/splfileobject.fgets.php )
1855 * Gets a line from the file.
1857 * @return mixed Returns a string containing the next line from the
1858 * file, or FALSE on error.
1860 public function fgets() {
1861 return hphp_splfileobject_fgets($this);
1864 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1866 * ( excerpt from http://php.net/manual/en/splfileobject.fgetss.php )
1868 * Identical to SplFileObject::fgets(), except that
1869 * SplFileObject::fgetss() attempts to strip any HTML and PHP tags from the
1870 * text it reads.
1872 * @allowable_tags
1873 * mixed You can use the optional third parameter to specify
1874 * tags which should not be stripped.
1876 * @return mixed Returns a string containing the next line of the
1877 * file with HTML and PHP code stripped, or FALSE on
1878 * error.
1880 public function fgetss($allowable_tags) {
1881 return hphp_splfileobject_fgetss($this, $allowable_tags);
1884 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1886 * ( excerpt from http://php.net/manual/en/splfileobject.flock.php )
1888 * Locks or unlocks the file in the same portable way as flock().
1890 * @operation mixed operation is one of the following: LOCK_SH to
1891 * acquire a shared lock (reader). LOCK_EX to acquire
1892 * an exclusive lock (writer). LOCK_UN to release a
1893 * lock (shared or exclusive). LOCK_NB to not block
1894 * while locking (not supported on Windows).
1895 * @wouldblock mixed Set to TRUE if the lock would block (EWOULDBLOCK
1896 * errno condition).
1898 * @return mixed Returns TRUE on success or FALSE on failure.
1900 public function flock($operation, &$wouldblock) {
1901 return hphp_splfileobject_flock($this, $wouldblock);
1904 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1906 * ( excerpt from http://php.net/manual/en/splfileobject.fpassthru.php )
1908 * Reads to EOF on the given file pointer from the current position and
1909 * writes the results to the output buffer.
1911 * You may need to call SplFileObject::rewind() to reset the file pointer
1912 * to the beginning of the file if you have already written data to the
1913 * file.
1915 * @return mixed Returns the number of characters read from handle
1916 * and passed through to the output.
1918 public function fpassthru() {
1919 return hphp_splfileobject_fpassthru($this);
1922 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1924 * ( excerpt from http://php.net/manual/en/splfileobject.fscanf.php )
1926 * Reads a line from the file and interprets it according to the specified
1927 * format, which is described in the documentation for sprintf().
1929 * Any whitespace in the format string matches any whitespace in the line
1930 * from the file. This means that even a tab \t in the format string can
1931 * match a single space character in the input stream.
1933 * @format mixed The specified format as described in the sprintf()
1934 * documentation.
1936 * @return mixed If only two parameters were passed to this method,
1937 * the values parsed will be returned as an array.
1938 * Otherwise, if optional parameters are passed, the
1939 * function will return the number of assigned values.
1940 * The optional parameters must be passed by reference.
1942 public function fscanf($format) {
1943 $argc = func_num_args();
1944 $argv = func_get_args();
1945 return hphp_splfileobject_fscanf($argc, $this, $format, $argv);
1948 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1950 * ( excerpt from http://php.net/manual/en/splfileobject.fseek.php )
1952 * Seek to a position in the file measured in bytes from the beginning of
1953 * the file, obtained by adding offset to the position specified by whence.
1955 * @offset mixed The offset. A negative value can be used to move
1956 * backwards through the file which is useful when
1957 * SEEK_END is used as the whence value.
1958 * @whence mixed whence values are: SEEK_SET - Set position equal to
1959 * offset bytes. SEEK_CUR - Set position to current
1960 * location plus offset. SEEK_END - Set position to
1961 * end-of-file plus offset.
1963 * If whence is not specified, it is assumed to be
1964 * SEEK_SET.
1966 * @return mixed Returns 0 if the seek was successful, -1 otherwise.
1967 * Note that seeking past EOF is not considered an
1968 * error.
1970 public function fseek($offset, $whence) {
1971 return hphp_splfileobject_fseek($this, $offset, $whence);
1974 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1976 * ( excerpt from http://php.net/manual/en/splfileobject.fstat.php )
1978 * Gathers the statistics of the file. Behaves identically to fstat().
1980 * @return mixed Returns an array with the statistics of the file;
1981 * the format of the array is described in detail on
1982 * the stat() manual page.
1984 public function fstat() {
1985 return hphp_splfileobject_fstat($this);
1988 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
1990 * ( excerpt from http://php.net/manual/en/splfileobject.ftell.php )
1992 * Returns the position of the file pointer which represents the current
1993 * offset in the file stream.
1995 * @return mixed Returns the position of the file pointer as an
1996 * integer, or FALSE on error.
1998 public function ftell() {
1999 return hphp_splfileobject_ftell($this);
2002 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
2004 * ( excerpt from http://php.net/manual/en/splfileobject.ftruncate.php )
2006 * Truncates the file to size bytes.
2008 * @size mixed The size to truncate to.
2010 * If size is larger than the file it is extended with
2011 * null bytes.
2013 * If size is smaller than the file, the extra data
2014 * will be lost.
2016 * @return mixed Returns TRUE on success or FALSE on failure.
2018 public function ftruncate($size) {
2019 return hphp_splfileobject_ftruncate($this, $size);
2022 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
2024 * ( excerpt from http://php.net/manual/en/splfileobject.fwrite.php )
2026 * Writes the contents of string to the file
2028 * @str mixed The string to be written to the file.
2029 * @length mixed If the length argument is given, writing will stop
2030 * after length bytes have been written or the end of
2031 * string is reached, whichever comes first.
2033 * @return mixed Returns the number of bytes written, or NULL on
2034 * error.
2036 public function fwrite($str, $length) {
2037 return hphp_splfileobject_fwrite($this, $str, $length);
2040 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
2042 * ( excerpt from http://php.net/manual/en/splfileobject.getchildren.php )
2044 * An SplFileObject does not have children so this method returns NULL.
2046 * @return mixed No value is returned.
2048 public function getChildren() {
2049 return null; // An SplFileOjbect does not have children
2052 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
2054 * ( excerpt from http://php.net/manual/en/splfileobject.getcsvcontrol.php
2057 * Gets the delimiter and enclosure character used for parsing CSV fields.
2059 * @return mixed Returns an indexed array containing the delimiter
2060 * and enclosure character.
2062 public function getCsvControl() {
2063 return hphp_splfileobject_getcvscontrol($this);
2066 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
2068 * ( excerpt from http://php.net/manual/en/splfileobject.getflags.php )
2070 * Gets the flags set for an instance of SplFileObject as an integer.
2072 * @return mixed Returns an integer representing the flags.
2074 public function getFlags() {
2075 return hphp_splfileobject_getflags($this);
2078 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
2080 * ( excerpt from http://php.net/manual/en/splfileobject.getmaxlinelen.php
2083 * Gets the maximum line length as set by SplFileObject::setMaxLineLen().
2085 * @return mixed Returns the maximum line length if one has been set
2086 * with SplFileObject::setMaxLineLen(), default is 0.
2088 public function getMaxLineLen() {
2089 return hphp_splfileobject_getmaxlinelen($this);
2092 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
2094 * ( excerpt from http://php.net/manual/en/splfileobject.haschildren.php )
2096 * An SplFileObject does not have children so this method always return
2097 * FALSE.
2099 * @return mixed Returns FALSE
2101 public function hasChildren() {
2102 return false; // An SplFileOjbect does not have children
2105 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
2107 * ( excerpt from http://php.net/manual/en/splfileobject.key.php )
2109 * Gets the current line number.
2111 * This number may not reflect the actual line number in the file if
2112 * SplFileObject::setMaxLineLen() is used to read fixed lengths of the
2113 * file.
2115 * @return mixed Returns the current line number.
2117 public function key() {
2118 return hphp_splfileobject_key($this);
2121 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
2123 * ( excerpt from http://php.net/manual/en/splfileobject.next.php )
2125 * Moves ahead to the next line in the file.
2127 * @return mixed No value is returned.
2129 public function next() {
2130 hphp_splfileobject_next($this);
2133 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
2135 * ( excerpt from http://php.net/manual/en/splfileobject.rewind.php )
2137 * Rewinds the file back to the first line.
2139 * @return mixed No value is returned.
2141 public function rewind() {
2142 hphp_splfileobject_rewind($this);
2145 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
2147 * ( excerpt from http://php.net/manual/en/splfileobject.seek.php )
2149 * Seek to specified line in the file.
2151 * @line_pos mixed The zero-based line number to seek to.
2153 * @return mixed No value is returned.
2155 public function seek($line_pos) {
2156 hphp_splfileobject_seek($this, $line_pos);
2159 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
2161 * ( excerpt from http://php.net/manual/en/splfileobject.setcsvcontrol.php
2164 * Sets the delimiter and enclosure character for parsing CSV fields.
2166 * @delimiter mixed The field delimiter (one character only).
2167 * @enclosure mixed The field enclosure character (one character only).
2168 * @escape mixed The field escape character (one character only).
2170 * @return mixed No value is returned.
2172 public function setCsvControl($delimiter = ",", $enclosure = "\"",
2173 $escape = "\\") {
2174 hphp_splfileobject_setcsvcontrol($this, $delimiter, $enclosure, $escape);
2177 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
2179 * ( excerpt from http://php.net/manual/en/splfileobject.setflags.php )
2181 * Sets the flags to be used by the SplFileObject.
2183 * @flags mixed Bit mask of the flags to set. See SplFileObject
2184 * constants for the available flags.
2186 * @return mixed No value is returned.
2188 public function setFlags($flags) {
2189 hphp_splfileobject_setflags($this, $flags);
2192 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
2194 * ( excerpt from http://php.net/manual/en/splfileobject.setmaxlinelen.php
2197 * Sets the maximum length of a line to be read.
2199 * @max_len mixed The maximum length of a line.
2201 * @return mixed No value is returned.
2203 public function setMaxLineLen($max_len) {
2204 hphp_splfileobject_setmaxlinelen($this, $max_len);
2207 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
2209 * ( excerpt from http://php.net/manual/en/splfileobject.valid.php )
2211 * Check whether EOF has been reached.
2213 * @return mixed Returns TRUE if not reached EOF, FALSE otherwise.
2215 public function valid() {
2216 return hphp_splfileobject_valid($this);
2220 interface Awaitable {
2221 public function getWaitHandle();
2224 class KeysIterator implements Iterator {
2225 public $it;
2226 public function __construct($it) {
2227 $this->it = $it;
2229 public function rewind() {
2230 $this->it->rewind();
2232 public function valid() {
2233 return $this->it->valid();
2235 public function next() {
2236 $this->it->next();
2238 public function key() {
2239 throw new RuntimeException(
2240 "Call to undefined method KeysIterator::keys()");
2242 public function current() {
2243 return $this->it->key();
2247 class KeysIterable implements Iterable {
2248 public $it;
2249 public function __construct($iterable) {
2250 $this->it = new KeysIterator($iterable->getIterator());
2252 public function getIterator() {
2253 return clone $this->it;
2257 class MapItemsIterator implements Iterator {
2258 public $it;
2259 public function __construct($it) {
2260 $this->it = $it;
2262 public function rewind() {
2263 $this->it->rewind();
2265 public function valid() {
2266 return $this->it->valid();
2268 public function next() {
2269 $this->it->next();
2271 public function key() {
2272 throw new RuntimeException(
2273 "Call to undefined method MapItemsIterator::keys()");
2275 public function current() {
2276 return Tuple {$this->it->key(), $this->it->current()};
2280 class MapItemsIterable implements Iterable {
2281 public $it;
2282 public function __construct($iterable) {
2283 $this->it = new MapItemsIterator($iterable->getIterator());
2285 public function getIterator() {
2286 return clone $this->it;
2290 interface ConstCollection extends Countable {
2291 public function isEmpty();
2292 public function count();
2293 public function items();
2296 interface OutputCollection {
2297 public function add($e);
2298 public function addAll($iterable);
2301 interface Collection extends ConstCollection,
2302 OutputCollection {
2303 public function clear();
2306 interface ConstSetAccess {
2307 public function contains($m);
2310 interface SetAccess extends ConstSetAccess {
2311 public function remove($m);
2314 interface ConstIndexAccess {
2315 public function at($k);
2316 public function get($k);
2317 public function containsKey($k);
2320 interface IndexAccess extends ConstIndexAccess {
2321 public function set($k,$v);
2322 public function setAll($iterable);
2323 public function removeKey($k);
2326 interface ConstMapAccess extends ConstSetAccess,
2327 ConstIndexAccess {
2330 interface MapAccess extends ConstMapAccess,
2331 SetAccess,
2332 IndexAccess {
2335 interface ConstVector extends ConstCollection,
2336 ConstIndexAccess,
2337 KeyedIterable {
2340 interface MutableVector extends ConstVector,
2341 Collection,
2342 IndexAccess {
2345 interface ConstMap extends ConstCollection,
2346 ConstMapAccess,
2347 KeyedIterable {
2350 interface MutableMap extends ConstMap,
2351 Collection,
2352 MapAccess {
2355 interface ConstSet extends ConstCollection,
2356 ConstSetAccess,
2357 Iterable {
2360 interface MutableSet extends ConstSet,
2361 Collection,
2362 SetAccess {
2366 interface DebuggerCommand {
2368 * Called when DebuggerClient needs to auto-complete. Inside this function,
2369 * one can call $client->addCompletion() with a list of strings or one of
2370 * those DebuggerClient::AUTO_COMPLETE_ constants.
2372 public function onAutoComplete($client);
2375 * Called when DebuggerClient needs to displays help on the command. Inside
2376 * this function, one can call $client->help() and its different forms.
2378 * @return TRUE if helped, FALSE if any error
2380 public function help($client);
2383 * How to process the command on client side.
2385 * @return TRUE for success, FALSE for failure
2387 public function onClient($client);
2390 * How to process the command on server side.
2392 * @return TRUE for success, FALSE for failure
2394 public function onServer($proxy);
2397 class Directory {
2398 public $path;
2399 public $handle;
2401 public function __construct($path) {
2402 $this->path = $path;
2403 $this->handle = opendir($path);
2406 public function read() {
2407 return readdir($this->handle);
2410 public function rewind() {
2411 rewinddir($this->handle);
2414 public function close() {
2415 closedir($this->handle);
2419 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
2421 * ( excerpt from http://php.net/manual/en/class.directoryiterator.php )
2423 * The DirectoryIterator class provides a simple interface for viewing the
2424 * contents of filesystem directories.
2427 class DirectoryIterator extends SplFileInfo implements Traversable,
2428 SeekableIterator {
2430 public function __construct($path) {
2431 if (!hphp_directoryiterator___construct($this, $path)) {
2432 throw new UnexpectedValueException(
2433 "DirectoryIterator::__construct($path): failed to open dir");
2437 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
2439 * ( excerpt from http://php.net/manual/en/directoryiterator.current.php )
2441 * Get the current DirectoryIterator item.
2443 * @return mixed The current DirectoryIterator item.
2445 public function current() {
2446 return hphp_directoryiterator_current($this);
2449 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
2451 * ( excerpt from http://php.net/manual/en/directoryiterator.key.php )
2453 * Get the key for the current DirectoryIterator item.
2455 * @return mixed The key for the current DirectoryIterator item.
2457 public function key() {
2458 return hphp_directoryiterator_key($this);
2461 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
2463 * ( excerpt from http://php.net/manual/en/directoryiterator.next.php )
2465 * Move forward to the next DirectoryIterator item.
2467 * @return mixed No value is returned.
2469 public function next() {
2470 hphp_directoryiterator_next($this);
2473 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
2475 * ( excerpt from http://php.net/manual/en/directoryiterator.rewind.php )
2477 * Rewind the DirectoryIterator back to the start.
2479 * @return mixed No value is returned.
2481 public function rewind() {
2482 hphp_directoryiterator_rewind($this);
2485 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
2487 * ( excerpt from http://php.net/manual/en/directoryiterator.seek.php )
2489 * Seek to a given position in the DirectoryIterator.
2491 * @position mixed The zero-based numeric position to seek to.
2493 * @return mixed No value is returned.
2495 public function seek($position) {
2496 hphp_directoryiterator_seek($this, $position);
2499 public function __toString() {
2500 return hphp_directoryiterator___tostring($this);
2503 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
2505 * ( excerpt from http://php.net/manual/en/directoryiterator.valid.php )
2507 * Check whether current DirectoryIterator position is a valid file.
2509 * @return mixed Returns TRUE if the position is valid, otherwise
2510 * FALSE
2512 public function valid() {
2513 return hphp_directoryiterator_valid($this);
2516 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
2518 * ( excerpt from http://php.net/manual/en/directoryiterator.isdot.php )
2520 * Determines if the current DirectoryIterator item is a directory and
2521 * either . or ...
2523 * @return mixed TRUE if the entry is . or .., otherwise FALSE
2525 public function isDot() {
2526 return hphp_directoryiterator_isdot($this);
2530 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
2532 * ( excerpt from
2533 * http://php.net/manual/en/class.recursivedirectoryiterator.php )
2535 * ...
2538 class RecursiveDirectoryIterator extends DirectoryIterator
2539 implements RecursiveIterator {
2541 const CURRENT_AS_SELF = 0x0;
2542 const CURRENT_AS_FILEINFO = 0x00000010;
2543 const CURRENT_AS_PATHNAME = 0x00000020;
2544 const KEY_AS_PATHNAME = 0x0;
2545 const KEY_AS_FILENAME = 0x00000100;
2546 const NEW_CURRENT_AND_KEY = 0x00000110;
2548 function __construct($path,
2549 $flags = RecursiveDirectoryIterator::CURRENT_AS_FILEINFO) {
2550 if (!hphp_recursivedirectoryiterator___construct($this, $path, $flags)) {
2551 throw new UnexpectedValueException(
2552 "RecursiveDirectoryIterator::__construct($path): failed to open dir");
2556 function current() {
2557 return hphp_recursivedirectoryiterator_current($this);
2560 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
2562 * ( excerpt from
2563 * http://php.net/manual/en/recursivedirectoryiterator.key.php )
2566 * @return mixed The path and filename of the current dir entry.
2568 function key() {
2569 return hphp_recursivedirectoryiterator_key($this);
2572 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
2574 * ( excerpt from
2575 * http://php.net/manual/en/recursivedirectoryiterator.next.php )
2578 * @return mixed No value is returned.
2580 public function next() {
2581 hphp_recursivedirectoryiterator_next($this);
2584 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
2586 * ( excerpt from
2587 * http://php.net/manual/en/recursivedirectoryiterator.rewind.php )
2590 * @return mixed No value is returned.
2592 public function rewind() {
2593 hphp_recursivedirectoryiterator_rewind($this);
2596 public function seek($position) {
2597 hphp_recursivedirectoryiterator_seek($this, $position);
2600 public function __toString() {
2601 return hphp_recursivedirectoryiterator___toString($this);
2604 public function valid() {
2605 return hphp_recursivedirectoryiterator_valid($this);
2608 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
2610 * ( excerpt from
2611 * http://php.net/manual/en/recursivedirectoryiterator.haschildren.php )
2614 * @return mixed Returns whether the current entry is a directory,
2615 * but not '.' or '..'
2617 function hasChildren() {
2618 return hphp_recursivedirectoryiterator_haschildren($this);
2621 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
2623 * ( excerpt from
2624 * http://php.net/manual/en/recursivedirectoryiterator.getchildren.php )
2627 * @return mixed An iterator for the current entry, if it is a
2628 * directory.
2630 function getChildren() {
2631 return hphp_recursivedirectoryiterator_getchildren($this);
2634 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
2636 * ( excerpt from
2637 * http://php.net/manual/en/recursivedirectoryiterator.getsubpath.php )
2639 * Gets the sub path. WarningThis function is currently not documented;
2640 * only its argument list is available.
2642 * @return mixed The sub path (sub directory).
2644 function getSubPath() {
2645 return hphp_recursivedirectoryiterator_getsubpath($this);
2648 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
2650 * ( excerpt from
2651 * http://php.net/manual/en/recursivedirectoryiterator.getsubpathname.php )
2653 * Gets the sub path and filename. WarningThis function is currently not
2654 * documented; only its argument list is available.
2656 * @return mixed The sub path (sub directory) and filename.
2658 function getSubPathname() {
2659 return hphp_recursivedirectoryiterator_getsubpathname($this);
2663 /* vim: set expandtab tabstop=4 shiftwidth=4: */
2664 // +----------------------------------------------------------------------+
2665 // | Copyright (c) 2002-2004 Brent Cook |
2666 // +----------------------------------------------------------------------+
2667 // | This library is free software; you can redistribute it and/or |
2668 // | modify it under the terms of the GNU Lesser General Public |
2669 // | License as published by the Free Software Foundation; either |
2670 // | version 2.1 of the License, or (at your option) any later version. |
2671 // | |
2672 // | This library is distributed in the hope that it will be useful, |
2673 // | but WITHOUT ANY WARRANTY; without even the implied warranty of |
2674 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
2675 // | Lesser General Public License for more details. |
2676 // | |
2677 // | You should have received a copy of the GNU Lesser General Public |
2678 // | License along with this library; if not, write to the Free Software |
2679 // | Foundation, Inc., 59 Temple Place, Suite 330,Boston,MA 02111-1307 USA|
2680 // +----------------------------------------------------------------------+
2681 // | Authors: Brent Cook <busterbcook@yahoo.com> |
2682 // | Jason Pell <jasonpell@hotmail.com> |
2683 // +----------------------------------------------------------------------+
2685 // $Id: Lexer.php,v 1.20 2004/05/07 12:33:35 busterb Exp $
2688 // {{{ token definitions
2689 // variables: 'ident', 'sys_var'
2690 // values: 'real_val', 'text_val', 'int_val', null
2691 // }}}
2694 * A lexigraphical analyser inspired by the msql lexer
2696 * @author Brent Cook <busterbcook@yahoo.com>
2697 * @version 0.5
2698 * @access public
2699 * @package SQL_Parser
2701 class FB_MySQLLexer
2703 // array of valid tokens for the lexer to recognize
2704 // format is 'token literal'=>TOKEN_VALUE
2705 var $symbols = array();
2707 // {{{ instance variables
2708 var $tokPtr = 0;
2709 var $tokStart = 0;
2710 var $tokLen = 0;
2711 var $tokText = '';
2712 var $lineNo = 0;
2713 var $lineBegin = 0;
2714 var $string = '';
2715 var $stringLen = 0;
2717 // Will not be altered by skip()
2718 var $tokAbsStart = 0;
2719 var $skipText = '';
2721 // Provide lookahead capability.
2722 var $lookahead = 0;
2723 // Specify how many tokens to save in tokenStack, so the
2724 // token stream can be pushed back.
2725 var $tokenStack = array();
2726 var $stackPtr = 0;
2727 // }}}
2729 // {{{ incidental functions
2730 function __construct($string = '', $lookahead=0)
2732 $this->string = $string;
2733 $this->stringLen = strlen($string);
2734 $this->lookahead = $lookahead;
2737 function get() {
2738 ++$this->tokPtr;
2739 ++$this->tokLen;
2740 return ($this->tokPtr <= $this->stringLen) ? $this->string{$this->tokPtr - 1} : null;
2743 function unget() {
2744 --$this->tokPtr;
2745 --$this->tokLen;
2748 function skip() {
2749 ++$this->tokStart;
2750 return ($this->tokPtr != $this->stringLen) ? $this->string{$this->tokPtr++} : '';
2753 function revert() {
2754 $this->tokPtr = $this->tokStart;
2755 $this->tokLen = 0;
2758 function isCompop($c) {
2759 return (($c == '<') || ($c == '>') || ($c == '=') || ($c == '!'));
2761 // }}}
2763 // {{{ pushBack()
2765 * Push back a token, so the very next call to lex() will return that token.
2766 * Calls to this function will be ignored if there is no lookahead specified
2767 * to the constructor, or the pushBack() function has already been called the
2768 * maximum number of token's that can be looked ahead.
2770 function pushBack()
2772 if($this->lookahead>0 && count($this->tokenStack)>0 && $this->stackPtr>0) {
2773 $this->stackPtr--;
2776 // }}}
2778 // {{{ lex()
2779 function lex()
2781 if($this->lookahead>0) {
2782 // The stackPtr, should always be the same as the count of
2783 // elements in the tokenStack. The stackPtr, can be thought
2784 // of as pointing to the next token to be added. If however
2785 // a pushBack() call is made, the stackPtr, will be less than the
2786 // count, to indicate that we should take that token from the
2787 // stack, instead of calling nextToken for a new token.
2789 if ($this->stackPtr<count($this->tokenStack)) {
2791 $this->tokText = $this->tokenStack[$this->stackPtr]['tokText'];
2792 $this->skipText = $this->tokenStack[$this->stackPtr]['skipText'];
2793 $token = $this->tokenStack[$this->stackPtr]['token'];
2795 // We have read the token, so now iterate again.
2796 $this->stackPtr++;
2797 return $token;
2799 } else {
2801 // If $tokenStack is full (equal to lookahead), pop the oldest
2802 // element off, to make room for the new one.
2804 if ($this->stackPtr == $this->lookahead) {
2805 // For some reason array_shift and
2806 // array_pop screw up the indexing, so we do it manually.
2807 for($i=0; $i<(count($this->tokenStack)-1); $i++) {
2808 $this->tokenStack[$i] = $this->tokenStack[$i+1];
2811 // Indicate that we should put the element in
2812 // at the stackPtr position.
2813 $this->stackPtr--;
2816 $token = $this->nextToken();
2817 $this->tokenStack[$this->stackPtr] =
2818 array('token'=>$token,
2819 'tokText'=>$this->tokText,
2820 'skipText'=>$this->skipText);
2821 $this->stackPtr++;
2822 return $token;
2825 else
2827 return $this->nextToken();
2830 // }}}
2832 // {{{ nextToken()
2833 function nextToken()
2835 if ($this->string == '') return;
2836 $state = 0;
2837 $this->tokAbsStart = $this->tokStart;
2839 while (true){
2840 //echo "State: $state, Char: $c\n";
2841 switch($state) {
2842 // {{{ State 0 : Start of token
2843 case 0:
2844 $this->tokPtr = $this->tokStart;
2845 $this->tokText = '';
2846 $this->tokLen = 0;
2847 $c = $this->get();
2849 if (is_null($c)) { // End Of Input
2850 $state = 1000;
2851 break;
2854 while (($c == ' ') || ($c == "\t")
2855 || ($c == "\n") || ($c == "\r")) {
2856 if ($c == "\n" || $c == "\r") {
2857 // Handle MAC/Unix/Windows line endings.
2858 if($c == "\r") {
2859 $c = $this->skip();
2861 // If not DOS newline
2862 if($c != "\n")
2863 $this->unget();
2865 ++$this->lineNo;
2866 $this->lineBegin = $this->tokPtr;
2869 $c = $this->skip();
2870 $this->tokLen = 1;
2873 // Escape quotes and backslashes
2874 if ($c == '\\') {
2875 $t = $this->get();
2876 if ($t == '\'' || $t == '\\' || $t == '"') {
2877 $this->tokText = $t;
2878 $this->tokStart = $this->tokPtr;
2879 return $this->tokText;
2880 } else {
2881 $this->unget();
2883 // Unknown token. Revert to single char
2884 $state = 999;
2885 break;
2889 if (($c == '\'') || ($c == '"')) { // text string
2890 $quote = $c;
2891 $state = 12;
2892 break;
2895 if ($c == '_') { // system variable
2896 $state = 18;
2897 break;
2900 if ($c == '`') { // escaped ident
2901 $state = 20;
2902 break;
2905 if (ctype_alpha($c)) { // keyword or ident
2906 $state = 1;
2907 break;
2910 if (ctype_digit($c)) { // real or int number
2911 $state = 5;
2912 break;
2915 if ($c == '.') {
2916 $t = $this->get();
2917 if ($t == '.') { // ellipsis
2918 if ($this->get() == '.') {
2919 $this->tokText = '...';
2920 $this->tokStart = $this->tokPtr;
2921 return $this->tokText;
2922 } else {
2923 $state = 999;
2924 break;
2926 } else if (ctype_digit($t)) { // real number
2927 $this->unget();
2928 $state = 7;
2929 break;
2930 } else { // period
2931 $this->unget();
2935 if ($c == '#') { // Comments
2936 $state = 14;
2937 break;
2939 if ($c == '-') {
2940 $t = $this->get();
2941 if ($t == '-') {
2942 $state = 14;
2943 break;
2944 } else {
2945 // negative number ... or - used as an operator
2946 $state = 999;
2947 break;
2951 if ($this->isCompop($c)) { // comparison operator
2952 $state = 10;
2953 break;
2955 // Unknown token. Revert to single char
2956 $state = 999;
2957 break;
2958 // }}}
2960 // {{{ State 1 : Incomplete keyword or ident
2961 case 1:
2962 $c = $this->get();
2963 if (ctype_alnum($c) || ($c == '_')) {
2964 $state = 1;
2965 break;
2967 $state = 2;
2968 break;
2969 // }}}
2971 // {{{ State 20 : Incomplete keyword or ident
2972 case 20:
2973 do {
2974 $c = $this->get();
2975 } while ('`' != $c);
2977 $c = $this->get();
2978 $state = 2;
2979 break;
2980 // }}}
2982 /* {{{ State 2 : Complete keyword or ident */
2983 case 2:
2984 $this->unget();
2985 $this->tokText = substr($this->string, $this->tokStart,
2986 $this->tokLen);
2988 $testToken = strtolower($this->tokText);
2989 if (isset($this->symbols[$testToken])) {
2991 $this->skipText = substr($this->string, $this->tokAbsStart,
2992 $this->tokStart-$this->tokAbsStart);
2993 $this->tokStart = $this->tokPtr;
2994 return $testToken;
2995 } else {
2996 $this->skipText = substr($this->string, $this->tokAbsStart,
2997 $this->tokStart-$this->tokAbsStart);
2998 $this->tokStart = $this->tokPtr;
2999 $this->tokText = trim($this->tokText, '`');
3000 return 'ident';
3002 break;
3003 // }}}
3005 // {{{ State 5: Incomplete real or int number
3006 case 5:
3007 $c = $this->get();
3008 if (ctype_digit($c)) {
3009 $state = 5;
3010 break;
3011 } else if ($c == '.') {
3012 $t = $this->get();
3013 if ($t == '.') { // ellipsis
3014 $this->unget();
3015 } else { // real number
3016 $state = 7;
3017 break;
3019 } else if(ctype_alpha($c)) { // number must end with non-alpha character
3020 $state = 999;
3021 break;
3022 } else {
3023 // complete number
3024 $state = 6;
3025 break;
3027 // }}}
3029 // {{{ State 6: Complete integer number
3030 case 6:
3031 $this->unget();
3032 $this->tokText = intval(substr($this->string, $this->tokStart,
3033 $this->tokLen));
3034 $this->skipText = substr($this->string, $this->tokAbsStart,
3035 $this->tokStart-$this->tokAbsStart);
3036 $this->tokStart = $this->tokPtr;
3037 return 'int_val';
3038 break;
3039 // }}}
3041 // {{{ State 7: Incomplete real number
3042 case 7:
3043 $c = $this->get();
3045 /* Analogy Start */
3046 if ($c == 'e' || $c == 'E') {
3047 $state = 15;
3048 break;
3050 /* Analogy End */
3052 if (ctype_digit($c)) {
3053 $state = 7;
3054 break;
3056 $state = 8;
3057 break;
3058 // }}}
3060 // {{{ State 8: Complete real number */
3061 case 8:
3062 $this->unget();
3063 $this->tokText = floatval(substr($this->string, $this->tokStart,
3064 $this->tokLen));
3065 $this->skipText = substr($this->string, $this->tokAbsStart,
3066 $this->tokStart-$this->tokAbsStart);
3067 $this->tokStart = $this->tokPtr;
3068 return 'real_val';
3069 // }}}
3071 // {{{ State 10: Incomplete comparison operator
3072 case 10:
3073 $c = $this->get();
3074 if ($this->isCompop($c))
3076 $state = 10;
3077 break;
3079 $state = 11;
3080 break;
3081 // }}}
3083 // {{{ State 11: Complete comparison operator
3084 case 11:
3085 $this->unget();
3086 $this->tokText = substr($this->string, $this->tokStart,
3087 $this->tokLen);
3088 if($this->tokText) {
3089 $this->skipText = substr($this->string, $this->tokAbsStart,
3090 $this->tokStart-$this->tokAbsStart);
3091 $this->tokStart = $this->tokPtr;
3092 return $this->tokText;
3094 $state = 999;
3095 break;
3096 // }}}
3098 // {{{ State 12: Incomplete text string
3099 case 12:
3100 $bail = false;
3101 $text = '';
3102 while (!$bail) {
3103 $c = $this->get();
3104 switch ($c) {
3105 case '':
3106 $this->tokText = null;
3107 $bail = true;
3108 break;
3109 case "\\":
3110 $c = $this->get();
3111 switch ($c) {
3112 // undo mysql_escape_string
3113 case '0':
3114 $text .= "\0";
3115 break;
3116 case 'r':
3117 $text .= "\r";
3118 break;
3119 case 'n':
3120 $text .= "\n";
3121 break;
3122 case 'Z':
3123 $text .= "\x1a";
3124 break;
3125 default:
3126 if (!$c) {
3127 $this->tokText = null;
3128 $bail = true;
3129 } else {
3130 $text .= $c;
3133 break;
3134 case $quote:
3135 $this->tokText = $text;
3136 $bail = true;
3137 break;
3138 default:
3139 $text .= $c;
3140 break;
3143 if (!is_null($this->tokText)) {
3144 $state = 13;
3145 break;
3147 $state = 999;
3148 break;
3149 // }}}
3151 // {{{ State 13: Complete text string
3152 case 13:
3153 $this->skipText = substr($this->string, $this->tokAbsStart,
3154 $this->tokStart-$this->tokAbsStart);
3155 $this->tokStart = $this->tokPtr;
3156 return 'text_val';
3157 break;
3158 // }}}
3160 // {{{ State 14: Comment
3161 case 14:
3162 $c = $this->skip();
3163 if ($c == "\n" || $c == "\r" || $c == "") {
3164 // Handle MAC/Unix/Windows line endings.
3165 if ($c == "\r") {
3166 $c = $this->skip();
3167 // If not DOS newline
3168 if ($c != "\n") {
3169 $this->unget();
3173 if ($c != "") {
3174 ++$this->lineNo;
3175 $this->lineBegin = $this->tokPtr;
3178 // We need to skip all the text.
3179 $this->tokStart = $this->tokPtr;
3180 $state = 0;
3181 } else {
3182 $state = 14;
3184 break;
3185 // }}}
3187 // {{{ State 15: Exponent Sign in Scientific Notation
3188 case 15:
3189 $c = $this->get();
3190 if($c == '-' || $c == '+') {
3191 $state = 16;
3192 break;
3194 $state = 999;
3195 break;
3196 // }}}
3198 // {{{ state 16: Exponent Value-first digit in Scientific Notation
3199 case 16:
3200 $c = $this->get();
3201 if (ctype_digit($c)) {
3202 $state = 17;
3203 break;
3205 $state = 999; // if no digit, then token is unknown
3206 break;
3207 // }}}
3209 // {{{ State 17: Exponent Value in Scientific Notation
3210 case 17:
3211 $c = $this->get();
3212 if (ctype_digit($c)) {
3213 $state = 17;
3214 break;
3216 $state = 8; // At least 1 exponent digit was required
3217 break;
3218 // }}}
3220 // {{{ State 18 : Incomplete System Variable
3221 case 18:
3222 $c = $this->get();
3223 if (ctype_alnum($c) || $c == '_') {
3224 $state = 18;
3225 break;
3227 $state = 19;
3228 break;
3229 // }}}
3231 // {{{ State 19: Complete Sys Var
3232 case 19:
3233 $this->unget();
3234 $this->tokText = substr($this->string, $this->tokStart,
3235 $this->tokLen);
3236 $this->skipText = substr($this->string, $this->tokAbsStart,
3237 $this->tokStart-$this->tokAbsStart);
3238 $this->tokStart = $this->tokPtr;
3239 return 'sys_var';
3240 // }}}
3242 // {{{ State 999 : Unknown token. Revert to single char
3243 case 999:
3244 $this->revert();
3245 $this->tokText = $this->get();
3246 $this->skipText = substr($this->string, $this->tokAbsStart,
3247 $this->tokStart-$this->tokAbsStart);
3248 $this->tokStart = $this->tokPtr;
3249 return $this->tokText;
3250 // }}}
3252 // {{{ State 1000 : End Of Input
3253 case 1000:
3254 $this->tokText = '*end of input*';
3255 $this->skipText = substr($this->string, $this->tokAbsStart,
3256 $this->tokStart-$this->tokAbsStart);
3257 $this->tokStart = $this->tokPtr;
3258 return null;
3259 // }}}
3263 // }}}
3266 ///////////////////////////////////////////////////////////////////////////////
3267 // helpers
3269 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
3271 * ( excerpt from http://php.net/manual/en/class.reflector.php )
3273 * Reflector is an interface implemented by all exportable Reflection
3274 * classes.
3277 interface Reflector {
3278 public function __toString();
3281 class ReflectionException extends Exception {
3284 ///////////////////////////////////////////////////////////////////////////////
3285 // parameter
3287 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
3289 * ( excerpt from http://php.net/manual/en/class.reflectionparameter.php )
3291 * The ReflectionParameter class retrieves information about a function's
3292 * or method's parameters.
3294 * To introspect function parameters, first create an instance of the
3295 * ReflectionFunction or ReflectionMethod classes and then use their
3296 * ReflectionFunctionAbstract::getParameters() method to retrieve an array
3297 * of parameters.
3300 class ReflectionParameter implements Reflector {
3301 public $info;
3303 public function __construct($func, $param) {
3304 if ($func && $param) {
3305 $params = $func->getParameters();
3306 $this->info = $params[$param]->info;
3310 public function __toString() {
3311 // TODO
3312 return "";
3315 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
3317 * ( excerpt from http://php.net/manual/en/reflectionparameter.export.php )
3319 * Exports. WarningThis function is currently not documented; only its
3320 * argument list is available.
3322 * @func mixed The function name.
3323 * @param mixed The parameter name.
3324 * @ret mixed Setting to TRUE will return the export, as opposed
3325 * to emitting it. Setting to FALSE (the default) will
3326 * do the opposite.
3328 * @return mixed The exported reflection.
3330 public static function export($func, $param, $ret=false) {
3331 $obj = new ReflectionParameter($func, $param);
3332 $str = (string)$obj;
3333 if ($ret) {
3334 return $str;
3336 print $str;
3339 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
3341 * ( excerpt from http://php.net/manual/en/reflectionparameter.getname.php
3344 * Gets the name of the parameter.
3346 * @return mixed The name of the reflected parameter.
3348 public function getName() {
3349 return $this->info['name'];
3352 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
3354 * ( excerpt from
3355 * http://php.net/manual/en/reflectionparameter.ispassedbyreference.php )
3357 * Checks if the parameter is passed in by reference. WarningThis function
3358 * is currently not documented; only its argument list is available.
3360 * @return mixed TRUE if the parameter is passed in by reference,
3361 * otherwise FALSE
3363 public function isPassedByReference() {
3364 return isset($this->info['ref']);
3367 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
3369 * ( excerpt from
3370 * http://php.net/manual/en/reflectionparameter.getdeclaringclass.php )
3372 * Gets the declaring class. WarningThis function is currently not
3373 * documented; only its argument list is available.
3375 * @return mixed A ReflectionClass object.
3377 public function getDeclaringClass() {
3378 if (empty($this->info['class'])) {
3379 return null;
3381 return new ReflectionClass($this->info['class']);
3384 public function getDeclaringFunction() {
3385 if (empty($this->info['class'])) {
3386 return new ReflectionFunction($this->info['function']);
3388 return new ReflectionMethod($this->info['class'], $this->info['function']);
3391 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
3393 * ( excerpt from http://php.net/manual/en/reflectionparameter.getclass.php
3396 * Gets a class. WarningThis function is currently not documented; only
3397 * its argument list is available.
3399 * @return mixed A ReflectionClass object.
3401 public function getClass() {
3402 if (empty($this->info['type'])) {
3403 return null;
3405 $ltype = strtolower($this->info['type']);
3406 if (hphp_scalar_typehints_enabled()) {
3407 $nonClassTypehints = array(
3408 'bool' => 1,
3409 'boolean' => 1,
3410 'int' => 1,
3411 'integer' => 1,
3412 'real' => 1,
3413 'double' => 1,
3414 'float' => 1,
3415 'string' => 1,
3416 'array' => 1
3418 if (isset($nonClassTypehints[$ltype])) {
3419 return null;
3421 } else if ($ltype === 'array') {
3422 return null;
3424 return new ReflectionClass($this->info['type']);
3427 public function getTypehintText() {
3428 if (isset($this->info['type'])) {
3429 return $this->info['type'];
3431 return '';
3434 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
3436 * ( excerpt from http://php.net/manual/en/reflectionparameter.isarray.php
3439 * Checks if the parameter expects an array.
3441 * @return mixed TRUE if an array is expected, FALSE otherwise.
3443 public function isArray() {
3444 return $this->info['type'] == 'array';
3447 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
3449 * ( excerpt from
3450 * http://php.net/manual/en/reflectionparameter.allowsnull.php )
3452 * Checks whether the parameter allows NULL. WarningThis function is
3453 * currently not documented; only its argument list is available.
3455 * @return mixed TRUE if NULL is allowed, otherwise FALSE
3457 public function allowsNull() {
3458 return isset($this->info['nullable']);
3461 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
3463 * ( excerpt from
3464 * http://php.net/manual/en/reflectionparameter.isoptional.php )
3466 * Checks if the parameter is optional.
3468 * @return mixed TRUE if the parameter is optional, otherwise FALSE
3470 public function isOptional() {
3471 return array_key_exists('default', $this->info);
3474 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
3476 * ( excerpt from
3477 * http://php.net/manual/en/reflectionparameter.isdefaultvalueavailable.php
3480 * Checks if a default value for the parameter is available.
3482 * @return mixed TRUE if a default value is available, otherwise
3483 * FALSE
3485 public function isDefaultValueAvailable() {
3486 return array_key_exists('default', $this->info);
3489 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
3491 * ( excerpt from
3492 * http://php.net/manual/en/reflectionparameter.getdefaultvalue.php )
3494 * Gets the default value of the parameter for a user-defined function or
3495 * method. If the parameter is not optional a ReflectionException will be
3496 * thrown.
3498 * @return mixed The parameters default value.
3500 public function getDefaultValue() {
3501 if (!$this->isOptional()) {
3502 throw new ReflectionException('Parameter is not optional');
3504 $defaultValue = $this->info['default'];
3505 if ($defaultValue instanceof stdclass) {
3506 if (isset($defaultValue->class)) {
3507 return hphp_get_class_constant($defaultValue->class,
3508 $defaultValue->name);
3510 hphp_throw_fatal_error($defaultValue->msg);
3512 return $defaultValue;
3515 public function getDefaultValueText() {
3516 if (isset($this->info['defaultText'])) {
3517 return $this->info['defaultText'];
3519 return '';
3522 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
3524 * ( excerpt from
3525 * http://php.net/manual/en/reflectionparameter.getposition.php )
3527 * Gets the position of the parameter.
3529 * @return mixed The position of the parameter, left to right,
3530 * starting at position #0.
3532 public function getPosition() {
3533 return $this->info['index'];
3536 public function getAttribute($name) {
3537 $attrs = $this->info['attributes'];
3538 return isset($attrs[$name]) ? $attrs[$name] : null;
3541 public function getAttributes() {
3542 return $this->info['attributes'];
3545 public function getAttributeRecursive($name) {
3546 $attrs = $this->getAttributesRecursive();
3547 return isset($attrs[$name]) ? $attrs[$name] : null;
3550 public function getAttributesRecursive() {
3551 if (!isset($this->info['class'])) {
3552 return $this->getAttributes();
3555 $attrs = array();
3556 $class = $this->getDeclaringClass();
3557 $function_name = $this->info['function'];
3558 $index = $this->info['index'];
3559 self::collectAttributes(&$attrs, $class, $function_name, $index);
3560 return $attrs;
3563 private static function collectAttributes(&$attrs, $class, $function_name,
3564 $index) {
3565 if ($class->hasMethod($function_name)) {
3566 $method = $class->getMethod($function_name);
3567 $params = $method->getParameters();
3568 if (count($params) >= $index) {
3569 $attrs += $params[$index]->getAttributes();
3573 $parent = $class->getParentClass();
3574 if ($parent) {
3575 self::collectAttributes(
3576 &$attrs,
3577 $parent,
3578 $function_name,
3579 $index);
3584 ///////////////////////////////////////////////////////////////////////////////
3586 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
3588 * ( excerpt from
3589 * http://php.net/manual/en/class.reflectionfunctionabstract.php )
3591 * A parent class to ReflectionFunction, read its description for details.
3594 class ReflectionFunctionAbstract {
3595 public $info;
3597 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
3599 * ( excerpt from
3600 * http://php.net/manual/en/reflectionfunctionabstract.getname.php )
3602 * Get the name of the function. WarningThis function is currently not
3603 * documented; only its argument list is available.
3605 * @return mixed The name of the function.
3607 public function getName() {
3608 return $this->info['name'];
3611 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
3613 * ( excerpt from
3614 * http://php.net/manual/en/reflectionfunctionabstract.isinternal.php )
3616 * Checks whether the function is internal, as opposed to user-defined.
3617 * WarningThis function is currently not documented; only its argument list
3618 * is available.
3620 * @return mixed TRUE if it's internal, otherwise FALSE
3622 public function isInternal() {
3623 return isset($this->info['internal']);
3626 public function getClosure() {
3627 return $this->info['closure'];
3630 public function isClosure() {
3631 return !empty($this->info['is_closure']);
3634 public function isGenerator() {
3635 return !empty($this->info['is_generator']);
3638 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
3640 * ( excerpt from
3641 * http://php.net/manual/en/reflectionfunctionabstract.isuserdefined.php )
3643 * Checks whether the function is user-defined, as opposed to internal.
3644 * WarningThis function is currently not documented; only its argument list
3645 * is available.
3647 * @return mixed TRUE if it's user-defined, otherwise false;
3649 public function isUserDefined() {
3650 return !isset($this->info['internal']);
3653 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
3655 * ( excerpt from
3656 * http://php.net/manual/en/reflectionfunctionabstract.getfilename.php )
3658 * Gets the file name from a user-defined function. WarningThis function
3659 * is currently not documented; only its argument list is available.
3661 * @return mixed The file name.
3663 public function getFileName() {
3664 return $this->info['file'];
3667 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
3669 * ( excerpt from
3670 * http://php.net/manual/en/reflectionfunctionabstract.getstartline.php )
3672 * Gets the starting line number of the function. WarningThis function is
3673 * currently not documented; only its argument list is available.
3675 * @return mixed The starting line number.
3677 public function getStartLine() {
3678 return $this->info['line1'];
3681 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
3683 * ( excerpt from
3684 * http://php.net/manual/en/reflectionfunctionabstract.getendline.php )
3686 * Get the ending line number. WarningThis function is currently not
3687 * documented; only its argument list is available.
3689 * @return mixed The ending line number of the user defined class, or
3690 * FALSE if unknown.
3692 public function getEndLine() {
3693 return $this->info['line2'];
3696 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
3698 * ( excerpt from
3699 * http://php.net/manual/en/reflectionfunctionabstract.getdoccomment.php )
3701 * Get a Doc comment from a function. WarningThis function is currently
3702 * not documented; only its argument list is available.
3704 * @return mixed The doc comment if it exists, otherwise FALSE
3706 public function getDocComment() {
3707 return $this->info['doc'];
3710 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
3712 * ( excerpt from
3713 * http://php.net/manual/en/reflectionfunctionabstract.getstaticvariables.php
3716 * Get the static variables. WarningThis function is currently not
3717 * documented; only its argument list is available.
3719 * @return mixed An array of static variables.
3721 public function getStaticVariables() {
3722 return $this->info['static_variables'];
3725 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
3727 * ( excerpt from
3728 * http://php.net/manual/en/reflectionfunctionabstract.returnsreference.php
3731 * Checks whether the function returns a reference. WarningThis function
3732 * is currently not documented; only its argument list is available.
3734 * @return mixed TRUE if it returns a reference, otherwise FALSE
3736 public function returnsReference() {
3737 return isset($this->info['ref']);
3740 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
3742 * ( excerpt from
3743 * http://php.net/manual/en/reflectionfunctionabstract.getparameters.php )
3745 * Get the parameters as an array of ReflectionParameter. WarningThis
3746 * function is currently not documented; only its argument list is
3747 * available.
3749 * @return mixed The parameters, as a ReflectionParameter object.
3751 public function getParameters() {
3752 $ret = array();
3753 foreach ($this->info['params'] as $name => $info) {
3754 $param = new ReflectionParameter(null, null);
3755 $param->info = $info;
3756 $ret[] = $param;
3758 return $ret;
3761 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
3763 * ( excerpt from
3764 * http://php.net/manual/en/reflectionfunctionabstract.getnumberofparameters.php
3767 * Get the number of parameters that a function defines, both optional and
3768 * required. WarningThis function is currently not documented; only its
3769 * argument list is available.
3771 * @return mixed The number of parameters.
3773 public function getNumberOfParameters() {
3774 return count($this->info['params']);
3777 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
3779 * ( excerpt from
3780 * http://php.net/manual/en/reflectionfunctionabstract.getnumberofrequiredparameters.php
3783 * Get the number of required parameters that a function defines.
3784 * WarningThis function is currently not documented; only its argument list
3785 * is available.
3787 * @return mixed The number of required parameters.
3789 public function getNumberOfRequiredParameters() {
3790 $count = 0;
3791 $params = $this->getParameters();
3792 foreach ($params as $name => $param) {
3793 if ($param->isOptional()) {
3794 break;
3796 $count++;
3798 return $count;
3802 ///////////////////////////////////////////////////////////////////////////////
3803 // function
3805 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
3807 * ( excerpt from http://php.net/manual/en/class.reflectionfunction.php )
3809 * The ReflectionFunction class reports information about a function.
3811 * Parent class ReflectionFunctionAbstract has the same methods except
3812 * invoke(), invokeArgs(), export() and isDisabled().
3815 class ReflectionFunction extends ReflectionFunctionAbstract
3816 implements Reflector {
3817 const IS_DEPRECATED = 262144;
3819 public function __construct($name) {
3820 if ($name instanceof Closure) {
3821 $this->info = hphp_get_closure_info($name);
3822 } else {
3823 $this->info = hphp_get_function_info($name);
3824 if (empty($this->info)) {
3825 throw new ReflectionException("Function $name does not exist");
3830 public function __toString() {
3831 //TODO
3832 return "";
3835 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
3837 * ( excerpt from http://php.net/manual/en/reflectionfunction.export.php )
3839 * Exports a Reflected function. WarningThis function is currently not
3840 * documented; only its argument list is available.
3842 * @name mixed The reflection to export.
3843 * @ret mixed Setting to TRUE will return the export, as opposed
3844 * to emitting it. Setting to FALSE (the default) will
3845 * do the opposite.
3847 * @return mixed If the return parameter is set to TRUE, then the
3848 * export is returned as a string, otherwise NULL is
3849 * returned.
3851 public static function export($name, $ret=false) {
3852 $obj = new ReflectionFunction($name);
3853 $str = (string)$obj;
3854 if ($ret) {
3855 return $str;
3857 print $str;
3860 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
3862 * ( excerpt from http://php.net/manual/en/reflectionfunction.invoke.php )
3864 * Invokes a reflected function.
3867 public function invoke() {
3868 $args = func_get_args();
3869 if (isset($this->info['closureobj'])) {
3870 $closure = $this->info['closureobj'];
3871 return hphp_invoke_method($closure, get_class($closure),
3872 '__invoke', $args);
3874 return hphp_invoke($this->info['name'], $args);
3877 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
3879 * ( excerpt from
3880 * http://php.net/manual/en/reflectionfunction.invokeargs.php )
3882 * Invokes args. WarningThis function is currently not documented; only
3883 * its argument list is available.
3885 * @args mixed The args to invoke.
3887 public function invokeArgs($args) {
3888 if (isset($this->info['closureobj'])) {
3889 $closure = $this->info['closureobj'];
3890 return hphp_invoke_method($closure, get_class($closure),
3891 '__invoke', array_values($args));
3893 return hphp_invoke($this->info['name'], array_values($args));
3896 public function getAttribute($name) {
3897 $attrs = $this->info['attributes'];
3898 return isset($attrs[$name]) ? $attrs[$name] : null;
3901 public function getAttributes() {
3902 return $this->info['attributes'];
3905 public function getAttributeRecursive($name) {
3906 $attrs = $this->info['attributes'];
3907 return isset($attrs[$name]) ? $attrs[$name] : null;
3910 public function getAttributesRecursive() {
3911 return $this->info['attributes'];
3915 ///////////////////////////////////////////////////////////////////////////////
3916 // class
3918 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
3920 * ( excerpt from http://php.net/manual/en/class.reflectionclass.php )
3922 * The ReflectionClass class reports information about a class.
3925 class ReflectionClass implements Reflector {
3926 const IS_IMPLICIT_ABSTRACT = 16 ;
3927 const IS_EXPLICIT_ABSTRACT = 32 ;
3928 const IS_FINAL = 64 ;
3930 public $name;
3931 private $info = null;
3932 private static $fetched = array();
3934 public function __construct($name) {
3935 if (is_object($name)) {
3936 $name = get_class($name);
3939 $this->name = hphp_get_original_class_name($name);
3940 if (empty($this->name)) {
3941 throw new ReflectionException("Class $name does not exist");
3945 private function fetch($what) {
3946 if (!$this->info) {
3947 $this->info = self::fetch_recur($this->name);
3948 $this->info['properties'] += $this->info['private_properties'];
3950 return $this->info[$what];
3953 private static function fetch_recur($name) {
3954 if (isset(self::$fetched[$name])) return self::$fetched[$name];
3955 $info = hphp_get_class_info($name);
3956 if (empty($info)) {
3957 throw new ReflectionException("Class $name does not exist");
3960 $info['attributes_rec'] = $info['attributes'];
3962 $abstract = isset($info['abstract']) || isset($info['interface']);
3963 // flattening the trees, so it's easier for lookups
3964 foreach ($info['interfaces'] as $interface => $_) {
3965 $p = self::fetch_recur($interface);
3966 if ($abstract) $info['methods'] += $p['methods'];
3967 $info['constants'] += $p['constants'];
3968 $info['interfaces'] += $p['interfaces'];
3971 $parent = $info['parent'];
3972 if (!empty($parent)) {
3973 $p = self::fetch_recur($parent);
3974 if (isset($p['interface'])) {
3975 $info['interfaces'][$parent] = 1;
3976 } else {
3977 $info['properties'] += $p['properties'];
3979 $info['methods'] += $p['methods'];
3980 $info['constants'] += $p['constants'];
3981 $info['interfaces'] += $p['interfaces'];
3982 $info['attributes_rec'] += $p['attributes_rec'];
3984 self::$fetched[$name] = $info;
3985 return $info;
3988 private function check($what) {
3989 if (!$this->info) {
3990 $this->info = self::fetch_recur($this->name);
3992 return isset($this->info[$what]);
3995 private function test($what, $name) {
3996 $v = $this->fetch($what);
3997 return $v && isset($v[$name]);
4000 public function __toString() {
4001 return "";
4004 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4006 * ( excerpt from http://php.net/manual/en/reflectionclass.export.php )
4008 * Exports a reflected class. WarningThis function is currently not
4009 * documented; only its argument list is available.
4011 * @name mixed The reflection to export.
4012 * @ret mixed Setting to TRUE will return the export, as opposed
4013 * to emitting it. Setting to FALSE (the default) will
4014 * do the opposite.
4016 * @return mixed If the return parameter is set to TRUE, then the
4017 * export is returned as a string, otherwise NULL is
4018 * returned.
4020 public static function export($name, $ret=false) {
4021 $obj = new ReflectionClass($name);
4022 $str = (string)$obj;
4023 if ($ret) {
4024 return $str;
4026 print $str;
4029 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4031 * ( excerpt from http://php.net/manual/en/reflectionclass.getname.php )
4033 * Gets the class name. WarningThis function is currently not documented;
4034 * only its argument list is available.
4036 * @return mixed The class name.
4038 public function getName() {
4039 return $this->name;
4042 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4044 * ( excerpt from http://php.net/manual/en/reflectionclass.isinternal.php )
4046 * Checks whether the class is internal, as opposed to user-defined.
4047 * WarningThis function is currently not documented; only its argument list
4048 * is available.
4050 * @return mixed Returns TRUE on success or FALSE on failure.
4052 public function isInternal() {
4053 return $this->check('internal');
4056 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4058 * ( excerpt from
4059 * http://php.net/manual/en/reflectionclass.isuserdefined.php )
4061 * Checks whether the class is user-defined, as opposed to internal.
4063 * @return mixed Returns TRUE on success or FALSE on failure.
4065 public function isUserDefined() {
4066 return !$this->check('internal');
4069 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4071 * ( excerpt from
4072 * http://php.net/manual/en/reflectionclass.isinstantiable.php )
4074 * Checks if the class is instanciable. WarningThis function is currently
4075 * not documented; only its argument list is available.
4077 * @return mixed Returns TRUE on success or FALSE on failure.
4079 public function isInstantiable() {
4080 return !$this->check('abstract');
4083 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4085 * ( excerpt from http://php.net/manual/en/reflectionclass.hasconstant.php
4088 * Checks whether the class has a specific constant defined or not.
4090 * @name mixed The name of the constant being checked for.
4092 * @return mixed TRUE if the constant is defined, otherwise FALSE.
4094 public function hasConstant($name) {
4095 return $this->test('constants', $name);
4098 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4100 * ( excerpt from http://php.net/manual/en/reflectionclass.hasmethod.php )
4102 * Checks whether a specific method is defined in a class.
4104 * @name mixed Name of the method being checked for.
4106 * @return mixed TRUE if it has the method, otherwise FALSE
4108 public function hasMethod($name) {
4109 return $this->test('methods', strtolower($name));
4112 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4114 * ( excerpt from http://php.net/manual/en/reflectionclass.hasproperty.php
4117 * Checks whether the specified property is defined.
4119 * @name mixed Name of the property being checked for.
4121 * @return mixed TRUE if it has the property, otherwise FALSE
4123 public function hasProperty($name) {
4124 return $this->test('properties', $name);
4127 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4129 * ( excerpt from http://php.net/manual/en/reflectionclass.getfilename.php
4132 * Gets the filename of the file in which the class has been defined.
4134 * @return mixed Returns the filename of the file in which the class
4135 * has been defined. If the class is defined in the PHP
4136 * core or in a PHP extension, FALSE is returned.
4138 public function getFileName() {
4139 return $this->fetch('file');
4142 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4144 * ( excerpt from http://php.net/manual/en/reflectionclass.getstartline.php
4147 * Get the starting line number. WarningThis function is currently not
4148 * documented; only its argument list is available.
4150 * @return mixed The starting line number, as an integer.
4152 public function getStartLine() {
4153 return $this->fetch('line1');
4156 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4158 * ( excerpt from http://php.net/manual/en/reflectionclass.getendline.php )
4160 * Gets end line number from a user-defined class definition.
4162 * @return mixed The ending line number of the user defined class, or
4163 * FALSE if unknown.
4165 public function getEndLine() {
4166 return $this->fetch('line2');
4169 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4171 * ( excerpt from
4172 * http://php.net/manual/en/reflectionclass.getdoccomment.php )
4174 * Gets doc comments from a class. WarningThis function is currently not
4175 * documented; only its argument list is available.
4177 * @return mixed The doc comment if it exists, otherwise FALSE
4179 public function getDocComment() {
4180 return $this->fetch('doc');
4183 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4185 * ( excerpt from
4186 * http://php.net/manual/en/reflectionclass.getconstructor.php )
4188 * Gets the constructor from a class. WarningThis function is currently
4189 * not documented; only its argument list is available.
4191 * @return mixed A ReflectionMethod object.
4193 public function getConstructor() {
4194 if ($this->hasMethod('__construct')) {
4195 return $this->getMethod('__construct');
4197 if (!$this->isTrait() && $this->hasMethod($name = $this->name)) {
4198 return $this->getMethod($name);
4200 return null;
4203 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4205 * ( excerpt from http://php.net/manual/en/reflectionclass.getmethod.php )
4207 * Gets a ReflectionMethod about a method. WarningThis function is
4208 * currently not documented; only its argument list is available.
4210 * @name mixed The method name to reflect.
4212 * @return mixed A ReflectionMethod.
4214 public function getMethod($name) {
4215 if (!$this->info) {
4216 $method = hphp_get_method_info($this->name, $name);
4217 } else {
4218 $lname = strtolower($name);
4219 $methods = $this->info['methods'];
4220 if (isset($methods[$lname])) $method = $methods[$lname];
4222 if (empty($method)) {
4223 $class = $this->name;
4224 throw new ReflectionException("Method $class::$name does not exist");
4227 $ret = new ReflectionMethod(null, null);
4228 $ret->info = $method;
4229 $ret->name = $method['name'];
4230 $ret->class = $method['class'];
4231 return $ret;
4234 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4236 * ( excerpt from http://php.net/manual/en/reflectionclass.getmethods.php )
4238 * Gets a list of methods. WarningThis function is currently not
4239 * documented; only its argument list is available.
4241 * @filter mixed Any combination of ReflectionMethod::IS_STATIC,
4242 * ReflectionMethod::IS_PUBLIC,
4243 * ReflectionMethod::IS_PROTECTED,
4244 * ReflectionMethod::IS_PRIVATE,
4245 * ReflectionMethod::IS_ABSTRACT,
4246 * ReflectionMethod::IS_FINAL.
4248 * @return mixed An array of methods.
4250 public function getMethods($filter = 0xFFFF) {
4251 $ret = array();
4252 $methods = $this->fetch('methods');
4253 foreach ($methods as $name => $_) {
4254 $m = $this->getMethod($name);
4255 if ((($filter & ReflectionMethod::IS_PUBLIC)) && $m->isPublic() ||
4256 (($filter & ReflectionMethod::IS_PROTECTED)) && $m->isProtected() ||
4257 (($filter & ReflectionMethod::IS_PRIVATE)) && $m->isPrivate() ||
4258 (($filter & ReflectionMethod::IS_STATIC)) && $m->isStatic() ||
4259 (($filter & ReflectionMethod::IS_FINAL)) && $m->isFinal() ||
4260 (($filter & ReflectionMethod::IS_ABSTRACT && $m->isAbstract()))) {
4261 $ret[] = $m;
4264 return $ret;
4267 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4269 * ( excerpt from http://php.net/manual/en/reflectionclass.getproperty.php
4272 * Gets a property. WarningThis function is currently not documented; only
4273 * its argument list is available.
4275 * @name mixed The property name.
4277 * @return mixed A ReflectionProperty.
4279 public function getProperty($name) {
4280 $properties = $this->fetch('properties');
4281 if (!isset($properties[$name])) {
4282 $class = $this->info['name'];
4283 throw new ReflectionException("Property $class::$name does not exist");
4286 $ret = new ReflectionProperty(null, null);
4287 $ret->info = $properties[$name];
4288 $ret->name = $name;
4289 $ret->class = $this->info['name'];
4290 return $ret;
4293 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4295 * ( excerpt from
4296 * http://php.net/manual/en/reflectionclass.getproperties.php )
4298 * Retrieves reflected properties.
4300 * @return mixed An array of ReflectionProperty objects.
4302 public function getProperties($filter = 0xFFFF) {
4303 $ret = array();
4304 foreach ($this->fetch('properties') as $name => $_) {
4305 $p = $this->getProperty($name);
4306 if (($filter & ReflectionProperty::IS_PUBLIC) && $p->isPublic() ||
4307 ($filter & ReflectionProperty::IS_PROTECTED) && $p->isProtected() ||
4308 ($filter & ReflectionProperty::IS_PRIVATE) && $p->isPrivate() ||
4309 ($filter & ReflectionProperty::IS_STATIC) && $p->isStatic()) {
4310 $ret[] = $p;
4313 return $ret;
4316 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4318 * ( excerpt from http://php.net/manual/en/reflectionclass.getconstants.php
4321 * Gets defined constants from a class. WarningThis function is currently
4322 * not documented; only its argument list is available.
4324 * @return mixed An array of constants.
4326 public function getConstants() {
4327 return $this->fetch('constants');
4330 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4332 * ( excerpt from http://php.net/manual/en/reflectionclass.getconstant.php
4335 * Gets the defined constants. WarningThis function is currently not
4336 * documented; only its argument list is available.
4338 * @name mixed
4340 public function getConstant($name) {
4341 $constants = $this->fetch('constants');
4342 if (!isset($constants[$name])) {
4343 $class = $this->info['name'];
4344 throw new ReflectionException("Class constant $class::$name does not exist");
4346 return $constants[$name];
4349 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4351 * ( excerpt from
4352 * http://php.net/manual/en/reflectionclass.getinterfaces.php )
4354 * Gets the interfaces.
4356 * @return mixed An associative array of interfaces, with keys as
4357 * interface names and the array values as
4358 * ReflectionClass objects.
4360 public function getInterfaces() {
4361 $ret = array();
4362 foreach ($this->fetch('interfaces') as $name => $_) {
4363 $cls = new ReflectionClass($name);
4364 if ($cls->isInterface()) {
4365 $ret[$cls->getName()] = $cls;
4368 return $ret;
4371 public function getTraits() {
4372 $ret = array();
4373 foreach ($this->fetch('traits') as $name => $_) {
4374 $cls = new ReflectionClass($name);
4375 if ($cls->isTrait()) {
4376 $ret[$cls->getName()] = $cls;
4379 return $ret;
4382 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4384 * ( excerpt from
4385 * http://php.net/manual/en/reflectionclass.getinterfacenames.php )
4387 * Get the interface names.
4389 * @return mixed A numerical array with interface names as the
4390 * values.
4392 public function getInterfaceNames() {
4393 $ret = array();
4394 foreach ($this->fetch('interfaces') as $name => $_) {
4395 $cls = new ReflectionClass($name);
4396 if ($cls->isInterface()) {
4397 $ret[] = $cls->getName();
4400 return $ret;
4403 public function getTraitNames() {
4404 $ret = array();
4405 foreach ($this->fetch('traits') as $name => $_) {
4406 $cls = new ReflectionClass($name);
4407 if ($cls->isTrait()) {
4408 $ret[] = $cls->getName();
4411 return $ret;
4414 public function getTraitAliases() {
4415 $ret = array();
4416 foreach ($this->fetch('trait_aliases') as $old_name => $new_name) {
4417 $ret[$old_name] = $new_name;
4419 return $ret;
4422 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4424 * ( excerpt from http://php.net/manual/en/reflectionclass.isinterface.php
4427 * Checks whether the class is an interface. WarningThis function is
4428 * currently not documented; only its argument list is available.
4430 * @return mixed Returns TRUE on success or FALSE on failure.
4432 public function isInterface() {
4433 return $this->check('interface');
4436 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4438 * ( excerpt from http://php.net/manual/en/reflectionclass.isabstract.php )
4440 * Checks if the class is abstract.
4442 * @return mixed Returns TRUE on success or FALSE on failure.
4444 public function isAbstract() {
4445 return $this->check('abstract');
4448 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4450 * ( excerpt from http://php.net/manual/en/reflectionclass.isfinal.php )
4452 * Checks if a class is final.
4454 * @return mixed Returns TRUE on success or FALSE on failure.
4456 public function isFinal() {
4457 return $this->check('final');
4460 public function isTrait() {
4461 return $this->check('trait');
4464 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4466 * ( excerpt from http://php.net/manual/en/reflectionclass.getmodifiers.php
4469 * WarningThis function is currently not documented; only its argument
4470 * list is available.
4473 public function getModifiers() {
4474 return $this->fetch('modifiers');
4477 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4479 * ( excerpt from http://php.net/manual/en/reflectionclass.isinstance.php )
4481 * Checks if an object is an instance of a class.
4483 * @obj mixed The object being compared to.
4485 * @return mixed Returns TRUE on success or FALSE on failure.
4487 public function isInstance($obj) {
4488 return hphp_instanceof($obj, $this->name);
4491 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4493 * ( excerpt from http://php.net/manual/en/reflectionclass.newinstance.php
4496 * Creates a new cass instance of the class, the given arguments are
4497 * passed to the class constructor.
4500 public function newInstance() {
4501 $args = func_get_args();
4502 return hphp_create_object($this->name, $args);
4505 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4507 * ( excerpt from
4508 * http://php.net/manual/en/reflectionclass.newinstanceargs.php )
4510 * Creates a new cass instance of the class, the given arguments are
4511 * passed to the class constructor. WarningThis function is currently not
4512 * documented; only its argument list is available.
4514 * @args mixed The parameters to be passed to the class constructor
4515 * as an array.
4517 * @return mixed Returns a new instance of the class.
4519 public function newInstanceArgs($args) {
4520 return hphp_create_object($this->name, array_values($args));
4523 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4525 * ( excerpt from
4526 * http://php.net/manual/en/reflectionclass.newinstancewithoutconstructor.php )
4528 * Creates a new instance of the class without invoking the constructor.
4530 * @return mixed Returns a new instance of the class.
4532 public function newInstanceWithoutConstructor() {
4533 return hphp_create_object_without_constructor($this->name);
4536 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4538 * ( excerpt from
4539 * http://php.net/manual/en/reflectionclass.getparentclass.php )
4541 * WarningThis function is currently not documented; only its argument
4542 * list is available.
4544 * @return mixed A ReflectionClass.
4546 public function getParentClass() {
4547 $parent = $this->fetch('parent');
4548 if (empty($parent)) {
4549 return false;
4551 return new ReflectionClass($parent);
4554 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4556 * ( excerpt from http://php.net/manual/en/reflectionclass.issubclassof.php
4559 * Checks if the class is a subclass of a specified class.
4561 * @cls mixed The class name being checked against.
4563 * @return mixed Returns TRUE on success or FALSE on failure.
4565 public function isSubclassOf($cls) {
4566 if ($cls instanceof ReflectionClass) {
4567 $cls = $cls->name;
4569 foreach ($this->fetch('interfaces') as $name => $_) {
4570 if (strcasecmp($cls, $name) == 0) {
4571 return true;
4574 $parent = $this->fetch('parent');
4575 if (empty($parent)) {
4576 return false;
4578 if (strcasecmp($cls, $parent) == 0) {
4579 return true;
4581 return $this->getParentClass()->isSubclassOf($cls);
4584 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4586 * ( excerpt from
4587 * http://php.net/manual/en/reflectionclass.getstaticproperties.php )
4589 * Get the static properties. WarningThis function is currently not
4590 * documented; only its argument list is available.
4592 * @return mixed The static properties, as an array.
4594 public function getStaticProperties() {
4595 $ret = array();
4596 foreach ($this->getProperties() as $prop) {
4597 if ($prop->isStatic()) {
4598 $ret[$prop->name] = $prop;
4601 return $ret;
4604 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4606 * ( excerpt from
4607 * http://php.net/manual/en/reflectionclass.getstaticpropertyvalue.php )
4609 * Gets the static property values. WarningThis function is currently not
4610 * documented; only its argument list is available.
4612 * @name mixed
4613 * @default mixed
4615 public function getStaticPropertyValue($name, $default = null) {
4616 if ($this->hasProperty($name) &&
4617 $this->getProperty($name)->isStatic()) {
4618 return hphp_get_static_property($this->name, $name);
4620 return $default;
4623 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4625 * ( excerpt from
4626 * http://php.net/manual/en/reflectionclass.setstaticpropertyvalue.php )
4628 * Sets static property value. WarningThis function is currently not
4629 * documented; only its argument list is available.
4631 * @name mixed Property name.
4632 * @value mixed New property value.
4634 * @return mixed No value is returned.
4636 public function setStaticPropertyValue($name, $value) {
4637 hphp_set_static_property($this->name, $name, $value);
4640 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4642 * ( excerpt from
4643 * http://php.net/manual/en/reflectionclass.getdefaultproperties.php )
4645 * Gets default properties from a class. WarningThis function is currently
4646 * not documented; only its argument list is available.
4648 * @return mixed An array of default properties.
4650 public function getDefaultProperties() {
4651 $ret = array();
4652 foreach ($this->getProperties() as $prop) {
4653 if ($prop->isDefault()) {
4654 $ret[$prop->name] = $prop;
4657 return $ret;
4660 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4662 * ( excerpt from
4663 * http://php.net/manual/en/reflectionclass.isiterateable.php )
4665 * Checks whether the class is iterateable.
4667 * @return mixed Returns TRUE on success or FALSE on failure.
4669 public function isIterateable() {
4670 return $this->isSubclassOf('ArrayAccess');
4673 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4675 * ( excerpt from
4676 * http://php.net/manual/en/reflectionclass.implementsinterface.php )
4678 * Checks whether it implements an interface.
4680 * @cls mixed The interface name.
4682 * @return mixed Returns TRUE on success or FALSE on failure.
4684 public function implementsInterface($cls) {
4685 if ($cls instanceof ReflectionClass) {
4686 $cls = $cls->name;
4688 if (!interface_exists($cls)) {
4689 throw new ReflectionException("$cls is not an Interface");
4691 foreach ($this->fetch('interfaces') as $name => $_) {
4692 if (strcasecmp($cls, $name) == 0) {
4693 return true;
4696 return false;
4699 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4701 * ( excerpt from http://php.net/manual/en/reflectionclass.getextension.php
4704 * Gets an extensions ReflectionExtension object. WarningThis function is
4705 * currently not documented; only its argument list is available.
4707 * @return mixed A ReflectionExtension object.
4709 public function getExtension() {
4710 return $this->fetch('extension');
4713 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4715 * ( excerpt from
4716 * http://php.net/manual/en/reflectionclass.getextensionname.php )
4718 * Gets an extensions name. WarningThis function is currently not
4719 * documented; only its argument list is available.
4721 * @return mixed The extensions name.
4723 public function getExtensionName() {
4724 return $this->fetch('extension')->getName();
4727 public function getAttribute($name) {
4728 $attrs = $this->fetch('attributes');
4729 return isset($attrs[$name]) ? $attrs[$name] : null;
4732 public function getAttributes() {
4733 return $this->fetch('attributes');
4736 public function getAttributeRecursive($name) {
4737 $attrs = $this->fetch('attributes_rec');
4738 return isset($attrs[$name]) ? $attrs[$name] : null;
4741 public function getAttributesRecursive() {
4742 return $this->fetch('attributes_rec');
4746 ///////////////////////////////////////////////////////////////////////////////
4747 // object
4749 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4751 * ( excerpt from http://php.net/manual/en/class.reflectionobject.php )
4753 * The ReflectionObject class reports information about an object.
4756 class ReflectionObject extends ReflectionClass {
4757 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4759 * ( excerpt from http://php.net/manual/en/reflectionobject.export.php )
4761 * Exports a reflection. WarningThis function is currently not documented;
4762 * only its argument list is available.
4764 * @obj mixed The reflection to export.
4765 * @ret mixed Setting to TRUE will return the export, as opposed
4766 * to emitting it. Setting to FALSE (the default) will
4767 * do the opposite.
4769 * @return mixed If the return parameter is set to TRUE, then the
4770 * export is returned as a string, otherwise NULL is
4771 * returned.
4773 public static function export($obj, $ret=false) {
4774 $obj = new ReflectionObject($obj);
4775 $str = (string)$obj;
4776 if ($ret) {
4777 return $str;
4779 print $str;
4783 ///////////////////////////////////////////////////////////////////////////////
4784 // property
4786 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4788 * ( excerpt from http://php.net/manual/en/class.reflectionproperty.php )
4790 * The ReflectionProperty class reports information about a classes
4791 * properties.
4794 class ReflectionProperty implements Reflector {
4795 const IS_STATIC = 1;
4796 const IS_PUBLIC = 256;
4797 const IS_PROTECTED = 512;
4798 const IS_PRIVATE = 1024;
4800 public $info;
4801 public $name;
4802 public $class;
4804 public function __construct($cls, $name) {
4805 if ($cls && $name) {
4806 if (!is_object($cls)) {
4807 $cls = new ReflectionClass($cls);
4808 } else {
4809 $cls = new ReflectionClass(get_class($cls));
4811 $prop = $cls->getProperty($name);
4812 if ($prop) {
4813 $this->info = $prop->info;
4814 $this->name = $prop->name;
4815 $this->class = $prop->class;
4820 public function __toString() {
4821 return "";
4824 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4826 * ( excerpt from http://php.net/manual/en/reflectionproperty.export.php )
4828 * Exports a reflection. WarningThis function is currently not documented;
4829 * only its argument list is available.
4831 * @cls mixed The reflection to export.
4832 * @name mixed The property name.
4833 * @ret mixed Setting to TRUE will return the export, as opposed
4834 * to emitting it. Setting to FALSE (the default) will
4835 * do the opposite.
4837 public static function export($cls, $name, $ret=false) {
4838 if (!is_object($cls)) {
4839 $cls = new ReflectionClass($cls);
4840 } else {
4841 $cls = new ReflectionClass(get_class($cls));
4843 $obj = $cls->getProperty($name);
4844 $str = (string)$obj;
4845 if ($ret) {
4846 return $str;
4848 print $str;
4851 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4853 * ( excerpt from http://php.net/manual/en/reflectionproperty.getname.php )
4855 * Gets the properties name. WarningThis function is currently not
4856 * documented; only its argument list is available.
4858 * @return mixed The name of the reflected property.
4860 public function getName() {
4861 return $this->info['name'];
4864 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4866 * ( excerpt from http://php.net/manual/en/reflectionproperty.ispublic.php
4869 * Checks whether the property is public.
4871 * @return mixed TRUE if the property is public, FALSE otherwise.
4873 public function isPublic() {
4874 return $this->info['access'] == 'public';
4877 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4879 * ( excerpt from http://php.net/manual/en/reflectionproperty.isprivate.php
4882 * Checks whether the property is private.
4884 * @return mixed TRUE if the property is private, FALSE otherwise.
4886 public function isPrivate() {
4887 return $this->info['access'] == 'private';
4890 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4892 * ( excerpt from
4893 * http://php.net/manual/en/reflectionproperty.isprotected.php )
4895 * Checks whether the property is protected.
4897 * @return mixed TRUE if the property is protected, FALSE otherwise.
4899 public function isProtected() {
4900 return $this->info['access'] == 'protected';
4903 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4905 * ( excerpt from http://php.net/manual/en/reflectionproperty.isstatic.php
4908 * Checks whether the property is static.
4910 * @return mixed TRUE if the property is static, FALSE otherwise.
4912 public function isStatic() {
4913 return isset($this->info['static']);
4916 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4918 * ( excerpt from http://php.net/manual/en/reflectionproperty.isdefault.php
4921 * Checks whether the property is the default.
4923 * @return mixed TRUE if the property was declared at compile-time,
4924 * or FALSE if it was created at run-time.
4926 public function isDefault() {
4927 return $this->info['default'];
4930 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4932 * ( excerpt from
4933 * http://php.net/manual/en/reflectionproperty.setaccessible.php )
4935 * Sets a property to be accessible. For example, it may allow protected
4936 * and private properties to be accessed.
4938 * @return mixed No value is returned.
4940 public function setAccessible($accessible) {
4941 throw new ReflectionException(__METHOD__." is not supported");
4944 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4946 * ( excerpt from
4947 * http://php.net/manual/en/reflectionproperty.getmodifiers.php )
4949 * Gets the modifiers. WarningThis function is currently not documented;
4950 * only its argument list is available.
4952 * @return mixed A numeric representation of the modifiers.
4954 public function getModifiers() {
4955 return $this->info['modifiers'];
4958 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4960 * ( excerpt from http://php.net/manual/en/reflectionproperty.getvalue.php
4963 * Gets the properties value. WarningThis function is currently not
4964 * documented; only its argument list is available.
4966 * @obj mixed The object being reflected.
4968 * @return mixed The current value of the property.
4970 public function getValue($obj = null) {
4971 if ($this->isStatic()) {
4972 return hphp_get_static_property($this->info['class'],
4973 $this->info['name']);
4975 if ($obj) {
4976 return hphp_get_property($obj, $this->info['class'],
4977 $this->info['name']);
4979 return null;
4982 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
4984 * ( excerpt from http://php.net/manual/en/reflectionproperty.setvalue.php
4987 * Sets (changes) a properties value. WarningThis function is currently
4988 * not documented; only its argument list is available.
4990 * @obj mixed The object name.
4991 * @value mixed The new value.
4993 * @return mixed No value is returned.
4995 public function setValue($obj, $value) {
4996 if ($this->isStatic()) {
4997 hphp_set_static_property($this->info['class'], $this->info['name'],
4998 $value);
4999 } else {
5000 hphp_set_property($obj, $this->info['class'], $this->info['name'],
5001 $value);
5005 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
5007 * ( excerpt from
5008 * http://php.net/manual/en/reflectionproperty.getdeclaringclass.php )
5010 * Gets the declaring class. WarningThis function is currently not
5011 * documented; only its argument list is available.
5013 * @return mixed A ReflectionClass object.
5015 public function getDeclaringClass() {
5016 if (empty($this->info['class'])) {
5017 return null;
5019 return new ReflectionClass($this->info['class']);
5022 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
5024 * ( excerpt from
5025 * http://php.net/manual/en/reflectionproperty.getdoccomment.php )
5027 * Gets the doc comment. WarningThis function is currently not documented;
5028 * only its argument list is available.
5030 * @return mixed The doc comment.
5032 public function getDocComment() {
5033 return $this->info['doc'];
5037 ///////////////////////////////////////////////////////////////////////////////
5038 // method
5040 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
5042 * ( excerpt from http://php.net/manual/en/class.reflectionmethod.php )
5044 * The ReflectionMethod class reports information about a method.
5047 class ReflectionMethod extends ReflectionFunctionAbstract
5048 implements Reflector {
5049 const IS_STATIC = 1;
5050 const IS_PUBLIC = 256;
5051 const IS_PROTECTED = 512;
5052 const IS_PRIVATE = 1024;
5053 const IS_ABSTRACT = 2;
5054 const IS_FINAL = 4;
5056 public $name;
5057 public $class;
5059 public function __construct($cls, $name = '') {
5060 if (!$name && is_string($cls)) {
5061 $arr = explode('::', $cls);
5062 if (count($arr) == 2) {
5063 $cls = $arr[0];
5064 $name = $arr[1];
5067 if ($cls && $name) {
5068 $method = hphp_get_method_info($cls, $name);
5069 if (!$method) {
5070 throw new ReflectionException("Method $cls::$name does not exist");
5073 $this->info = $method;
5074 $this->name = $method['name'];
5075 $this->class = $method['class'];
5079 public function __toString() {
5080 //TODO
5081 return "";
5084 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
5086 * ( excerpt from http://php.net/manual/en/reflectionmethod.export.php )
5088 * Exports a ReflectionMethod. WarningThis function is currently not
5089 * documented; only its argument list is available.
5091 * @cls mixed The class name.
5092 * @name mixed The name of the method.
5093 * @ret mixed Setting to TRUE will return the export, as opposed
5094 * to emitting it. Setting to FALSE (the default) will
5095 * do the opposite.
5097 * @return mixed If the return parameter is set to TRUE, then the
5098 * export is returned as a string, otherwise NULL is
5099 * returned.
5101 public static function export($cls, $name, $ret=false) {
5102 if (!is_object($cls)) {
5103 $cls = new ReflectionClass($cls);
5104 } else {
5105 $cls = new ReflectionClass(get_class($cls));
5107 $obj = $cls->getMethod($name);
5108 $str = (string)$obj;
5109 if ($ret) {
5110 return $str;
5112 print $str;
5115 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
5117 * ( excerpt from http://php.net/manual/en/reflectionmethod.invoke.php )
5119 * Invokes a reflected method.
5121 * @obj mixed The object to invoke the method on. In case of
5122 * static methods, you can pass null to this parameter.
5124 * @return mixed Returns the method result.
5126 public function invoke($obj) {
5127 $args = func_get_args();
5128 array_shift($args);
5129 return hphp_invoke_method($obj, $this->info['class'], $this->info['name'],
5130 $args);
5133 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
5135 * ( excerpt from http://php.net/manual/en/reflectionmethod.invokeargs.php
5138 * Invoke arguments.
5140 * @obj mixed The object to invoke the method on. In case of
5141 * static methods, you can pass null to this parameter.
5142 * @args mixed The parameters to be passed to the function, as an
5143 * array.
5145 * @return mixed Returns the method result.
5147 public function invokeArgs($obj, $args) {
5148 return hphp_invoke_method($obj, $this->info['class'], $this->info['name'],
5149 array_values($args));
5152 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
5154 * ( excerpt from http://php.net/manual/en/reflectionmethod.isfinal.php )
5156 * Checks if the method is final.
5158 * @return mixed TRUE if the method is final, otherwise FALSE
5160 public function isFinal() {
5161 return isset($this->info['final']);
5164 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
5166 * ( excerpt from http://php.net/manual/en/reflectionmethod.isabstract.php
5169 * Checks if the method is abstract.
5171 * @return mixed TRUE if the method is abstract, otherwise FALSE
5173 public function isAbstract() {
5174 return isset($this->info['abstract']);
5177 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
5179 * ( excerpt from http://php.net/manual/en/reflectionmethod.ispublic.php )
5181 * Checks if the method is public.
5183 * @return mixed TRUE if the method is public, otherwise FALSE
5185 public function isPublic() {
5186 return $this->info['access'] == "public";
5189 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
5191 * ( excerpt from http://php.net/manual/en/reflectionmethod.isprivate.php )
5193 * Checks if the method is private. WarningThis function is currently not
5194 * documented; only its argument list is available.
5196 * @return mixed TRUE if the method is private, otherwise FALSE
5198 public function isPrivate() {
5199 return $this->info['access'] == "private";
5202 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
5204 * ( excerpt from http://php.net/manual/en/reflectionmethod.isprotected.php
5207 * Checks if the method is protected.
5209 * @return mixed TRUE if the method is protected, otherwise FALSE
5211 public function isProtected() {
5212 return $this->info['access'] == "protected";
5215 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
5217 * ( excerpt from http://php.net/manual/en/reflectionmethod.isstatic.php )
5219 * Checks if the method is static.
5221 * @return mixed TRUE if the method is static, otherwise FALSE
5223 public function isStatic() {
5224 return isset($this->info['static']);
5227 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
5229 * ( excerpt from
5230 * http://php.net/manual/en/reflectionmethod.isconstructor.php )
5232 * Checks if the method is a constructor.
5234 * @return mixed TRUE if the method is a constructor, otherwise FALSE
5236 public function isConstructor() {
5237 return isset($this->info['constructor']);
5240 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
5242 * ( excerpt from
5243 * http://php.net/manual/en/reflectionmethod.isdestructor.php )
5245 * Checks if the method is a destructor.
5247 * @return mixed TRUE if the method is a destructor, otherwise FALSE
5249 public function isDestructor() {
5250 return $this->getName() == '__destruct';
5253 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
5255 * ( excerpt from
5256 * http://php.net/manual/en/reflectionmethod.getmodifiers.php )
5258 * Gets the method modifiers.
5260 * @return mixed A numeric representation of the modifiers. The
5261 * modifiers are listed below. The actual meanings of
5262 * these modifiers are described in the predefined
5263 * constants. ReflectionMethod modifiers value constant
5264 * 1 ReflectionMethod::IS_STATIC 2
5265 * ReflectionMethod::IS_ABSTRACT 4
5266 * ReflectionMethod::IS_FINAL 256
5267 * ReflectionMethod::IS_PUBLIC 512
5268 * ReflectionMethod::IS_PROTECTED 1024
5269 * ReflectionMethod::IS_PRIVATE
5271 public function getModifiers() {
5272 return $this->info['modifiers'];
5275 public function getClosure() {
5276 return $this->info['closure'];
5279 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
5281 * ( excerpt from
5282 * http://php.net/manual/en/reflectionmethod.getdeclaringclass.php )
5284 * Gets the declaring class for the reflected method.
5286 * @return mixed A ReflectionClass object of the class that the
5287 * reflected method is part of.
5289 public function getDeclaringClass() {
5290 if (empty($this->info['class'])) {
5291 return null;
5293 return new ReflectionClass($this->info['class']);
5296 public function getAttribute($name) {
5297 $attrs = $this->info['attributes'];
5298 return isset($attrs[$name]) ? $attrs[$name] : null;
5301 public function getAttributes() {
5302 return $this->info['attributes'];
5305 public function getAttributeRecursive($name) {
5306 $attrs = $this->info['attributes'];
5307 if (isset($attrs[$name])) {
5308 return $attrs[$name];
5310 $p = get_parent_class($this->class);
5311 if ($p === false) {
5312 return null;
5314 $rm = new ReflectionMethod($p, $this->name);
5315 if ($rm->isPrivate()) {
5316 return null;
5318 return $rm->getAttributeRecursive($name);
5321 public function getAttributesRecursive() {
5322 $attrs = $this->info['attributes'];
5323 $p = get_parent_class($this->class);
5324 if ($p !== false) {
5325 $rm = new ReflectionMethod($p, $this->name);
5326 if (!$rm->isPrivate()) {
5327 $attrs += $rm->getAttributesRecursive();
5330 return $attrs;
5334 ///////////////////////////////////////////////////////////////////////////////
5335 // extension
5337 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
5339 * ( excerpt from http://php.net/manual/en/class.reflectionextension.php )
5341 * The ReflectionExtension class reports information about an extension.
5344 class ReflectionExtension implements Reflector {
5345 private $name;
5346 private $info;
5348 public function __construct($name) {
5349 $this->info = hphp_get_extension_info($name);
5352 public function __toString() {
5353 return "";
5356 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
5358 * ( excerpt from http://php.net/manual/en/reflectionextension.export.php )
5360 * Exports a reflected extension. The output format of this function is
5361 * the same as the CLI argument --re [extension].
5363 * @name mixed The reflection to export.
5364 * @ret mixed Setting to TRUE will return the export, as opposed
5365 * to emitting it. Setting to FALSE (the default) will
5366 * do the opposite.
5368 * @return mixed If the return parameter is set to TRUE, then the
5369 * export is returned as a string, otherwise NULL is
5370 * returned.
5372 public static function export($name, $ret=false) {
5373 $obj = new ReflectionExtension($name);
5374 $str = (string)$obj;
5375 if ($ret) {
5376 return $str;
5378 print $str;
5381 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
5383 * ( excerpt from http://php.net/manual/en/reflectionextension.getname.php
5386 * Gets the extensions name.
5388 * @return mixed The extensions name.
5390 public function getName() {
5391 return $this->info['name'];
5394 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
5396 * ( excerpt from
5397 * http://php.net/manual/en/reflectionextension.getversion.php )
5399 * Gets the version of the extension.
5401 * @return mixed The version of the extension.
5403 public function getVersion() {
5404 return $this->info['version'];
5407 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
5409 * ( excerpt from
5410 * http://php.net/manual/en/reflectionextension.getfunctions.php )
5412 * Get defined functions from an extension.
5414 * @return mixed An associative array of ReflectionFunction objects,
5415 * for each function defined in the extension with the
5416 * keys being the function names. If no function are
5417 * defined, an empty array is returned.
5419 public function getFunctions() {
5420 return $this->info['functions'];
5423 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
5425 * ( excerpt from
5426 * http://php.net/manual/en/reflectionextension.getconstants.php )
5428 * Get defined constants from an extension.
5430 * @return mixed An associative array with constant names as keys.
5432 public function getConstants() {
5433 return $this->info['constants'];
5436 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
5438 * ( excerpt from
5439 * http://php.net/manual/en/reflectionextension.getinientries.php )
5441 * Get the ini entries for an extension.
5443 * @return mixed An associative array with the ini entries as keys,
5444 * with their defined values as values.
5446 public function getINIEntries() {
5447 return $this->info['ini'];
5450 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
5452 * ( excerpt from
5453 * http://php.net/manual/en/reflectionextension.getclasses.php )
5455 * Gets a list of classes from an extension.
5457 * @return mixed An array of ReflectionClass objects, one for each
5458 * class within the extension. If no classes are
5459 * defined, an empty array is returned.
5461 public function getClasses() {
5462 return $this->info['classes'];
5465 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
5467 * ( excerpt from
5468 * http://php.net/manual/en/reflectionextension.getclassnames.php )
5470 * Gets a listing of class names as defined in the extension.
5472 * @return mixed An array of class names, as defined in the
5473 * extension. If no classes are defined, an empty array
5474 * is returned.
5476 public function getClassNames() {
5477 $ret = array();
5478 foreach ($this->info['classes'] as $cls) {
5479 $ret[] = $cls->getName();
5481 return $ret;
5484 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
5486 * ( excerpt from http://php.net/manual/en/reflectionextension.info.php )
5488 * Gets information about an extension.
5490 * @return mixed Information about the extension.
5492 public function info() {
5493 return $this->info['info'];
5497 class SoapFault extends Exception {
5498 public $faultcode;
5499 public $faultcodens;
5500 public $faultstring;
5501 public $faultactor;
5502 public $detail;
5503 public $_name;
5504 public $headerfault;
5506 public function __construct($code, $message, $actor = null, $detail = null,
5507 $name = null, $header = null) {
5508 $fault_ns = null;
5509 $fault_code = null;
5510 if (is_string($code)) {
5511 $fault_code = $code;
5512 } else if (is_array($code) && count($code) == 2) {
5513 $code = array_values($code);
5514 $fault_ns = $code[0];
5515 $fault_code = $code[1];
5516 if (!is_string($fault_ns) || !is_string($fault_code)) {
5517 hphp_throw_fatal_error("Invalid fault code");
5518 return;
5520 } else {
5521 hphp_throw_fatal_error("Invalid fault code");
5522 return;
5524 $this->faultcodens = $fault_ns;
5525 $this->faultcode = $fault_code;
5526 if (empty($this->faultcode)) {
5527 hphp_throw_fatal_error("Invalid fault code");
5528 return;
5531 $this->faultstring = $this->message = $message;
5532 $this->faultactor = $actor;
5533 $this->detail = $detail;
5534 $this->_name = $name;
5535 $this->headerfault = $header;
5537 $SOAP_1_1 = 1;
5538 $SOAP_1_2 = 2;
5539 $SOAP_1_1_ENV_NAMESPACE = 'http://schemas.xmlsoap.org/soap/envelope/';
5540 $SOAP_1_2_ENV_NAMESPACE = 'http://www.w3.org/2003/05/soap-envelope';
5542 $soap_version = _soap_active_version();
5543 if (empty($this->faultcodens)) {
5544 if ($soap_version == $SOAP_1_1) {
5545 if ($this->faultcode == "Client" ||
5546 $this->faultcode == "Server" ||
5547 $this->faultcode == "VersionMismatch" ||
5548 $this->faultcode == "MustUnderstand") {
5549 $this->faultcodens = $SOAP_1_1_ENV_NAMESPACE;
5551 } else if ($soap_version == $SOAP_1_2) {
5552 if ($this->faultcode == "Client") {
5553 $this->faultcode = "Sender";
5554 $this->faultcodens = $SOAP_1_2_ENV_NAMESPACE;
5555 } else if ($this->faultcode == "Server") {
5556 $this->faultcode = "Receiver";
5557 $this->faultcodens = $SOAP_1_2_ENV_NAMESPACE;
5558 } else if ($this->faultcode == "VersionMismatch" ||
5559 $this->faultcode == "MustUnderstand" ||
5560 $this->faultcode == "DataEncodingUnknown") {
5561 $this->faultcodens = $SOAP_1_2_ENV_NAMESPACE;
5567 public function __toString() {
5568 return "SoapFault exception: [" . $this->faultcode . "] " .
5569 $this->faultstring;
5573 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
5575 * ( excerpt from http://php.net/manual/en/class.splobjectstorage.php )
5577 * The SplObjectStorage class provides a map from objects to data or, by
5578 * ignoring data, an object set. This dual purpose can be useful in many
5579 * cases involving the need to uniquely identify objects.
5582 class SplObjectStorage implements Iterator, Countable {
5583 private $storage = array();
5584 private $index = 0;
5586 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
5588 * ( excerpt from http://php.net/manual/en/splobjectstorage.rewind.php )
5590 * Rewind the iterator to the first storage element.
5592 * @return mixed No value is returned.
5594 function rewind() {
5595 rewind($this->storage);
5598 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
5600 * ( excerpt from http://php.net/manual/en/splobjectstorage.valid.php )
5602 * Returns if the current iterator entry is valid.
5604 * @return mixed Returns TRUE if the iterator entry is valid, FALSE
5605 * otherwise.
5607 function valid() {
5608 return key($this->storage) !== false;
5611 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
5613 * ( excerpt from http://php.net/manual/en/splobjectstorage.key.php )
5615 * Returns the index at which the iterator currently is.
5617 * @return mixed The index corresponding to the position of the
5618 * iterator.
5620 function key() {
5621 return $this->index;
5624 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
5626 * ( excerpt from http://php.net/manual/en/splobjectstorage.current.php )
5628 * Returns the current storage entry.
5630 * @return mixed The object at the current iterator position.
5632 function current() {
5633 return current($this->storage);
5636 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
5638 * ( excerpt from http://php.net/manual/en/splobjectstorage.next.php )
5640 * Moves the iterator to the next object in the storage.
5642 * @return mixed No value is returned.
5644 function next() {
5645 next($this->storage);
5646 $this->index++;
5649 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
5651 * ( excerpt from http://php.net/manual/en/splobjectstorage.count.php )
5653 * Counts the number of objects in the storage.
5655 * @return mixed The number of objects in the storage.
5657 function count() {
5658 return count($this->storage);
5661 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
5663 * ( excerpt from http://php.net/manual/en/splobjectstorage.contains.php )
5665 * Checks if the storage contains the object provided.
5667 * @obj mixed The object to look for.
5669 * @return mixed Returns TRUE if the object is in the storage, FALSE
5670 * otherwise.
5672 function contains($obj) {
5673 if (is_object($obj)) {
5674 foreach($this->storage as $object) {
5675 if ($object === $obj) {
5676 return true;
5680 return false;
5683 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
5685 * ( excerpt from http://php.net/manual/en/splobjectstorage.attach.php )
5687 * Adds an object inside the storage, and optionaly associate it to some
5688 * data.
5690 * @obj mixed The object to add.
5692 * @return mixed No value is returned.
5694 function attach($obj) {
5695 if (is_object($obj) && !$this->contains($obj)) {
5696 $this->storage[] = $obj;
5700 // Do NOT modifiy this doc comment block generated by idl/sysdoc.php
5702 * ( excerpt from http://php.net/manual/en/splobjectstorage.detach.php )
5704 * Removes the object from the storage.
5706 * @obj mixed The object to remove.
5708 * @return mixed No value is returned.
5710 function detach($obj) {
5711 if (is_object($obj)) {
5712 foreach($this->storage as $idx => $object) {
5713 if ($object === $obj) {
5714 unset($this->storage[$idx]);
5715 $this->rewind();
5716 return;
5724 * Helps application inserting an artificial frame in xhprof's reporting.
5726 class XhprofFrame {
5727 public function __construct($name) {
5728 xhprof_frame_begin($name);
5730 public function __destruct() {
5731 xhprof_frame_end();
5735 // Used as a sentinel type in 86pinit().
5736 class __pinitSentinel {
5739 // Used to represent resources
5740 class __resource {
5741 public function __toString() {
5742 return hphp_to_string($this);