SPL-StandardPHPLibrary
spl.php
Go to the documentation of this file.
1 <?php
2 
180 function spl_autoload(string $class_name, string $file_extensions = NULL) {};
181 
188 function spl_autoload_call(string $class_name) {};
189 
199 function spl_autoload_extensions($file_extensions) {};
200 
208 
217 function spl_autoload_register(string $autoload_function = "spl_autoload", $throw = true) {};
218 
226 function spl_autoload_unregister(string $autoload_function = "spl_autoload") {};
227 
234 function spl_classes() {};
235 
243 
252 function iterator_to_array(Traversable $it, $use_keys = true) {};
253 
259 {
261  protected $message;
262 
264  private $string;
265 
267  protected $code;
268 
270  protected $file;
271 
273  protected $line;
274 
276  private $trace;
277 
280  final private function __clone() {}
281 
287  function __construct($message = NULL, $code = 0) {
288  if (func_num_args()) {
289  $this->message = $message;
290  }
291  $this->code = $code;
292  $this->file = __FILE__; // of throw clause
293  $this->line = __LINE__; // of throw clause
294  $this->trace = debug_backtrace();
295  $this->string = StringFormat($this);
296  }
297 
300  final public function getMessage()
301  {
302  return $this->message;
303  }
304 
307  final public function getCode()
308  {
309  return $this->code;
310  }
311 
314  final public function getFile()
315  {
316  return $this->file;
317  }
318 
321  final public function getLine()
322  {
323  return $this->line;
324  }
325 
328  final public function getTrace()
329  {
330  return $this->trace;
331  }
332 
335  final public function getTraceAsString()
336  {
337  }
338 
341  public function __toString()
342  {
343  return $this->string;
344  }
345 }
346 
354 {
355 }
356 
362 {
363 }
364 
370 {
371 }
372 
383 {
384 }
385 
393 {
394 }
395 
404 {
405 }
406 
416 {
417 }
418 
424 {
425 }
426 
436 {
437 }
438 
444 {
445 }
446 
457 {
458 }
459 
465 {
466 }
467 
479 {
480 }
481 
486 interface ArrayAccess
487 {
491  function offsetSet($offset, $value);
492 
496  function offsetGet($offset);
497 
500  function offsetUnset($offset);
501 
505  function offsetExists($offset);
506 }
507 
523 interface Traversable
524 {
525 }
526 
534 {
537  function getIterator();
538 }
539 
549 interface Iterator extends Traversable
550 {
553  function rewind();
554 
557  function current();
558 
561  function key();
562 
565  function next();
566 
569  function valid();
570 }
571 
576 interface Countable
577 {
580  function count();
581 }
582 
595 interface Serializable
596 {
600  function serialize();
601 
607  function unserialize($serialized);
608 }
609 
621 {
624  const STD_PROP_LIST = 0x00000001;
626  const ARRAY_AS_PROPS = 0x00000002;
627 
635  function __construct($array, $flags = 0, $iterator_class = "ArrayIterator") {}
636 
644  function setFlags($flags) {}
645 
648  function getFlags() {}
649 
652  function asort() {}
653 
656  function ksort() {}
657 
660  function uasort(mixed cmp_function) {}
661 
664  function uksort(mixed cmp_function) {}
665 
668  function natsort() {}
669 
672  function natcasesort() {}
673 
676  function exchangeArray($array) {}
677 
681  function getIterator() {}
682 
686  function offsetExists($index) {}
687 
691  function offsetGet($index) {}
692 
696  function offsetSet($index, $newval) {}
697 
700  function offsetUnset($index) {}
701 
706  function append($value) {}
707 
712  function getArrayCopy() {}
713 
717  function count() {}
718 
719  /* @param $iterator_class new class used in getIterator()
720  */
721  function setIteratorClass($itertor_class) {}
722 
723  /* @return class used in getIterator()
724  */
725  function getIteratorClass() {}
726 }
727 
742 {
745  const STD_PROP_LIST = 0x00000001;
747  const ARRAY_AS_PROPS = 0x00000002;
748 
755  function __construct($array, $flags = 0) {}
756 
764  function setFlags($flags) {}
765 
769  function getFlags() {}
770 
773  function asort() {}
774 
777  function ksort() {}
778 
781  function uasort(mixed cmp_function) {}
782 
785  function uksort(mixed cmp_function) {}
786 
789  function natsort() {}
790 
793  function natcasesort() {}
794 
798  function offsetExists($index) {}
799 
803  function offsetGet($index) {}
804 
808  function offsetSet($index, $newval) {}
809 
812  function offsetUnset($index) {}
813 
818  function append($value) {}
819 
824  function getArrayCopy() {}
825 
829  function seek($position) {}
830 
834  function count() {}
835 
837  function rewind() {}
838 
840  function valid() {}
841 
843  function current() {}
844 
846  function key() {}
847 
849  function next() {}
850 }
851 
857 {
862  function __construct($file_name) {}
863 
866  function getPath() {}
867 
870  function getFilename() {}
871 
876  function getFileInfo(string class_name = NULL) {}
877 
880  function getPathname() {}
881 
886  function getPathInfo(string class_name = NULL) {}
887 
890  function getPerms() {}
891 
894  function getInode() {}
895 
898  function getSize() {}
899 
902  function getOwner() {}
903 
906  function getGroup() {}
907 
910  function getATime() {}
911 
914  function getMTime() {}
915 
918  function getCTime() {}
919 
922  function getType() {}
923 
926  function isWritable() {}
927 
930  function isReadable() {}
931 
934  function isExecutable() {}
935 
938  function isFile() {}
939 
942  function isDir() {}
943 
946  function isLink() {}
947 
950  function getLinkTarget() {}
951 
954  function getRealPath() {}
955 
958  function __toString() {}
959 
973  function openFile($mode = 'r', $use_include_path = false, $context = NULL) {}
974 
978  function setFileClass(string class_name = "SplFileObject") {}
979 
983  function setInfoClass(string class_name = "SplFileInfo") {}
984 }
985 
991 class DirectoryIterator extends SplFileInfo implements Iterator
992 {
997  function __construct($path) {}
998 
1000  function rewind() {}
1001 
1003  function valid() {}
1004 
1007  function key() {}
1008 
1011  function current() {}
1012 
1014  function next() {}
1015 
1018  function isDot() {}
1019 
1022  function isLink() {}
1023 
1026  function __toString() {}
1027 }
1028 
1035 {
1036  const CURRENT_AS_FILEINFO 0x00000000; /* make RecursiveDirectoryTree::current() return SplFileInfo */
1037  const CURRENT_AS_SELF 0x00000010; /* make RecursiveDirectoryTree::current() return getSelf() */
1038  const CURRENT_AS_PATHNAME 0x00000020; /* make RecursiveDirectoryTree::current() return getPathname() */
1039 
1040  const KEY_AS_PATHNAME 0x00000000; /* make RecursiveDirectoryTree::key() return getPathname() */
1041  const KEY_AS_FILENAME 0x00000100; /* make RecursiveDirectoryTree::key() return getFilename() */
1042 
1043  const NEW_CURRENT_AND_KEY 0x00000100; /* CURRENT_AS_FILEINFO + KEY_AS_FILENAME */
1044 
1056  function __construct($path, $flags = 0) {}
1057 
1060  function key() {}
1061 
1064  function current() {}
1065 
1068  function hasChildren() {}
1069 
1072  function getChildren() {}
1073 
1076  function getSubPath() {}
1077 
1080  function getSubPathname() {}
1081 }
1082 
1094 class SimpleXMLIterator extends SimpleXMLElement implements RecursiveIterator, Countable
1095 {
1098  function hasChildren() {}
1099 
1102  function getChildren() {}
1103 
1106  function count() {}
1107 
1109  function rewind() {}
1110 
1112  function valid() {}
1113 
1115  function current() {}
1116 
1118  function key() {}
1119 
1121  function next() {}
1122 }
1123 
1134 interface SplObserver
1135 {
1139  function update(SplSubject $subject);
1140 }
1141 
1147 interface SplSubject
1148 {
1151  function attach(SplObserver $observer);
1152 
1156  function detach(SplObserver $observer);
1157 
1160  function notify();
1161 }
1162 
1163 ?>
__construct($array, $flags=0)
Construct a new array iterator from anything that has a hash table.
Definition: spl.php:755
setInfoClass(string class_name="SplFileInfo")
Definition: spl.php:983
__construct($path, $flags=0)
Construct a directory iterator from a path-string.
Definition: spl.php:1056
Exception thrown to indicate an unexpected value.
Definition: spl.php:478
getFilename()
Definition: spl.php:870
const STD_PROP_LIST
Properties of the object have their normal functionality when accessed as list (var_dump, foreach, etc.)
Definition: spl.php:624
offsetGet($index)
Definition: spl.php:803
spl_autoload_register(string $autoload_function="spl_autoload", $throw=true)
Register given function as autoload implementation.
Definition: spl.php:217
natcasesort()
Sort the entries by values using case insensitive &quot;natural order&quot; algorithm.
Definition: spl.php:672
Interface to override array access of objects.
Definition: spl.php:486
Interface for customized serializing.
Definition: spl.php:595
$code
The code passed to the constructor.
Definition: spl.php:267
exchangeArray($array)
Definition: spl.php:676
uksort(mixed cmp_function)
Sort the entries by key using user defined function.
Definition: spl.php:785
next()
Move forward to next element.
Definition: spl.php:1014
update(SplSubject $subject)
Called from the subject (i.e.
next()
Move forward to next element.
Definition: spl.php:1121
getPath()
Definition: spl.php:866
notify()
Notify all observers.
getGroup()
Definition: spl.php:906
__construct($array, $flags=0, $iterator_class="ArrayIterator")
Construct a new array iterator from anything that has a hash table.
Definition: spl.php:635
getFlags()
Definition: spl.php:769
Interface to create an external Iterator.
Definition: spl.php:533
isDir()
Definition: spl.php:942
offsetSet($index, $newval)
Definition: spl.php:808
offsetSet($offset, $value)
offsetExists($index)
Definition: spl.php:798
getCTime()
Definition: spl.php:918
detach(SplObserver $observer)
spl_autoload_extensions($file_extensions)
Register and return default file extensions for spl_autoload.
Definition: spl.php:199
getPathInfo(string class_name=NULL)
Definition: spl.php:886
getTrace()
Definition: spl.php:328
__toString()
Definition: spl.php:341
isExecutable()
Definition: spl.php:934
getArrayCopy()
Definition: spl.php:824
const STD_PROP_LIST
Properties of the object have their normal functionality when accessed as list (var_dump, foreach, etc.)
Definition: spl.php:745
offsetSet($index, $newval)
Definition: spl.php:696
Exception that denotes a value not in the valid domain was used.
Definition: spl.php:382
isLink()
Definition: spl.php:946
current()
Return the current element.
recursive SimpleXML_Element iterator
Definition: spl.php:1094
seekable iterator
getFlags()
Definition: spl.php:648
unserialize($serialized)
__toString()
Definition: spl.php:958
ksort()
Sort the entries by key.
Definition: spl.php:777
offsetGet($offset)
isFile()
Definition: spl.php:938
__construct($message=NULL, $code=0)
Construct an exception.
Definition: spl.php:287
rewind()
Rewind the Iterator to the first element.
Definition: spl.php:1000
Exception thrown when a parameter exceeds the allowed length.
Definition: spl.php:403
key()
Return the key of the current element.
Definition: spl.php:846
attach(SplObserver $observer)
Exception thrown to indicate arithmetic/buffer underflow.
Definition: spl.php:464
offsetGet($index)
Definition: spl.php:691
asort()
Sort the entries by values.
Definition: spl.php:773
$it
Definition: class_tree.php:105
offsetUnset($offset)
getCode()
Definition: spl.php:307
Exception thrown when a function call was illegal.
Definition: spl.php:361
An Array wrapper.
Definition: spl.php:620
Interface for recursive iteration with RecursiveIteratorIterator.
uasort(mixed cmp_function)
Sort the entries by values using user defined function.
Definition: spl.php:781
next()
Move forward to next element.
getArrayCopy()
Definition: spl.php:712
count()
Definition: spl.php:717
getATime()
Definition: spl.php:910
natsort()
Sort the entries by values using &quot;natural order&quot; algorithm.
Definition: spl.php:789
key()
Return the key of the current element.
Definition: spl.php:1118
$trace
The stack trace.
Definition: spl.php:276
getFile()
Definition: spl.php:314
getInode()
Definition: spl.php:894
getFileInfo(string class_name=NULL)
Definition: spl.php:876
getIterator()
Definition: spl.php:681
offsetExists($index)
Definition: spl.php:686
getPathname()
Definition: spl.php:880
append($value)
Definition: spl.php:818
setFlags($flags)
Set behavior flags.
Definition: spl.php:764
__construct($file_name)
Construct a file info object.
Definition: spl.php:862
offsetUnset($index)
Definition: spl.php:700
Directory iterator.
Definition: spl.php:991
openFile($mode= 'r', $use_include_path=false, $context=NULL)
Open the current file as a SplFileObject instance.
Definition: spl.php:973
current()
Return the current element.
Definition: spl.php:1115
seek($position)
Definition: spl.php:829
An Array iterator.
Definition: spl.php:741
natsort()
Sort the entries by values using &quot;natural order&quot; algorithm.
Definition: spl.php:668
offsetExists($offset)
isReadable()
Definition: spl.php:930
getRealPath()
Definition: spl.php:954
getLine()
Definition: spl.php:321
$file
The file name where the exception was instantiated.
Definition: spl.php:270
valid()
Check if there is a current element after calls to rewind() or next().
getMTime()
Definition: spl.php:914
getMessage()
Definition: spl.php:300
$line
The line number where the exception was instantiated.
Definition: spl.php:273
valid()
Check if there is a current element after calls to rewind() or next().
Definition: spl.php:840
spl_classes()
Return an array of classes and interfaces in SPL.
Definition: spl.php:234
getOwner()
Definition: spl.php:902
valid()
Check if there is a current element after calls to rewind() or next().
Definition: spl.php:1003
Basic iterator.
Definition: spl.php:549
natcasesort()
Sort the entries by values using case insensitive &quot;natural order&quot; algorithm.
Definition: spl.php:793
offsetUnset($index)
Definition: spl.php:812
const ARRAY_AS_PROPS
Array indices can be accessed as properties in read/write.
Definition: spl.php:626
spl_autoload_call(string $class_name)
Manual invocation of all registerd autoload functions.
Definition: spl.php:188
rewind()
Rewind the Iterator to the first element.
setFileClass(string class_name="SplFileObject")
Definition: spl.php:978
key()
Return the key of the current element.
Basic Exception class.
Definition: spl.php:258
Exception that denotes invalid arguments were passed.
Definition: spl.php:392
Exception that represents error in the program logic.
Definition: spl.php:353
append($value)
Definition: spl.php:706
Exception thrown to indicate arithmetic/buffer overflow.
Definition: spl.php:443
spl_autoload_unregister(string $autoload_function="spl_autoload")
Unregister given function as autoload implementation.
Definition: spl.php:226
getType()
Definition: spl.php:922
uasort(mixed cmp_function)
Sort the entries by values using user defined function.
Definition: spl.php:660
getPerms()
Definition: spl.php:890
ksort()
Sort the entries by key.
Definition: spl.php:656
current()
Return the current element.
Definition: spl.php:843
Subject to the observer pattern.
Definition: spl.php:1147
Exception thrown when an illegal index was requested.
Definition: spl.php:435
Exception thrown for errors that are only detectable at runtime.
Definition: spl.php:423
Exception thrown when an illegal index was requested.
Definition: spl.php:415
getTraceAsString()
Definition: spl.php:335
Exception thrown when a method call was illegal.
Definition: spl.php:369
valid()
Check if there is a current element after calls to rewind() or next().
Definition: spl.php:1112
$string
The string representations as generated during construction.
Definition: spl.php:264
rewind()
Rewind the Iterator to the first element.
Definition: spl.php:1109
rewind()
Rewind the Iterator to the first element.
Definition: spl.php:837
File info class.
Definition: spl.php:856
iterator_to_array(Traversable $it, $use_keys=true)
Copy iterator elements into an array.
Definition: spl.php:252
Exception thrown to indicate range errors during program execution.
Definition: spl.php:456
setFlags($flags)
Set behavior flags.
Definition: spl.php:644
next()
Move forward to next element.
Definition: spl.php:849
$message
The exception message.
Definition: spl.php:261
setIteratorClass($itertor_class)
Definition: spl.php:721
spl_autoload_functions()
Return all registered autoload functionns.
Definition: spl.php:207
asort()
Sort the entries by values.
Definition: spl.php:652
getSize()
Definition: spl.php:898
This Interface allows to hook into the global count() function.
Definition: spl.php:576
const ARRAY_AS_PROPS
Array indices can be accessed as properties in read/write.
Definition: spl.php:747
isWritable()
Definition: spl.php:926
__construct($path)
Construct a directory iterator from a path-string.
Definition: spl.php:997
Interface to detect a class is traversable using foreach.
Definition: spl.php:523
getLinkTarget()
Definition: spl.php:950
getIteratorClass()
Definition: spl.php:725
uksort(mixed cmp_function)
Sort the entries by key using user defined function.
Definition: spl.php:664
iterator_count(Traversable $it)
Count the elements in an iterator.
Definition: spl.php:242
recursive directory iterator
Definition: spl.php:1034
spl_autoload(string $class_name, string $file_extensions=NULL)
Default implementation for __autoload()
Definition: spl.php:180
__clone()
Prevent clone.
Definition: spl.php:280
Observer of the observer pattern.
Definition: spl.php:1134