Back to index

php5  5.3.10
Files | Classes | Functions
Internal classes

The classes and interfaces in this group are contained in the c-code of ext/SPL. More...

Files

file  appenditerator.inc
 

class AppendIterator


file  cachingiterator.inc
 

class CachingIterator


file  emptyiterator.inc
 

class EmptyIterator


file  filteriterator.inc
 

class FilterIterator


file  infiniteiterator.inc
 

class InfiniteIterator


file  iteratoriterator.inc
 

class IteratorIterator


file  limititerator.inc
 

class LimitIterator


file  multipleiterator.inc
 

class MultipleIterator


file  norewinditerator.inc
 

class NoRewindIterator


file  outeriterator.inc
 

class OuterIterator


file  parentiterator.inc
 

class FilterIterator


file  recursivecachingiterator.inc
 

class RecursiveCachingIterator


file  recursivefilteriterator.inc
 

class RecursiveFilterIterator


file  recursiveiterator.inc
 

class RecursiveIterator


file  recursiveiteratoriterator.inc
 

class RecursiveIteratorIterator


file  recursiveregexiterator.inc
 

class RegexIterator


file  recursivetreeiterator.inc
 

class RecursiveTreeIterator


file  regexiterator.inc
 

class RegexIterator


file  seekableiterator.inc
 

class SeekableIterator


file  spldoublylinkedlist.inc
 

class SplDoublyLinkedList


file  splfileobject.inc
 

class FileObject


file  splobjectstorage.inc
 

class SplObjectStorage


file  splqueue.inc
 

class SplQueue


file  splstack.inc
 

class SplStack


file  spl.php
 

Documentation of internal classes and interfaces.


Classes

class  AppendIterator
 Iterator that iterates over several iterators one after the other. More...
class  EmptyIterator
 An empty Iterator. More...
class  InfiniteIterator
 An infinite Iterator. More...
class  IteratorIterator
 Basic Iterator wrapper. More...
class  MultipleIterator
 Iterator that iterates over several iterators one after the other. More...
class  NoRewindIterator
 An Iterator wrapper that doesn't call rewind. More...
class  RecursiveArrayIterator
 A recursive array iterator. More...
class  RecursiveFilterIterator
 Iterator to filter recursive iterators. More...
class  RecursiveTreeIterator
 RecursiveIteratorIterator to generate ASCII graphic trees for the entries in a RecursiveIterator. More...
class  SplDoublyLinkedList
 Doubly Linked List. More...
class  SplFileObject
 Object representation for any stream. More...
class  SplQueue
 Implementation of a Queue through a DoublyLinkedList. More...
class  SplStack
 Implementation of a stack through a DoublyLinkedList. More...
class  LogicException
 Exception that represents error in the program logic. More...
class  BadFunctionCallException
 Exception thrown when a function call was illegal. More...
class  BadMethodCallException
 Exception thrown when a method call was illegal. More...
class  DomainException
 Exception that denotes a value not in the valid domain was used. More...
class  InvalidArgumentException
 Exception that denotes invalid arguments were passed. More...
class  LengthException
 Exception thrown when a parameter exceeds the allowed length. More...
class  OutOfRangeException
 Exception thrown when an illegal index was requested. More...
class  RuntimeException
 Exception thrown for errors that are only detectable at runtime. More...
class  OutOfBoundsException
 Exception thrown when an illegal index was requested. More...
class  OverflowException
 Exception thrown to indicate arithmetic/buffer overflow. More...
class  RangeException
 Exception thrown to indicate range errors during program execution. More...
class  UnderflowException
 Exception thrown to indicate arithmetic/buffer underflow. More...
class  UnexpectedValueException
 Exception thrown to indicate an unexpected value. More...
interface  Countable
 This Interface allows to hook into the global count() function. More...
class  ArrayObject
 An Array wrapper. More...
class  ArrayIterator
 An Array iterator. More...
class  SplFileInfo
 File info class. More...
class  DirectoryIterator
 Directory iterator. More...
class  RecursiveDirectoryIterator
 recursive directory iterator More...
class  SimpleXMLIterator
 recursive SimpleXML_Element iterator More...
interface  SplObserver
 Observer of the observer pattern. More...
interface  SplSubject
 Subject to the observer pattern. More...

Functions

 spl_autoload (string $class_name, string $file_extensions=NULL)
 Default implementation for __autoload()
 spl_autoload_call (string $class_name)
 Manual invocation of all registerd autoload functions.
 spl_autoload_extensions ($file_extensions)
 Register and return default file extensions for spl_autoload.
 spl_autoload_functions ()
 Return all registered autoload functionns.
 spl_autoload_register (string $autoload_function="spl_autoload", $throw=true)
 Register given function as autoload implementation.
 spl_autoload_unregister (string $autoload_function="spl_autoload")
 Unregister given function as autoload implementation.
 spl_classes ()
 Return an array of classes and interfaces in SPL.
 iterator_count (Traversable $it)
 Count the elements in an iterator.
 iterator_to_array (Traversable $it, $use_keys=true)
 Copy iterator elements into an array.

Detailed Description

The classes and interfaces in this group are contained in the c-code of ext/SPL.


Class Documentation

class AppendIterator

Iterator that iterates over several iterators one after the other.

Author:
Marcus Boerger
Version:
1.0
Since:
PHP 5.1

Definition at line 18 of file appenditerator.inc.

Inheritance diagram for AppendIterator:
Collaboration diagram for AppendIterator:

Public Member Functions

 __construct ()
 Construct an empty AppendIterator.
 append (Iterator $it)
 Append an Iterator.
 getInnerIterator ()
 rewind ()
 Rewind to the first element of the first inner Iterator.
 valid ()
 current ()
 key ()
 next ()
 Move to the next element.
 __call ($func, $params)
 Aggregates the inner iterator.

Private Attributes

 $iterators

Constructor & Destructor Documentation

Construct an empty AppendIterator.

Definition at line 25 of file appenditerator.inc.

       {
              $this->iterators = new ArrayIterator();
       }

Member Function Documentation

AppendIterator::__call ( func,
params 
)

Aggregates the inner iterator.

Definition at line 116 of file appenditerator.inc.

       {
              return call_user_func_array(array($this->getInnerIterator(), $func), $params);
       }

Here is the call graph for this function:

Append an Iterator.

Parameters:
$itIterator to append

If the current state is invalid but the appended iterator is valid the AppendIterator itself becomes valid. However there will be no call to $it->rewind(). Also if the current state is invalid the inner ArrayIterator will be rewound und forwarded to the appended element.

Definition at line 38 of file appenditerator.inc.

       {
              $this->iterators->append($it);
       }
Returns:
the current value if it is valid or NULL

Implements Iterator.

Definition at line 71 of file appenditerator.inc.

       {
              /* Using $this->valid() would be exactly the same; it would omit
               * the access to a non valid element in the inner iterator. Since
               * the user didn't respect the valid() return value false this
               * must be intended hence we go on. */
              return $this->iterators->valid() ? $this->getInnerIterator()->current() : NULL;
       }

Here is the call graph for this function:

Returns:
the current inner Iterator

Implements OuterIterator.

Definition at line 45 of file appenditerator.inc.

       {
              return $this->iterators->current();
       }

Here is the caller graph for this function:

Returns:
the current key if it is valid or NULL

Implements Iterator.

Definition at line 82 of file appenditerator.inc.

       {
              return $this->iterators->valid() ? $this->getInnerIterator()->key() : NULL;
       }

Here is the call graph for this function:

Move to the next element.

If this means to another Iterator that rewind that Iterator.

Returns:
void

Implements Iterator.

Definition at line 91 of file appenditerator.inc.

       {
              if (!$this->iterators->valid())
              {
                     return; /* done all */
              }
              $this->getInnerIterator()->next();
              if ($this->getInnerIterator()->valid())
              {
                     return; /* found valid element in current inner iterator */
              }
              $this->iterators->next();
              while ($this->iterators->valid())
              {
                     $this->getInnerIterator()->rewind();
                     if ($this->getInnerIterator()->valid())
                     {
                            return; /* found element as first elemet in another iterator */
                     }
                     $this->iterators->next();
              }
       }

Here is the call graph for this function:

Rewind to the first element of the first inner Iterator.

Returns:
void

Implements Iterator.

Definition at line 53 of file appenditerator.inc.

       {
              $this->iterators->rewind();
              if ($this->iterators->valid())
              {
                     $this->getInnerIterator()->rewind();
              }
       }

Here is the call graph for this function:

Returns:
whether the current element is valid

Implements Iterator.

Definition at line 64 of file appenditerator.inc.

       {
              return $this->iterators->valid() && $this->getInnerIterator()->valid();
       }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

array of inner iterators

Definition at line 21 of file appenditerator.inc.

class EmptyIterator

An empty Iterator.

Author:
Marcus Boerger
Version:
1.0
Since:
PHP 5.1

Definition at line 18 of file emptyiterator.inc.

Inheritance diagram for EmptyIterator:
Collaboration diagram for EmptyIterator:

Public Member Functions

 rewind ()
 No operation.
 valid ()
 current ()
 This function must not be called.
 key ()
 This function must not be called.
 next ()
 No operation.

Member Function Documentation

This function must not be called.

It throws an exception upon access.

Exceptions:
Exception
Returns:
void

Implements Iterator.

Definition at line 39 of file emptyiterator.inc.

       {
              throw new Exception('Accessing the value of an EmptyIterator');
       }

This function must not be called.

It throws an exception upon access.

Exceptions:
Exception
Returns:
void

Implements Iterator.

Definition at line 48 of file emptyiterator.inc.

       {
              throw new Exception('Accessing the key of an EmptyIterator');
       }

No operation.

Returns:
void

Implements Iterator.

Definition at line 56 of file emptyiterator.inc.

       {
              // nothing to do
       }

No operation.

Returns:
void

Implements Iterator.

Definition at line 23 of file emptyiterator.inc.

       {
              // nothing to do
       }
Returns:
false

Implements Iterator.

Definition at line 30 of file emptyiterator.inc.

       {
              return false;
       }
class InfiniteIterator

An infinite Iterator.

Author:
Marcus Boerger
Version:
1.1
Since:
PHP 5.1

This Iterator takes another Iterator and infinitvely iterates it by rewinding it when its end is reached.

Note:
Even an InfiniteIterator stops if its inner Iterator is empty.
 $it       = new ArrayIterator(array(1,2,3));
 $infinite = new InfiniteIterator($it);
 $limit    = new LimitIterator($infinite, 0, 5);
 foreach($limit as $val=>$key)
 {
       echo "$val=>$key\n";
 }

Definition at line 33 of file infiniteiterator.inc.

Inheritance diagram for InfiniteIterator:
Collaboration diagram for InfiniteIterator:

Public Member Functions

 next ()
 Move the inner Iterator forward to its next element or rewind it.
 getInnerIterator ()
 valid ()
 key ()
 current ()
 rewind ()
 rewind to the first element
 __call ($func, $params)
 Aggregate the inner iterator.

Member Function Documentation

IteratorIterator::__call ( func,
params 
) [inherited]

Aggregate the inner iterator.

Parameters:
funcName of method to invoke
paramsArray of parameters to pass to method

Definition at line 110 of file iteratoriterator.inc.

       {
              return call_user_func_array(array($this->iterator, $func), $params);
       }
IteratorIterator::current ( ) [inherited]
Returns:
current value

Implements Iterator.

Definition at line 86 of file iteratoriterator.inc.

       {
              return $this->iterator->current();
       }
Returns:
the inner iterator as passed to the constructor

Implements OuterIterator.

Definition at line 65 of file iteratoriterator.inc.

       {
              return $this->iterator;
       }

Here is the caller graph for this function:

IteratorIterator::key ( ) [inherited]
Returns:
current key

Implements Iterator.

Definition at line 79 of file iteratoriterator.inc.

       {
              return $this->iterator->key();
       }

Move the inner Iterator forward to its next element or rewind it.

Returns:
void

Reimplemented from IteratorIterator.

Definition at line 38 of file infiniteiterator.inc.

       {
              $this->getInnerIterator()->next();
              if (!$this->getInnerIterator()->valid())
              {
                     $this->getInnerIterator()->rewind();
              }
       }

Here is the call graph for this function:

IteratorIterator::rewind ( ) [inherited]

rewind to the first element

Implements Iterator.

Reimplemented in NoRewindIterator.

Definition at line 100 of file iteratoriterator.inc.

       {
              return $this->iterator->rewind();
       }
IteratorIterator::valid ( ) [inherited]
Returns:
whether the iterator is valid

Implements Iterator.

Definition at line 72 of file iteratoriterator.inc.

       {
              return $this->iterator->valid();
       }

Here is the caller graph for this function:

class IteratorIterator

Basic Iterator wrapper.

Since:
PHP 5.1

This iterator wrapper allows to convert anything that is traversable into an Iterator. It is very important to understand that most classes that do not implement Iterator have their reasone to. Most likely they do not allow the full Iterator feature set. If so you need to provide techniques to prevent missuse. If you do not you must expect exceptions or fatal erros.

It is also possible to derive the class and implement IteratorAggregate by downcasting the instances returned in getIterator. See the following example (assuming BaseClass implements Traversable):

 class SomeClass extends BaseClass implements IteratorAggregate
 {
   function getIterator()
   {
     return new IteratorIterator($this, 'BaseClass');
   }
 }

As you can see in the example this approach requires that the class to downcast to is actually a base class of the specified iterator to wrap. Omitting the downcast in the above example would result in an endless loop since IteratorIterator::__construct() would call SomeClass::getIterator().

Definition at line 40 of file iteratoriterator.inc.

Inheritance diagram for IteratorIterator:
Collaboration diagram for IteratorIterator:

Public Member Functions

 __construct (Traversable $iterator, $classname=null)
 Construct an IteratorIterator from an Iterator or an IteratorAggregate.
 getInnerIterator ()
 valid ()
 key ()
 current ()
 next ()
 forward to next element
 rewind ()
 rewind to the first element
 __call ($func, $params)
 Aggregate the inner iterator.

Private Attributes

 $iterator
 The inner iterator must be private because when this class will be converted to c code it won't no longer be available.

Constructor & Destructor Documentation

IteratorIterator::__construct ( Traversable iterator,
classname = null 
)

Construct an IteratorIterator from an Iterator or an IteratorAggregate.

Parameters:
iteratorinner iterator
classnameoptional class the iterator has to be downcasted to

Definition at line 47 of file iteratoriterator.inc.

       {
              if ($iterator instanceof IteratorAggregate)
              {
                  $iterator = $iterator->getIterator();
              }
              if ($iterator instanceof Iterator)
              {
                     $this->iterator = $iterator;
              }
              else
              {
                     throw new Exception("Classes that only implement Traversable can be wrapped only after converting class IteratorIterator into c code");
              }
       }

Member Function Documentation

IteratorIterator::__call ( func,
params 
)

Aggregate the inner iterator.

Parameters:
funcName of method to invoke
paramsArray of parameters to pass to method

Definition at line 110 of file iteratoriterator.inc.

       {
              return call_user_func_array(array($this->iterator, $func), $params);
       }
Returns:
current value

Implements Iterator.

Definition at line 86 of file iteratoriterator.inc.

       {
              return $this->iterator->current();
       }
Returns:
the inner iterator as passed to the constructor

Implements OuterIterator.

Definition at line 65 of file iteratoriterator.inc.

       {
              return $this->iterator;
       }

Here is the caller graph for this function:

Returns:
current key

Implements Iterator.

Definition at line 79 of file iteratoriterator.inc.

       {
              return $this->iterator->key();
       }

forward to next element

Implements Iterator.

Reimplemented in InfiniteIterator.

Definition at line 93 of file iteratoriterator.inc.

       {
              return $this->iterator->next();
       }

rewind to the first element

Implements Iterator.

Reimplemented in NoRewindIterator.

Definition at line 100 of file iteratoriterator.inc.

       {
              return $this->iterator->rewind();
       }
Returns:
whether the iterator is valid

Implements Iterator.

Definition at line 72 of file iteratoriterator.inc.

       {
              return $this->iterator->valid();
       }

Here is the caller graph for this function:


Member Data Documentation

The inner iterator must be private because when this class will be converted to c code it won't no longer be available.

Definition at line 118 of file iteratoriterator.inc.

class MultipleIterator

Iterator that iterates over several iterators one after the other.

Author:
Johannes Schlueter
Marcus Boerger
Version:
1.0
Since:
PHP 5.3

Definition at line 19 of file multipleiterator.inc.

Inheritance diagram for MultipleIterator:
Collaboration diagram for MultipleIterator:

Public Member Functions

 __construct ($flags=self::MIT_NEED_ALL|self::MIT_KEYS_NUMERIC)
 Construct a new empty MultipleIterator.
 getFlags ()
 setFlags ($flags)
 attachIterator (Iterator $iter, $inf=NULL)
 detachIterator (Iterator $iter)
 containsIterator (Iterator $iter)
 countIterators ()
 rewind ()
 Rewind all attached Iterator instances.
 valid ()
 next ()
 Move all attached Iterator instances forward.
 current ()
 key ()

Public Attributes

const MIT_NEED_ANY = 0
 do not require all sub iterators to be valid in iteration
const MIT_NEED_ALL = 1
 require all sub iterators to be valid in iteration
const MIT_KEYS_NUMERIC = 0
 keys are created from sub iterators position
const MIT_KEYS_ASSOC = 2
 keys are created from sub iterators associated infromation

Private Attributes

 $iterators
 Inner Iterators.
 $flags
 Flags: const MIT_*.

Constructor & Destructor Documentation

Construct a new empty MultipleIterator.

Parameters:
flagsMIT_* flags

Definition at line 42 of file multipleiterator.inc.

       {
              $this->iterators = new SplObjectStorage();
              $this->flags = $flags;
       }

Member Function Documentation

MultipleIterator::attachIterator ( Iterator iter,
inf = NULL 
)
Parameters:
$iternew Iterator to attach.
$infassociative info forIteraotr, must be NULL, integer or string
Exceptions:
IllegalValueExceptionif a inf is none of NULL, integer or string
IllegalValueExceptionif a inf is already an associated info

Definition at line 66 of file multipleiterator.inc.

       {

              if (!is_null($inf))
              {
                     if (!is_int($inf) && !is_string($inf))
                     {
                            throw new IllegalValueException('Inf must be NULL, integer or string');
                     }
                     foreach($this->iterators as $iter)
                     {
                            if ($inf == $this->iterators->getInfo())
                            {
                                   throw new IllegalValueException('Key duplication error');
                            }
                     }
              }
              $this->iterators->attach($iter, $inf);
       }
Parameters:
$iterIterator to check
Returns:
whether $iter is attached or not

Definition at line 95 of file multipleiterator.inc.

       {
              return $this->iterator->contains($iter);
       }
Returns:
number of attached Iterator instances.

Definition at line 101 of file multipleiterator.inc.

       {
              return $this->iterators->count();
       }
Returns:
false if no sub Iterator is attached and an array of all registered Iterator instances current() result.
Exceptions:
RuntimeExceptionif mode MIT_NEED_ALL is set and at least one attached Iterator is not valid().
IllegalValueExceptionif a key is NULL and MIT_KEYS_ASSOC is set.

Implements Iterator.

Definition at line 157 of file multipleiterator.inc.

       {
              if (!sizeof($this->iterators))
              {
                     return false;
              }
              $retval = array();
              foreach($this->iterators as $iter)
              {
                     if ($it->valid())
                     {
                            if ($this->flags & self::MIT_KEYS_ASSOC)
                            {
                                   $key = $this->iterators->getInfo();
                                   if (is_null($key))
                                   {
                                          throw new IllegalValueException('Sub-Iterator is associated with NULL');
                                   }
                                   $retval[$key] = $iter->current();
                            }
                            else
                            {
                                   $retval[] = $iter->current();
                            }
                     }
                     else if ($this->flags & self::MIT_NEED_ALL)
                     {
                            throw new RuntimeException('Called current() with non valid sub iterator');
                     }
                     else
                     {
                            $retval[] = NULL;
                     }
              }
              return $retval;
       }
Parameters:
$iterattached Iterator that should be detached.

Definition at line 87 of file multipleiterator.inc.

       {
              $this->iterators->detach($iter);
       }
Returns:
current flags MIT_*

Definition at line 49 of file multipleiterator.inc.

       {
              return $this->flags;
       }
Returns:
false if no sub Iterator is attached and an array of all registered Iterator instances key() result.
Exceptions:
LogicExceptionif mode MIT_NEED_ALL is set and at least one attached Iterator is not valid().

Implements Iterator.

Definition at line 199 of file multipleiterator.inc.

       {
              if (!sizeof($this->iterators))
              {
                     return false;
              }
              $retval = array();
              foreach($this->iterators as $iter)
              {
                     if ($it->valid())
                     {
                            $retval[] = $iter->key();
                     }
                     else if ($this->flags & self::MIT_NEED_ALL)
                     {
                            throw new LogicException('Called key() with non valid sub iterator');
                     }
                     else
                     {
                            $retval[] = NULL;
                     }
              }
              return $retval;
       }

Move all attached Iterator instances forward.

That is invoke their next() method regardless of their state.

Implements Iterator.

Definition at line 143 of file multipleiterator.inc.

       {
              foreach($this->iterators as $iter)
              {
                     $iter->next();
              }
       }

Rewind all attached Iterator instances.

Implements Iterator.

Definition at line 107 of file multipleiterator.inc.

       {
              foreach($this->iterators as $iter)
              {
                     $iter->rewind();
              }
       }
Parameters:
$flagsnew flags.

Definition at line 55 of file multipleiterator.inc.

       {
              $this->flags = $flags;
       }
Returns:
whether all or one sub iterator is valid depending on flags. In mode MIT_NEED_ALL we expect all sub iterators to be valid and return flase on the first non valid one. If that flag is not set we return true on the first valid sub iterator found. If no Iterator is attached, we always return false.

Implements Iterator.

Definition at line 122 of file multipleiterator.inc.

       {
              if (!sizeof($this->iterators)) {
                     return false;
              }
              // The following code is an optimized version that executes as few
              // valid() calls as necessary and that only checks the flags once.
              $expect = $this->flags & self::MIT_NEED_ALL ? true : false;
              foreach($this->iterators as $iter)
              {
                     if ($expect != $iter->valid())
                     {
                            return !$expect;
                     }
              }
              return $expect;
       }

Member Data Documentation

Flags: const MIT_*.

Definition at line 25 of file multipleiterator.inc.

Inner Iterators.

Definition at line 22 of file multipleiterator.inc.

keys are created from sub iterators associated infromation

Definition at line 37 of file multipleiterator.inc.

keys are created from sub iterators position

Definition at line 34 of file multipleiterator.inc.

require all sub iterators to be valid in iteration

Definition at line 31 of file multipleiterator.inc.

do not require all sub iterators to be valid in iteration

Definition at line 28 of file multipleiterator.inc.

class NoRewindIterator

An Iterator wrapper that doesn't call rewind.

Author:
Marcus Boerger
Version:
1.1
Since:
PHP 5.1

Definition at line 18 of file norewinditerator.inc.

Inheritance diagram for NoRewindIterator:
Collaboration diagram for NoRewindIterator:

Public Member Functions

 rewind ()
 Simply prevent execution of inner iterators rewind().
 getInnerIterator ()
 valid ()
 key ()
 current ()
 next ()
 forward to next element
 __call ($func, $params)
 Aggregate the inner iterator.

Member Function Documentation

IteratorIterator::__call ( func,
params 
) [inherited]

Aggregate the inner iterator.

Parameters:
funcName of method to invoke
paramsArray of parameters to pass to method

Definition at line 110 of file iteratoriterator.inc.

       {
              return call_user_func_array(array($this->iterator, $func), $params);
       }
IteratorIterator::current ( ) [inherited]
Returns:
current value

Implements Iterator.

Definition at line 86 of file iteratoriterator.inc.

       {
              return $this->iterator->current();
       }
Returns:
the inner iterator as passed to the constructor

Implements OuterIterator.

Definition at line 65 of file iteratoriterator.inc.

       {
              return $this->iterator;
       }

Here is the caller graph for this function:

IteratorIterator::key ( ) [inherited]
Returns:
current key

Implements Iterator.

Definition at line 79 of file iteratoriterator.inc.

       {
              return $this->iterator->key();
       }
IteratorIterator::next ( ) [inherited]

forward to next element

Implements Iterator.

Reimplemented in InfiniteIterator.

Definition at line 93 of file iteratoriterator.inc.

       {
              return $this->iterator->next();
       }

Simply prevent execution of inner iterators rewind().

Reimplemented from IteratorIterator.

Definition at line 22 of file norewinditerator.inc.

       {
              // nothing to do
       }
IteratorIterator::valid ( ) [inherited]
Returns:
whether the iterator is valid

Implements Iterator.

Definition at line 72 of file iteratoriterator.inc.

       {
              return $this->iterator->valid();
       }

Here is the caller graph for this function:

class RecursiveArrayIterator

A recursive array iterator.

Author:
Marcus Boerger
Version:
1.0
Since:
PHP 5.1

Passes the RecursiveIterator interface to the inner Iterator and provides the same functionality as FilterIterator. This allows you to skip parents and all their childs before loading them all. You need to care about function getChildren() because it may not always suit your needs. The builtin behavior uses reflection to return a new instance of the exact same class it is called from. That is you extend RecursiveFilterIterator and getChildren() will create instance of that class. The problem is that doing this does not transport any state or control information of your accept() implementation to the new instance. To overcome this problem you might need to overwrite getChildren(), call this implementation and pass the control vaules manually.

Definition at line 30 of file recursivearrayiterator.inc.

Inheritance diagram for RecursiveArrayIterator:
Collaboration diagram for RecursiveArrayIterator:

Public Member Functions

 hasChildren ()
 getChildren ()
 setFlags ($flags)
 Set behavior flags.
 getFlags ()
 asort ()
 Sort the entries by values.
 ksort ()
 Sort the entries by key.
 uasort (mixed cmp_function)
 Sort the entries by values using user defined function.
 uksort (mixed cmp_function)
 Sort the entries by key using user defined function.
 natsort ()
 Sort the entries by values using "natural order" algorithm.
 natcasesort ()
 Sort the entries by values using case insensitive "natural order" algorithm.
 offsetExists ($index)
 offsetGet ($index)
 offsetSet ($index, $newval)
 offsetUnset ($index)
 append ($value)
 getArrayCopy ()
 seek ($position)
 count ()
 rewind ()
 Rewind the Iterator to the first element.
 valid ()
 Check if there is a current element after calls to rewind() or next().
 current ()
 Return the current element.
 key ()
 Return the key of the current element.
 next ()
 Move forward to next element.

Public Attributes

const STD_PROP_LIST = 0x00000001
 Properties of the object have their normal functionality when accessed as list (var_dump, foreach, etc.)
const ARRAY_AS_PROPS = 0x00000002
 Array indices can be accessed as properties in read/write.

Private Attributes

 $ref

Member Function Documentation

ArrayIterator::append ( value) [inherited]
Parameters:
$valueis appended as last element
Warning:
this method cannot be called when the ArrayIterator refers to an object.

Definition at line 818 of file spl.php.

{}

Here is the caller graph for this function:

ArrayIterator::asort ( ) [inherited]

Sort the entries by values.

Definition at line 773 of file spl.php.

{}
ArrayIterator::count ( ) [inherited]
Returns:
the number of elements in the array or the number of public properties in the object.

Implements Countable.

Definition at line 834 of file spl.php.

{}
ArrayIterator::current ( ) [inherited]

Return the current element.

Implements Iterator.

Reimplemented in SubClasses.

Definition at line 843 of file spl.php.

{}

Here is the caller graph for this function:

ArrayIterator::getArrayCopy ( ) [inherited]
Returns:
a copy of the array
Note:
when the ArrayIterator refers to an object then this method returns an array of the public properties.

Definition at line 824 of file spl.php.

{}
Returns:
an iterator for the current elements children
Note:
the returned iterator will be of the same class as $this

Implements RecursiveIterator.

Definition at line 43 of file recursivearrayiterator.inc.

       {
              if ($this->current() instanceof self)
              {
                     return $this->current();
              }
              if (empty($this->ref))
              {
                     $this->ref = new ReflectionClass($this);
              }
              return $this->ref->newInstance($this->current());
       }

Here is the call graph for this function:

ArrayIterator::getFlags ( ) [inherited]
Returns:
current flags

Definition at line 769 of file spl.php.

{}
Returns:
whether the current element has children

Implements RecursiveIterator.

Definition at line 34 of file recursivearrayiterator.inc.

       {
              return is_array($this->current());
       }

Here is the call graph for this function:

ArrayIterator::key ( ) [inherited]

Return the key of the current element.

Implements Iterator.

Definition at line 846 of file spl.php.

{}

Here is the caller graph for this function:

ArrayIterator::ksort ( ) [inherited]

Sort the entries by key.

Definition at line 777 of file spl.php.

{}
ArrayIterator::natcasesort ( ) [inherited]

Sort the entries by values using case insensitive "natural order" algorithm.

Definition at line 793 of file spl.php.

{}

Here is the caller graph for this function:

ArrayIterator::natsort ( ) [inherited]

Sort the entries by values using "natural order" algorithm.

Definition at line 789 of file spl.php.

{}
ArrayIterator::next ( ) [inherited]

Move forward to next element.

Implements Iterator.

Definition at line 849 of file spl.php.

{}
ArrayIterator::offsetExists ( index) [inherited]
Parameters:
$indexoffset to inspect
Returns:
whetehr offset $index esists

Implements ArrayAccess.

Definition at line 798 of file spl.php.

{}
ArrayIterator::offsetGet ( index) [inherited]
Parameters:
$indexoffset to return value for
Returns:
value at offset $index

Implements ArrayAccess.

Definition at line 803 of file spl.php.

{}
ArrayIterator::offsetSet ( index,
newval 
) [inherited]
Parameters:
$indexindex to set
$newvalnew value to store at offset $index

Implements ArrayAccess.

Definition at line 808 of file spl.php.

{}

Here is the caller graph for this function:

ArrayIterator::offsetUnset ( index) [inherited]
Parameters:
$indexoffset to unset

Implements ArrayAccess.

Definition at line 812 of file spl.php.

{}
ArrayIterator::rewind ( ) [inherited]

Rewind the Iterator to the first element.

Implements Iterator.

Definition at line 837 of file spl.php.

{}
ArrayIterator::seek ( position) [inherited]
Parameters:
$positionoffset to seek to
Exceptions:
OutOfBoundsExceptionif $position is invalid

Implements SeekableIterator.

Definition at line 829 of file spl.php.

{}
ArrayIterator::setFlags ( flags) [inherited]

Set behavior flags.

Parameters:
$flagsbitmask as follows: 0 set: properties of the object have their normal functionality when accessed as list (var_dump, foreach, etc.) 1 set: array indices can be accessed as properties in read/write

Definition at line 764 of file spl.php.

{}
ArrayIterator::uasort ( mixed  cmp_function) [inherited]

Sort the entries by values using user defined function.

Definition at line 781 of file spl.php.

{}
ArrayIterator::uksort ( mixed  cmp_function) [inherited]

Sort the entries by key using user defined function.

Definition at line 785 of file spl.php.

{}

Here is the caller graph for this function:

ArrayIterator::valid ( ) [inherited]

Check if there is a current element after calls to rewind() or next().

Implements Iterator.

Definition at line 840 of file spl.php.

{}

Member Data Documentation

Definition at line 56 of file recursivearrayiterator.inc.

const ArrayIterator::ARRAY_AS_PROPS = 0x00000002 [inherited]

Array indices can be accessed as properties in read/write.

Definition at line 747 of file spl.php.

const ArrayIterator::STD_PROP_LIST = 0x00000001 [inherited]

Properties of the object have their normal functionality when accessed as list (var_dump, foreach, etc.)

Definition at line 745 of file spl.php.

class RecursiveFilterIterator

Iterator to filter recursive iterators.

Author:
Marcus Boerger
Version:
1.0
Since:
PHP 5.1

Passes the RecursiveIterator interface to the inner Iterator and provides the same functionality as FilterIterator. This allows you to skip parents and all their childs before loading them all. You need to care about function getChildren() because it may not always suit your needs. The builtin behavior uses reflection to return a new instance of the exact same class it is called from. That is you extend RecursiveFilterIterator and getChildren() will create instance of that class. The problem is that doing this does not transport any state or control information of your accept() implementation to the new instance. To overcome this problem you might need to overwrite getChildren(), call this implementation and pass the control vaules manually.

Definition at line 30 of file recursivefilteriterator.inc.

Inheritance diagram for RecursiveFilterIterator:
Collaboration diagram for RecursiveFilterIterator:

Public Member Functions

 __construct (RecursiveIterator $it)
 hasChildren ()
 getChildren ()
 rewind ()
 Rewind the inner iterator.
 accept ()
 Accept function to decide whether an element of the inner iterator should be accessible through the Filteriterator.
 next ()
 Move to next element.
 valid ()
 key ()
 current ()
 getInnerIterator ()
 __call ($func, $params)
 Aggregate the inner iterator.

Protected Member Functions

 fetch ()
 Fetch next element and store it.
 __clone ()
 hidden __clone

Private Attributes

 $ref

Constructor & Destructor Documentation

Parameters:
$itthe RecursiveIterator to filter

Definition at line 34 of file recursivefilteriterator.inc.


Member Function Documentation

FilterIterator::__call ( func,
params 
) [inherited]

Aggregate the inner iterator.

Parameters:
funcName of method to invoke
paramsArray of parameters to pass to method

Reimplemented in SearchIterator.

Definition at line 121 of file filteriterator.inc.

       {
              return call_user_func_array(array($this->it, $func), $params);
       }
FilterIterator::__clone ( ) [protected, inherited]

hidden __clone

Reimplemented in KeyFilter.

Definition at line 104 of file filteriterator.inc.

                                    {
              // disallow clone 
       }
FilterIterator::accept ( ) [abstract, inherited]

Accept function to decide whether an element of the inner iterator should be accessible through the Filteriterator.

Returns:
whether or not to expose the current element of the inner iterator.

Reimplemented in RegexIterator, CallbackFilterIterator, FindFile, KeyFilter, NoCvsDirectory, RegexFindFile, DirectoryFilterDots, ParentIterator, and InvertedRegexIterator.

Here is the caller graph for this function:

FilterIterator::current ( ) [inherited]
Returns:
The current value

Implements Iterator.

Reimplemented in RegexIterator, CallbackFilterIterator, and IniGroups.

Definition at line 97 of file filteriterator.inc.

                          {
              return $this->it->current();
       }

Here is the caller graph for this function:

FilterIterator::fetch ( ) [protected, inherited]

Fetch next element and store it.

Returns:
void

Definition at line 61 of file filteriterator.inc.

                                  {
              while ($this->it->valid()) {
                     if ($this->accept()) {
                            return;
                     }
                     $this->it->next();
              };
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Returns:
an iterator for the current elements children
Note:
the returned iterator will be of the same class as $this

Implements RecursiveIterator.

Reimplemented in NoCvsDirectory.

Definition at line 50 of file recursivefilteriterator.inc.

       {
              if (empty($this->ref))
              {
                     $this->ref = new ReflectionClass($this);
              }
              return $this->ref->newInstance($this->getInnerIterator()->getChildren());
       }

Here is the call graph for this function:

Returns:
The inner iterator

Implements OuterIterator.

Definition at line 111 of file filteriterator.inc.

       {
              return $this->it;
       }

Here is the caller graph for this function:

Returns:
whether the current element has children

Implements RecursiveIterator.

Definition at line 41 of file recursivefilteriterator.inc.

       {
              return $this->getInnerIterator()->hasChildren();
       }

Here is the call graph for this function:

FilterIterator::key ( ) [inherited]
Returns:
The current key

Implements Iterator.

Reimplemented in RegexIterator, CallbackFilterIterator, IniGroups, and DirectoryFilterDots.

Definition at line 90 of file filteriterator.inc.

                      {
              return $this->it->key();
       }

Here is the caller graph for this function:

FilterIterator::next ( ) [inherited]

Move to next element.

Returns:
void

Implements Iterator.

Reimplemented in SearchIterator.

Definition at line 75 of file filteriterator.inc.

                       {
              $this->it->next();
              $this->fetch();
       }

Here is the call graph for this function:

FilterIterator::rewind ( ) [inherited]

Rewind the inner iterator.

Implements Iterator.

Reimplemented in SearchIterator.

Definition at line 42 of file filteriterator.inc.

                         {  
              $this->it->rewind();
              $this->fetch();
       }

Here is the call graph for this function:

FilterIterator::valid ( ) [inherited]
Returns:
Whether more elements are available

Implements Iterator.

Reimplemented in SearchIterator.

Definition at line 83 of file filteriterator.inc.

                        {
              return $this->it->valid();
       }

Member Data Documentation

Definition at line 59 of file recursivefilteriterator.inc.

class RecursiveTreeIterator

RecursiveIteratorIterator to generate ASCII graphic trees for the entries in a RecursiveIterator.

Author:
Marcus Boerger, Johannes Schlueter
Version:
1.1
Since:
PHP 5.3

Definition at line 20 of file recursivetreeiterator.inc.

Inheritance diagram for RecursiveTreeIterator:
Collaboration diagram for RecursiveTreeIterator:

Public Member Functions

 __construct (RecursiveIterator $it, $rit_flags=self::BYPASS_KEY, $cit_flags=CachingIterator::CATCH_GET_CHILD, $mode=self::SELF_FIRST)
 setPrefixPart ($part, $value)
 Set prefix part as used in getPrefix() and stored in $prefix.
 getPrefix ()
 getEntry ()
 getPostfix ()
 current ()
 key ()
 __call ($func, $params)
 Aggregates the inner iterator.
 rewind ()
 Rewind to top iterator as set in constructor.
 valid ()
 next ()
 Forward to next element.
 getSubIterator ($level=NULL)
 getInnerIterator ()
 getDepth ()
 callHasChildren ()
 callGetChildren ()
 beginChildren ()
 Called right after calling getChildren() and its rewind().
 endChildren ()
 Called after current child iterator is invalid and right before it gets destructed.
 nextElement ()
 Called when the next element is available.

Public Attributes

const BYPASS_CURRENT = 0x00000004
const BYPASS_KEY = 0x00000008
const PREFIX_LEFT = 0
 Prefix used to start elements.
const PREFIX_MID_HAS_NEXT = 1
 Prefix used if $level < depth and hasNext($level) == true.
const PREFIX_MID_LAST = 2
 Prefix used if $level < depth and hasNext($level) == false.
const PREFIX_END_HAS_NEXT = 3
 Prefix used if $level == depth and hasNext($level) == true.
const PREFIX_END_LAST = 4
 Prefix used if $level == depth and hasNext($level) == false.
const PREFIX_RIGHT = 5
 Prefix used right in front of the current element.
const LEAVES_ONLY = 0
 Mode: Only show leaves.
const SELF_FIRST = 1
 Mode: Show parents prior to their children.
const CHILD_FIRST = 2
 Mode: Show all children prior to their parent.
const CATCH_GET_CHILD = 0x00000002
 Flag: Catches exceptions during getChildren() calls and simply jumps to the next element.

Private Attributes

 $rit_flags
 $prefix = array(0=>'', 1=>'| ', 2=>' ', 3=>'|-', 4=>'\-', 5=>'')

Constructor & Destructor Documentation

RecursiveTreeIterator::__construct ( RecursiveIterator it,
rit_flags = self::BYPASS_KEY,
cit_flags = CachingIterator::CATCH_GET_CHILD,
mode = self::SELF_FIRST 
)
Parameters:
ititerator to use as inner iterator
rit_flagsflags passed to RecursiveIteratoIterator (parent)
cit_flagsflags passed to RecursiveCachingIterator (for hasNext)
modemode passed to RecursiveIteratoIterator (parent)

Definition at line 33 of file recursivetreeiterator.inc.

       {
              parent::__construct(new RecursiveCachingIterator($it, $cit_flags), $mode, $rit_flags);
              $this->rit_flags = $rit_flags;
       }

Member Function Documentation

RecursiveTreeIterator::__call ( func,
params 
)

Aggregates the inner iterator.

Definition at line 126 of file recursivetreeiterator.inc.

       {
              return call_user_func_array(array($this->getSubIterator(), $func), $params);
       }

Here is the call graph for this function:

Called right after calling getChildren() and its rewind().

Since:
PHP 5.1

Definition at line 201 of file recursiveiteratoriterator.inc.

       {
       }

Here is the caller graph for this function:

Returns:
current sub iterators current children
Since:
PHP 5.1

Definition at line 193 of file recursiveiteratoriterator.inc.

       {
              return $this->ait[$this->count]->getChildren();
       }

Here is the caller graph for this function:

Returns:
whether current sub iterators current element has children
Since:
PHP 5.1

Definition at line 185 of file recursiveiteratoriterator.inc.

       {
              return $this->ait[$this->count]->hasChildren();
       }

Here is the caller graph for this function:

Returns:
the current element prefixed and postfixed

Reimplemented from RecursiveIteratorIterator.

Definition at line 98 of file recursivetreeiterator.inc.

       {
              if ($this->rit_flags & self::BYPASS_CURRENT)
              {
                     return parent::current();
              }
              else
              {
                     return $this->getPrefix() . $this->getEntry() .  $this->getPostfix();
              }
       }

Here is the call graph for this function:

Called after current child iterator is invalid and right before it gets destructed.

Since:
PHP 5.1

Reimplemented in RecursiveCompareDualIterator.

Definition at line 209 of file recursiveiteratoriterator.inc.

       {
       }

Here is the caller graph for this function:

Returns:
Current Depth (Number of parents)

Definition at line 177 of file recursiveiteratoriterator.inc.

       {
              return $this->level;
       }

Here is the caller graph for this function:

Returns:
string presentation build for current element

Definition at line 84 of file recursivetreeiterator.inc.

       {
              return @(string)parent::current();
       }

Here is the caller graph for this function:

Returns:
The inner iterator

Implements OuterIterator.

Definition at line 170 of file recursiveiteratoriterator.inc.

       {
              return $this->it;
       }

Here is the caller graph for this function:

Returns:
string to place after the current element

Definition at line 91 of file recursivetreeiterator.inc.

       {
              return '';
       }

Here is the caller graph for this function:

Returns:
string to place in front of current element

Definition at line 70 of file recursivetreeiterator.inc.

       {
              $tree = '';
              for ($level = 0; $level < $this->getDepth(); $level++)
              {
                     $tree .= $this->getSubIterator($level)->hasNext() ? $this->prefix[1] : $this->prefix[2];
              }
              $tree .= $this->getSubIterator($level)->hasNext() ? $this->prefix[3] : $this->prefix[4];

              return $this->prefix[0] . $tree . $this->prefix[5];
       }

Here is the call graph for this function:

Here is the caller graph for this function:

RecursiveIteratorIterator::getSubIterator ( level = NULL) [inherited]
Returns:
Sub Iterator at given level or if unspecified the current sub Iterator

Definition at line 159 of file recursiveiteratoriterator.inc.

       {
              if (is_null($level)) {
                     $level = $this->count;
              }
              return @$this->ait[$level];
       }

Here is the caller graph for this function:

Returns:
the current key prefixed and postfixed

Reimplemented from RecursiveIteratorIterator.

Definition at line 112 of file recursivetreeiterator.inc.

       {
              if ($this->rit_flags & self::BYPASS_KEY)
              {
                     return parent::key();
              }
              else
              {
                     return $this->getPrefix() . parent::key() .  $this->getPostfix();
              }
       }

Here is the call graph for this function:

Forward to next element.

Implements Iterator.

Definition at line 107 of file recursiveiteratoriterator.inc.

       {
              while ($this->count) {
                     $it = $this->ait[$this->count];
                     if ($it->valid()) {
                            if (!$it->recursed && callHasChildren()) {
                                   $it->recursed = true;
                                   try
                                   {
                                          $sub = callGetChildren();
                                   }
                                   catch (Exception $e)
                                   {
                                          if (!($this->flags & self::CATCH_GET_CHILD))
                                          {
                                                 throw $e;
                                          }
                                          $it->next();
                                          continue;
                                   }
                                   $sub->recursed = false;
                                   $sub->rewind();
                                   if ($sub->valid()) {
                                          $this->ait[++$this->count] = $sub;
                                          if (!$sub instanceof RecursiveIterator) {
                                                 throw new Exception(get_class($sub).'::getChildren() must return an object that implements RecursiveIterator');
                                          }
                                          $this->beginChildren();
                                          return;
                                   }
                                   unset($sub);
                            }
                            $it->next();
                            $it->recursed = false;
                            if ($it->valid()) {
                                   return;
                            }
                            $it->recursed = false;
                     }
                     if ($this->count) {
                            unset($this->ait[$this->count--]);
                            $it = $this->ait[$this->count];
                            $this->endChildren();
                            callNextElement(false);
                     }
              }
              callNextElement(true);
       }

Here is the call graph for this function:

Called when the next element is available.

Definition at line 232 of file recursiveiteratoriterator.inc.

       {
       }

Here is the caller graph for this function:

Rewind to top iterator as set in constructor.

Implements Iterator.

Reimplemented in RecursiveCompareDualIterator.

Definition at line 62 of file recursiveiteratoriterator.inc.

       {
              while ($this->count) {
                     unset($this->ait[$this->count--]);
                     $this->endChildren();
              }
              $this->ait[0]->rewind();
              $this->ait[0]->recursed = false;
              callNextElement(true);
       }

Here is the call graph for this function:

RecursiveTreeIterator::setPrefixPart ( part,
value 
)

Set prefix part as used in getPrefix() and stored in $prefix.

Parameters:
$partany PREFIX_* const.
$valuenew prefix string for specified part.
Exceptions:
OutOfRangeExceptionif 0 > $part or $part > 5.

Definition at line 60 of file recursivetreeiterator.inc.

       {
              if (0 > $part || $part > 5) {
                     throw new OutOfRangeException();
              }
              $this->prefix[$part] = (string)$value;
       }
Returns:
whether iterator is valid

Implements Iterator.

Definition at line 75 of file recursiveiteratoriterator.inc.

       {
              $count = $this->count;
              while ($count) {
                     $it = $this->ait[$count];
                     if ($it->valid()) {
                            return true;
                     }
                     $count--;
                     $this->endChildren();
              }
              return false;
       }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

RecursiveTreeIterator::$prefix = array(0=>'', 1=>'| ', 2=>' ', 3=>'|-', 4=>'\-', 5=>'') [private]

Definition at line 39 of file recursivetreeiterator.inc.

Definition at line 25 of file recursivetreeiterator.inc.

Definition at line 22 of file recursivetreeiterator.inc.

Definition at line 23 of file recursivetreeiterator.inc.

const RecursiveIteratorIterator::CATCH_GET_CHILD = 0x00000002 [inherited]

Flag: Catches exceptions during getChildren() calls and simply jumps to the next element.

Definition at line 33 of file recursiveiteratoriterator.inc.

Mode: Show all children prior to their parent.

Definition at line 29 of file recursiveiteratoriterator.inc.

Mode: Only show leaves.

Definition at line 25 of file recursiveiteratoriterator.inc.

Prefix used if $level == depth and hasNext($level) == true.

Definition at line 48 of file recursivetreeiterator.inc.

Prefix used if $level == depth and hasNext($level) == false.

Definition at line 50 of file recursivetreeiterator.inc.

Prefix used to start elements.

Definition at line 42 of file recursivetreeiterator.inc.

Prefix used if $level < depth and hasNext($level) == true.

Definition at line 44 of file recursivetreeiterator.inc.

Prefix used if $level < depth and hasNext($level) == false.

Definition at line 46 of file recursivetreeiterator.inc.

Prefix used right in front of the current element.

Definition at line 52 of file recursivetreeiterator.inc.

Mode: Show parents prior to their children.

Definition at line 27 of file recursiveiteratoriterator.inc.

class SplDoublyLinkedList

Doubly Linked List.

Since:
PHP 5.3

The SplDoublyLinkedList class provides the main functionalities of a doubly linked list (DLL).

Note:
The following userland implementation of Iterator is a bit different from the internal one. Internally, iterators generated by nested foreachs are independent, while they share the same traverse pointer in userland.

Definition at line 22 of file spldoublylinkedlist.inc.

Inheritance diagram for SplDoublyLinkedList:
Collaboration diagram for SplDoublyLinkedList:

Public Member Functions

 pop ()
 shift ()
 push ($data)
 Pushes an element to the end of the DLL.
 unshift ($data)
 Adds an element to the beginning of the DLL.
 top ()
 bottom ()
 count ()
 isEmpty ()
 setIteratorMode ($mode)
 Changes the iteration mode.
 getIteratorMode ()
 rewind ()
 Rewind to top iterator as set in constructor.
 valid ()
 key ()
 current ()
 next ()
 Forward to next element.
 offsetExists ($offset)
 offsetGet ($offset)
 offsetSet ($offset, $value)
 Defines the data at a certain offset in the DLL.
 offsetUnset ($offset)
 Unsets the element at a certain offset in the DLL.

Public Attributes

const IT_MODE_LIFO = 0x00000002
 Iterator mode.
const IT_MODE_FIFO = 0x00000000
 Iterator mode.
const IT_MODE_KEEP = 0x00000000
 Iterator mode.
const IT_MODE_DELETE = 0x00000001
 Iterator mode.

Protected Attributes

 $_llist = array()
 $_it_mode = 0
 $_it_pos = 0

Member Function Documentation

Returns:
the element at the end of the DLL.

Definition at line 97 of file spldoublylinkedlist.inc.

       {
              return reset($this->_llist);
       }
Returns:
number elements in the DLL.

Implements Countable.

Definition at line 104 of file spldoublylinkedlist.inc.

       {
              return count($this->_llist);
       }

Here is the caller graph for this function:

Returns:
current object

Implements Iterator.

Definition at line 170 of file spldoublylinkedlist.inc.

       {
              return $this->_llist[$this->_it_pos];
       }
Returns:
the current iteration mode
See also:
setIteratorMode

Definition at line 138 of file spldoublylinkedlist.inc.

       {
              return $this->_it_mode;
       }
Returns:
whether the DLL is empty.

Definition at line 111 of file spldoublylinkedlist.inc.

       {
              return ($this->count() == 0);
       }

Here is the call graph for this function:

Returns:
current key

Implements Iterator.

Definition at line 163 of file spldoublylinkedlist.inc.

       {
              return $this->_it_pos;
       }

Forward to next element.

Implements Iterator.

Definition at line 177 of file spldoublylinkedlist.inc.

       {
              if ($this->_it_mode & self::IT_MODE_LIFO) {
                     if ($this->_it_mode & self::IT_MODE_DELETE) {
                            $this->pop();
                     }
                     $this->_it_pos--;
              } else {
                     if ($this->_it_mode & self::IT_MODE_DELETE) {
                            $this->shift();
                     } else {
                            $this->_it_pos++;
                     }
              }
       }

Here is the call graph for this function:

Returns:
whether a certain offset exists in the DLL
Parameters:
$offsetThe offset
Exceptions:
OutOfRangeExceptionIf the offset is either invalid or out of range.

Implements ArrayAccess.

Definition at line 199 of file spldoublylinkedlist.inc.

       {
              if (!is_numeric($offset)) {
                     throw new OutOfRangeException("Offset invalid or out of range");
              } else {
                     return array_key_exists($offset, $this->_llist);
              }
       }
Returns:
the data at a certain offset in the DLL
Parameters:
$offsetThe offset
Exceptions:
OutOfRangeExceptionIf the offset is either invalid or out of range.

Implements ArrayAccess.

Definition at line 214 of file spldoublylinkedlist.inc.

       {
              if ($this->_it_mode & self::IT_MODE_LIFO) {
                     $realOffset = count($this->_llist)-$offset;
              } else {
                     $realOffset = $offset;
              }

              if (!is_numeric($offset) || !array_key_exists($realOffset, $this->_llist)) {
                     throw new OutOfRangeException("Offset invalid or out of range");
              } else {
                     return $this->_llist[$realOffset];
              }
       }

Here is the call graph for this function:

SplDoublyLinkedList::offsetSet ( offset,
value 
)

Defines the data at a certain offset in the DLL.

Parameters:
$offsetThe offset
$valueNew value
Exceptions:
OutOfRangeExceptionIf the offset is either invalid or out of range.

Implements ArrayAccess.

Definition at line 236 of file spldoublylinkedlist.inc.

       {
              if ($offset === null) {
                     return $this->push($value);
              }

              if ($this->_it_mode & self::IT_MODE_LIFO) {
                     $realOffset = count($this->_llist)-$offset;
              } else {
                     $realOffset = $offset;
              }

              if (!is_numeric($offset) || !array_key_exists($realOffset, $this->_llist)) {
                     throw new OutOfRangeException("Offset invalid or out of range");
              } else {
                     $this->_llist[$realOffset] = $value;
              }
       }

Here is the call graph for this function:

Unsets the element at a certain offset in the DLL.

Parameters:
$offsetThe offset
Exceptions:
OutOfRangeExceptionIf the offset is either invalid or out of range.

Implements ArrayAccess.

Definition at line 261 of file spldoublylinkedlist.inc.

       {
              if ($this->_it_mode & self::IT_MODE_LIFO) {
                     $realOffset = count($this->_llist)-$offset;
              } else {
                     $realOffset = $offset;
              }

              if (!is_numeric($offset) || !array_key_exists($realOffset, $this->_llist)) {
                     throw new OutOfRangeException("Offset invalid or out of range");
              } else {
                     array_splice($this->_llist, $realOffset, 1);
              }
       }

Here is the call graph for this function:

Returns:
the element popped from the end of the DLL.
Exceptions:
RuntimeExceptionIf the datastructure is empty.

Definition at line 51 of file spldoublylinkedlist.inc.

       {
              if (count($this->_llist) == 0) {
                     throw new RuntimeException("Can't pop from an empty datastructure");
              }
              return array_pop($this->_llist);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Pushes an element to the end of the DLL.

Parameters:
$datavariable to add to the DLL.

Definition at line 73 of file spldoublylinkedlist.inc.

       {
              array_push($this->_llist, $data);
              return true;
       }

Here is the caller graph for this function:

Rewind to top iterator as set in constructor.

Implements Iterator.

Definition at line 145 of file spldoublylinkedlist.inc.

       {
              if ($this->_it_mode & self::IT_MODE_LIFO) {
                     $this->_it_pos = count($this->_llist)-1;
              } else {
                     $this->_it_pos = 0;
              }
       }

Here is the call graph for this function:

Changes the iteration mode.

There are two orthogonal sets of modes that can be set:

  • The direction of the iteration (either one or the other)
    • SplDoublyLnkedList::IT_MODE_LIFO (Stack style)
    • SplDoublyLnkedList::IT_MODE_FIFO (Queue style)
  • The behavior of the iterator (either one or the other)
    • SplDoublyLnkedList::IT_MODE_DELETE (Elements are deleted by the iterator)
    • SplDoublyLnkedList::IT_MODE_KEEP (Elements are traversed by the iterator)

The default mode is 0 : SplDoublyLnkedList::IT_MODE_FIFO | SplDoublyLnkedList::IT_MODE_KEEP

Parameters:
$modenew mode of iteration

Reimplemented in SplQueue, and SplStack.

Definition at line 130 of file spldoublylinkedlist.inc.

       {
              $this->_it_mode = $mode;
       }
Returns:
the element shifted from the beginning of the DLL.
Exceptions:
RuntimeExceptionIf the datastructure is empty.

Definition at line 62 of file spldoublylinkedlist.inc.

       {
              if (count($this->_llist) == 0) {
                     throw new RuntimeException("Can't shift from an empty datastructure");
              }
              return array_shift($this->_llist);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Returns:
the element at the beginning of the DLL.

Definition at line 90 of file spldoublylinkedlist.inc.

       {
              return end($this->_llist);
       }

Adds an element to the beginning of the DLL.

Parameters:
$datavariable to add to the DLL.

Definition at line 82 of file spldoublylinkedlist.inc.

       {
              array_unshift($this->_llist, $data);
              return true;
       }
Returns:
whether iterator is valid

Implements Iterator.

Definition at line 156 of file spldoublylinkedlist.inc.

       {
              return array_key_exists($this->_it_pos, $this->_llist);
       }

Member Data Documentation

Reimplemented in SplQueue, and SplStack.

Definition at line 25 of file spldoublylinkedlist.inc.

Definition at line 26 of file spldoublylinkedlist.inc.

SplDoublyLinkedList::$_llist = array() [protected]

Definition at line 24 of file spldoublylinkedlist.inc.

Iterator mode.

See also:
setIteratorMode

Definition at line 46 of file spldoublylinkedlist.inc.

Iterator mode.

See also:
setIteratorMode

Definition at line 36 of file spldoublylinkedlist.inc.

Iterator mode.

See also:
setIteratorMode

Definition at line 41 of file spldoublylinkedlist.inc.

Iterator mode.

See also:
setIteratorMode

Definition at line 31 of file spldoublylinkedlist.inc.

class SplFileObject

Object representation for any stream.

Author:
Marcus Boerger
Version:
1.1
Since:
PHP 5.1

Definition at line 18 of file splfileobject.inc.

Inheritance diagram for SplFileObject:
Collaboration diagram for SplFileObject:

Public Member Functions

 __construct ($file_name, $open_mode= 'r', $use_include_path=false, $context=NULL)
 Constructs a new file object.
 eof ()
 fgets ()
 increase current line number
 fgetcsv ($delimiter=NULL, $enclosure=NULL)
 setCsvControl ($delimiter= ';', $enclosure= '"')
 Set the delimiter and enclosure character used in fgetcsv.
 getCsvControl ($delimiter= ',', $enclosure= '"')
 flock ($operation, &$wouldblock)
 fflush ()
 Flush current data.
 ftell ()
 fseek ($pos, $whence=SEEK_SET)
 fgetc ()
 fpassthru ()
 Read and return remaining part of stream.
 fgetss ($allowable_tags=NULL)
 Get a line from the file and strip HTML tags.
 fscanf ($format)
 Scan the next line.
 fwrite ($str, $length=NULL)
 fstat ()
 ftruncate ($size)
 setFlags ($flags)
 getFlags ()
 setMaxLineLen ($max_len)
 getMaxLineLen ()
 hasChildren ()
 getChildren ()
 rewind ()
 Invalidate current line buffer and set line number to 0.
 valid ()
 current ()
 key ()
 next ()
 Invalidate current line buffer.
 getCurrentLine ()
 __toString ()
 seek ($line_pos)
 getPath ()
 getFilename ()
 getFileInfo (string class_name=NULL)
 getPathname ()
 getPathInfo (string class_name=NULL)
 getPerms ()
 getInode ()
 getSize ()
 getOwner ()
 getGroup ()
 getATime ()
 getMTime ()
 getCTime ()
 getType ()
 isWritable ()
 isReadable ()
 isExecutable ()
 isFile ()
 isDir ()
 isLink ()
 getLinkTarget ()
 getRealPath ()
 openFile ($mode= 'r', $use_include_path=false, $context=NULL)
 Open the current file as a SplFileObject instance.
 setFileClass (string class_name="SplFileObject")
 setInfoClass (string class_name="SplFileInfo")

Public Attributes

const DROP_NEW_LINE = 0x00000001
 Flag: wheter to suppress new lines.

Private Member Functions

 readLine ()
 freeLine ()
 Free the current line buffer and increment the line counter.

Private Attributes

 $fp
 $fname
 $line = NULL
 $lnum = 0
 $max_len = 0
 $flags = 0
 $delimiter = ','
 $enclosure = '"'

Constructor & Destructor Documentation

SplFileObject::__construct ( file_name,
open_mode = 'r',
use_include_path = false,
context = NULL 
)

Constructs a new file object.

Parameters:
$file_nameThe name of the stream to open
$open_modeThe file open mode
$use_include_pathWhether to search in include paths
$contextA stream context
Exceptions:
RuntimeExceptionIf file cannot be opened (e.g. insufficient access rights).

Definition at line 42 of file splfileobject.inc.

       {
              $this->fp = fopen($file_name, $open_mode, $use_include_path, $context);
              if (!$this->fp)
              {
                     throw new RuntimeException("Cannot open file $file_name");
              }
              $this->fname = $file_name;
       }

Member Function Documentation

Returns:
current line

Reimplemented from SplFileInfo.

Definition at line 359 of file splfileobject.inc.

       {
              return current();
       }

Here is the call graph for this function:

Note:
Fill current line buffer if not done yet.
Returns:
line buffer

Implements Iterator.

Definition at line 284 of file splfileobject.inc.

       {
              if (is_null($this->line))
              {
                     $this->line = getCurrentLine();
              }
              return $this->line;
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Returns:
whether the end of the stream is reached

Definition at line 55 of file splfileobject.inc.

       {
              return eof($this->fp);
       }

Here is the caller graph for this function:

Flush current data.

Returns:
success or failure

Definition at line 127 of file splfileobject.inc.

       {
              return fflush($this->fp);
       }
Returns:
next char from file
Note:
a new line character does not increase $this->lnum

Definition at line 155 of file splfileobject.inc.

       {
              $this->freeLine();
              $c = fgetc($this->fp);
              if ($c == '\n') {
                     $this->lnum++;
              }
       }

Here is the call graph for this function:

SplFileObject::fgetcsv ( delimiter = NULL,
enclosure = NULL 
)
Parameters:
delimitercharacter used as field separator
enclosureend of
Returns:
array containing read data

Definition at line 77 of file splfileobject.inc.

       {
              $this->freeLine();
              $this->lnum++;
              switch(fun_num_args())
              {
                     case 0:
                            $delimiter = $this->delimiter;
                     case 1:
                            $enclosure = $this->enclosure;
                     default:
                     case 2:
                            break;
              }
              return fgetcsv($this->fp, $this->max_len, $delimiter, $enclosure); 
       }

Here is the call graph for this function:

increase current line number

Returns:
next line from stream

Definition at line 63 of file splfileobject.inc.

       {
              $this->freeLine();
              $this->lnum++;
              $buf = fgets($this->fp, $this->max_len);
              
              return $buf;
       }

Here is the call graph for this function:

Here is the caller graph for this function:

SplFileObject::fgetss ( allowable_tags = NULL)

Get a line from the file and strip HTML tags.

Parameters:
$allowable_tagstags to keep in the string

Definition at line 175 of file splfileobject.inc.

       {
              return fgetss($this->fp, $allowable_tags);
       }
SplFileObject::flock ( operation,
&$  wouldblock 
)
Parameters:
operationlock operation (LOCK_SH, LOCK_EX, LOCK_UN, LOCK_NB)
Return values:
$wouldblockwhether the operation would block

Definition at line 118 of file splfileobject.inc.

       {
              return flock($this->fp, $operation, $wouldblock);
       }

Read and return remaining part of stream.

Returns:
size of remaining part passed through

Definition at line 167 of file splfileobject.inc.

       {
              return fpassthru($this->fp);
       }
SplFileObject::freeLine ( ) [private]

Free the current line buffer and increment the line counter.

Definition at line 334 of file splfileobject.inc.

       {
              if ($this->line) {
                     $this->line = NULL;
              }
       }

Here is the caller graph for this function:

SplFileObject::fscanf ( format)

Scan the next line.

Parameters:
$formatstring specifying format to parse

Definition at line 183 of file splfileobject.inc.

       {
              $this->freeLine();
              $this->lnum++;
              return fscanf($this->fp, $format /* , ... */);
       }

Here is the call graph for this function:

SplFileObject::fseek ( pos,
whence = SEEK_SET 
)
Parameters:
posnew file position
whenceseek method (SEEK_SET, SEEK_CUR, SEEK_END)
Returns:
Upon success, returns 0; otherwise, returns -1. Note that seeking past EOF is not considered an error.

Definition at line 146 of file splfileobject.inc.

       {
              return fseek($this->fp, $pos, $whence);
       }
Returns:
array of file stat information

Definition at line 202 of file splfileobject.inc.

       {
              return fstat($this->fp);
       }
Returns:
current file position

Definition at line 135 of file splfileobject.inc.

       {
              return ftell($this->fp);
       }
Parameters:
$sizenew size to truncate file to

Definition at line 210 of file splfileobject.inc.

       {
              return ftruncate($this->fp, $size);
       }
SplFileObject::fwrite ( str,
length = NULL 
)
Parameters:
$strto write
$lengthmaximum line length to write

Definition at line 194 of file splfileobject.inc.

       {
              return fwrite($this->fp, $length);
       }
SplFileInfo::getATime ( ) [inherited]
Returns:
The current entry's last access time.

Definition at line 910 of file spl.php.

{}
Returns:
false

Implements RecursiveIterator.

Definition at line 258 of file splfileobject.inc.

       {
              return NULL;
       }
SplFileObject::getCsvControl ( delimiter = ',',
enclosure = '"' 
)
Returns:
array(delimiter, enclosure) as used in fgetcsv

Definition at line 109 of file splfileobject.inc.

       {
              return array($this->delimiter, $this->enclosure);
       }
SplFileInfo::getCTime ( ) [inherited]
Returns:
The current entry's last change time.

Definition at line 918 of file spl.php.

{}

Definition at line 346 of file splfileobject.inc.

       {
              $this->freeLine();
              if ($this->eof())
              {
                     throw new RuntimeException("Cannot read from file " . $this->fname);
              }
              $this->readLine();
       }

Here is the call graph for this function:

Here is the caller graph for this function:

SplFileInfo::getFileInfo ( string  class_name = NULL) [inherited]
Returns:
SplFileInfo created for the file
Parameters:
class_namename of class to instantiate
See also:
SplFileInfo::setInfoClass()

Definition at line 876 of file spl.php.

{}
SplFileInfo::getFilename ( ) [inherited]
Returns:
the filename only.

Definition at line 870 of file spl.php.

{}
Returns:
current set of flags

Definition at line 226 of file splfileobject.inc.

       {
              return $this->flags;
       }
SplFileInfo::getGroup ( ) [inherited]
Returns:
The current entry's group name.

Definition at line 906 of file spl.php.

{}
SplFileInfo::getInode ( ) [inherited]
Returns:
The current entry's inode.

Definition at line 894 of file spl.php.

{}
SplFileInfo::getLinkTarget ( ) [inherited]
Returns:
target of link.

Definition at line 950 of file spl.php.

{}
Returns:
current setting for max line

Definition at line 242 of file splfileobject.inc.

       {
              return $this->max_len;
       }
SplFileInfo::getMTime ( ) [inherited]
Returns:
The current entry's last modification time.

Definition at line 914 of file spl.php.

{}
SplFileInfo::getOwner ( ) [inherited]
Returns:
The current entry's owner name.

Definition at line 902 of file spl.php.

{}
SplFileInfo::getPath ( ) [inherited]
Returns:
the path part only.

Definition at line 866 of file spl.php.

{}
SplFileInfo::getPathInfo ( string  class_name = NULL) [inherited]
Returns:
SplFileInfo created for the path
Parameters:
class_namename of class to instantiate
See also:
SplFileInfo::setInfoClass()

Definition at line 886 of file spl.php.

{}
SplFileInfo::getPathname ( ) [inherited]
Returns:
The current entries path and file name.

Definition at line 880 of file spl.php.

{}
SplFileInfo::getPerms ( ) [inherited]
Returns:
The current entry's permissions.

Definition at line 890 of file spl.php.

{}
SplFileInfo::getRealPath ( ) [inherited]
Returns:
The resolved path

Definition at line 954 of file spl.php.

{}
SplFileInfo::getSize ( ) [inherited]
Returns:
The current entry's size in bytes .

Definition at line 898 of file spl.php.

{}
SplFileInfo::getType ( ) [inherited]
Returns:
The current entry's file type.

Definition at line 922 of file spl.php.

{}
Returns:
false

Implements RecursiveIterator.

Definition at line 250 of file splfileobject.inc.

       {
              return false;
       }
SplFileInfo::isDir ( ) [inherited]
Returns:
Whether the current entry is a directory.

Definition at line 942 of file spl.php.

{}
SplFileInfo::isExecutable ( ) [inherited]
Returns:
Whether the current entry is executable.

Definition at line 934 of file spl.php.

{}
SplFileInfo::isFile ( ) [inherited]
Returns:
Whether the current entry is .

Definition at line 938 of file spl.php.

{}
SplFileInfo::isLink ( ) [inherited]
Returns:
whether the current entry is a link.

Reimplemented in DirectoryIterator.

Definition at line 946 of file spl.php.

{}
SplFileInfo::isReadable ( ) [inherited]
Returns:
Whether the current entry is readable.

Definition at line 930 of file spl.php.

{}
SplFileInfo::isWritable ( ) [inherited]
Returns:
Whether the current entry is writeable.

Definition at line 926 of file spl.php.

{}
Returns:
line number
Note:
fgetc() will increase the line number when reaing a new line char. This has the effect key() called on a read a new line will already return the increased line number.
Line counting works as long as you only read the file and do not use fseek().

Implements Iterator.

Definition at line 301 of file splfileobject.inc.

       {
              return $this->lnum;
       }

Invalidate current line buffer.

Implements Iterator.

Definition at line 308 of file splfileobject.inc.

       {
              $this->freeLine();
       }

Here is the call graph for this function:

SplFileInfo::openFile ( mode = 'r',
use_include_path = false,
context = NULL 
) [inherited]

Open the current file as a SplFileObject instance.

Parameters:
modeopen mode
use_include_pathwhether to search include paths (don't use)
contextresource context to pased to open function
Exceptions:
RuntimeExceptionif file cannot be opened (e.g. insufficient access rights).
Returns:
The opened file as a SplFileObject instance
See also:
SplFileObject
SplFileInfo::setFileClass()
file()

Definition at line 973 of file spl.php.

{}
SplFileObject::readLine ( ) [private]
Returns:
next line read from file and increase the line counter

Definition at line 316 of file splfileobject.inc.

       {
              if ($this->eof())
              {
                     $this->freeLine();
                     throw new RuntimeException("Cannot read from file " . $this->fname);
              }
              if ($this->line) {
                     $this->lnum++;
              }
              $this->freeLine();
              $this->line = fgets($this->fp, $this->max_len);
              return $this->line;
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Invalidate current line buffer and set line number to 0.

Implements Iterator.

Definition at line 266 of file splfileobject.inc.

       {
              $this->freeLine();
              $this->lnum = 0;
       }

Here is the call graph for this function:

Here is the caller graph for this function:

SplFileObject::seek ( line_pos)
Parameters:
$line_posSeek to this line

Implements SeekableIterator.

Definition at line 367 of file splfileobject.inc.

       {
              $this->rewind();
              while($this->lnum < $line_pos && !$this->eof())
              {
                     $this->getCurrentLine();
              }
       }

Here is the call graph for this function:

SplFileObject::setCsvControl ( delimiter = ';',
enclosure = '"' 
)

Set the delimiter and enclosure character used in fgetcsv.

Parameters:
delimiternew delimiter, defaults to ','
enclosurenew enclosure, defaults to '"'

Definition at line 100 of file splfileobject.inc.

       {
              $this->delimiter = $delimiter;
              $this->enclosure = $enclosure;
       }
SplFileInfo::setFileClass ( string  class_name = "SplFileObject") [inherited]
Parameters:
class_namename of class used with openFile(). Must be derived from SPLFileObject.

Definition at line 978 of file spl.php.

{}
Parameters:
$flagsnew flag set

Definition at line 218 of file splfileobject.inc.

       {
              $this->flags = $flags;
       }
SplFileInfo::setInfoClass ( string  class_name = "SplFileInfo") [inherited]
Parameters:
class_namename of class used with getFileInfo(), getPathInfo(). Must be derived from SplFileInfo.

Definition at line 983 of file spl.php.

{}
Parameters:
$max_lenset the maximum line length read

Definition at line 234 of file splfileobject.inc.

       {
              $this->max_len = $max_len;
       }
Returns:
whether more data can be read

Implements Iterator.

Definition at line 275 of file splfileobject.inc.

       {
              return !$this->eof();
       }

Here is the call graph for this function:


Member Data Documentation

SplFileObject::$delimiter = ',' [private]

Definition at line 29 of file splfileobject.inc.

SplFileObject::$enclosure = '"' [private]

Definition at line 30 of file splfileobject.inc.

SplFileObject::$flags = 0 [private]

Definition at line 28 of file splfileobject.inc.

Definition at line 24 of file splfileobject.inc.

SplFileObject::$fp [private]

Definition at line 23 of file splfileobject.inc.

Definition at line 25 of file splfileobject.inc.

SplFileObject::$lnum = 0 [private]

Definition at line 26 of file splfileobject.inc.

SplFileObject::$max_len = 0 [private]

Definition at line 27 of file splfileobject.inc.

const SplFileObject::DROP_NEW_LINE = 0x00000001

Flag: wheter to suppress new lines.

Definition at line 21 of file splfileobject.inc.

class SplQueue

Implementation of a Queue through a DoublyLinkedList.

As SplQueue extends SplDoublyLinkedList, unshift() and pop() are still available even though they don't make much sense for a queue. For convenience, two aliases are available:

Since:
PHP 5.3

The SplQueue class provides the main functionalities of a queue implemented using a doubly linked list (DLL).

Definition at line 25 of file splqueue.inc.

Inheritance diagram for SplQueue:
Collaboration diagram for SplQueue:

Public Member Functions

 setIteratorMode ($mode)
 Changes the iteration mode.
 dequeue ()
 enqueue ($data)
 Pushes an element at the end of the queue.
 pop ()
 shift ()
 push ($data)
 Pushes an element to the end of the DLL.
 unshift ($data)
 Adds an element to the beginning of the DLL.
 top ()
 bottom ()
 count ()
 isEmpty ()
 getIteratorMode ()
 rewind ()
 Rewind to top iterator as set in constructor.
 valid ()
 key ()
 current ()
 next ()
 Forward to next element.
 offsetExists ($offset)
 offsetGet ($offset)
 offsetSet ($offset, $value)
 Defines the data at a certain offset in the DLL.
 offsetUnset ($offset)
 Unsets the element at a certain offset in the DLL.

Public Attributes

const IT_MODE_LIFO = 0x00000002
 Iterator mode.
const IT_MODE_FIFO = 0x00000000
 Iterator mode.
const IT_MODE_KEEP = 0x00000000
 Iterator mode.
const IT_MODE_DELETE = 0x00000001
 Iterator mode.

Protected Attributes

 $_it_mode = parent::IT_MODE_FIFO
 $_llist = array()
 $_it_pos = 0

Member Function Documentation

SplDoublyLinkedList::bottom ( ) [inherited]
Returns:
the element at the end of the DLL.

Definition at line 97 of file spldoublylinkedlist.inc.

       {
              return reset($this->_llist);
       }
SplDoublyLinkedList::count ( ) [inherited]
Returns:
number elements in the DLL.

Implements Countable.

Definition at line 104 of file spldoublylinkedlist.inc.

       {
              return count($this->_llist);
       }

Here is the caller graph for this function:

Returns:
current object

Implements Iterator.

Definition at line 170 of file spldoublylinkedlist.inc.

       {
              return $this->_llist[$this->_it_pos];
       }
Returns:
the first element of the queue.
Note:
dequeue is an alias of push()
See also:
splDoublyLinkedList::push()

Definition at line 55 of file splqueue.inc.

       {
              return parent::shift();
       }

Here is the call graph for this function:

SplQueue::enqueue ( data)

Pushes an element at the end of the queue.

Parameters:
$datavariable to add to the queue.
Note:
enqueue is an alias of shift()
See also:
splDoublyLinkedList::shift()

Definition at line 65 of file splqueue.inc.

       {
              return parent::push($data);
       }

Here is the call graph for this function:

Returns:
the current iteration mode
See also:
setIteratorMode

Definition at line 138 of file spldoublylinkedlist.inc.

       {
              return $this->_it_mode;
       }
Returns:
whether the DLL is empty.

Definition at line 111 of file spldoublylinkedlist.inc.

       {
              return ($this->count() == 0);
       }

Here is the call graph for this function:

SplDoublyLinkedList::key ( ) [inherited]
Returns:
current key

Implements Iterator.

Definition at line 163 of file spldoublylinkedlist.inc.

       {
              return $this->_it_pos;
       }
SplDoublyLinkedList::next ( ) [inherited]

Forward to next element.

Implements Iterator.

Definition at line 177 of file spldoublylinkedlist.inc.

       {
              if ($this->_it_mode & self::IT_MODE_LIFO) {
                     if ($this->_it_mode & self::IT_MODE_DELETE) {
                            $this->pop();
                     }
                     $this->_it_pos--;
              } else {
                     if ($this->_it_mode & self::IT_MODE_DELETE) {
                            $this->shift();
                     } else {
                            $this->_it_pos++;
                     }
              }
       }

Here is the call graph for this function:

SplDoublyLinkedList::offsetExists ( offset) [inherited]
Returns:
whether a certain offset exists in the DLL
Parameters:
$offsetThe offset
Exceptions:
OutOfRangeExceptionIf the offset is either invalid or out of range.

Implements ArrayAccess.

Definition at line 199 of file spldoublylinkedlist.inc.

       {
              if (!is_numeric($offset)) {
                     throw new OutOfRangeException("Offset invalid or out of range");
              } else {
                     return array_key_exists($offset, $this->_llist);
              }
       }
SplDoublyLinkedList::offsetGet ( offset) [inherited]
Returns:
the data at a certain offset in the DLL
Parameters:
$offsetThe offset
Exceptions:
OutOfRangeExceptionIf the offset is either invalid or out of range.

Implements ArrayAccess.

Definition at line 214 of file spldoublylinkedlist.inc.

       {
              if ($this->_it_mode & self::IT_MODE_LIFO) {
                     $realOffset = count($this->_llist)-$offset;
              } else {
                     $realOffset = $offset;
              }

              if (!is_numeric($offset) || !array_key_exists($realOffset, $this->_llist)) {
                     throw new OutOfRangeException("Offset invalid or out of range");
              } else {
                     return $this->_llist[$realOffset];
              }
       }

Here is the call graph for this function:

SplDoublyLinkedList::offsetSet ( offset,
value 
) [inherited]

Defines the data at a certain offset in the DLL.

Parameters:
$offsetThe offset
$valueNew value
Exceptions:
OutOfRangeExceptionIf the offset is either invalid or out of range.

Implements ArrayAccess.

Definition at line 236 of file spldoublylinkedlist.inc.

       {
              if ($offset === null) {
                     return $this->push($value);
              }

              if ($this->_it_mode & self::IT_MODE_LIFO) {
                     $realOffset = count($this->_llist)-$offset;
              } else {
                     $realOffset = $offset;
              }

              if (!is_numeric($offset) || !array_key_exists($realOffset, $this->_llist)) {
                     throw new OutOfRangeException("Offset invalid or out of range");
              } else {
                     $this->_llist[$realOffset] = $value;
              }
       }

Here is the call graph for this function:

SplDoublyLinkedList::offsetUnset ( offset) [inherited]

Unsets the element at a certain offset in the DLL.

Parameters:
$offsetThe offset
Exceptions:
OutOfRangeExceptionIf the offset is either invalid or out of range.

Implements ArrayAccess.

Definition at line 261 of file spldoublylinkedlist.inc.

       {
              if ($this->_it_mode & self::IT_MODE_LIFO) {
                     $realOffset = count($this->_llist)-$offset;
              } else {
                     $realOffset = $offset;
              }

              if (!is_numeric($offset) || !array_key_exists($realOffset, $this->_llist)) {
                     throw new OutOfRangeException("Offset invalid or out of range");
              } else {
                     array_splice($this->_llist, $realOffset, 1);
              }
       }

Here is the call graph for this function:

SplDoublyLinkedList::pop ( ) [inherited]
Returns:
the element popped from the end of the DLL.
Exceptions:
RuntimeExceptionIf the datastructure is empty.

Definition at line 51 of file spldoublylinkedlist.inc.

       {
              if (count($this->_llist) == 0) {
                     throw new RuntimeException("Can't pop from an empty datastructure");
              }
              return array_pop($this->_llist);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

SplDoublyLinkedList::push ( data) [inherited]

Pushes an element to the end of the DLL.

Parameters:
$datavariable to add to the DLL.

Definition at line 73 of file spldoublylinkedlist.inc.

       {
              array_push($this->_llist, $data);
              return true;
       }

Here is the caller graph for this function:

SplDoublyLinkedList::rewind ( ) [inherited]

Rewind to top iterator as set in constructor.

Implements Iterator.

Definition at line 145 of file spldoublylinkedlist.inc.

       {
              if ($this->_it_mode & self::IT_MODE_LIFO) {
                     $this->_it_pos = count($this->_llist)-1;
              } else {
                     $this->_it_pos = 0;
              }
       }

Here is the call graph for this function:

Changes the iteration mode.

There are two orthogonal sets of modes that can be set:

  • The behavior of the iterator (either one or the other)
    • SplDoublyLnkedList::IT_MODE_DELETE (Elements are deleted by the iterator)
    • SplDoublyLnkedList::IT_MODE_KEEP (Elements are traversed by the iterator)

The default mode is 0 : SplDoublyLnkedList::IT_MODE_LIFO | SplDoublyLnkedList::IT_MODE_KEEP

Note:
The iteration's direction is not modifiable for queue instances
Parameters:
$modeNew mode of iteration
Exceptions:
RuntimeExceptionIf the new mode affects the iteration's direction.

Reimplemented from SplDoublyLinkedList.

Definition at line 42 of file splqueue.inc.

       {
              if ($mode & parent::IT_MODE_LIFO === parent::IT_MODE_LIFO) {
                     throw new RuntimeException("Iterators' LIFO/FIFO modes for SplStack/SplQueue objects are frozen");
              }

              $this->_it_mode = $mode;
       }
SplDoublyLinkedList::shift ( ) [inherited]
Returns:
the element shifted from the beginning of the DLL.
Exceptions:
RuntimeExceptionIf the datastructure is empty.

Definition at line 62 of file spldoublylinkedlist.inc.

       {
              if (count($this->_llist) == 0) {
                     throw new RuntimeException("Can't shift from an empty datastructure");
              }
              return array_shift($this->_llist);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

SplDoublyLinkedList::top ( ) [inherited]
Returns:
the element at the beginning of the DLL.

Definition at line 90 of file spldoublylinkedlist.inc.

       {
              return end($this->_llist);
       }
SplDoublyLinkedList::unshift ( data) [inherited]

Adds an element to the beginning of the DLL.

Parameters:
$datavariable to add to the DLL.

Definition at line 82 of file spldoublylinkedlist.inc.

       {
              array_unshift($this->_llist, $data);
              return true;
       }
SplDoublyLinkedList::valid ( ) [inherited]
Returns:
whether iterator is valid

Implements Iterator.

Definition at line 156 of file spldoublylinkedlist.inc.

       {
              return array_key_exists($this->_it_pos, $this->_llist);
       }

Member Data Documentation

SplQueue::$_it_mode = parent::IT_MODE_FIFO [protected]

Reimplemented from SplDoublyLinkedList.

Definition at line 27 of file splqueue.inc.

SplDoublyLinkedList::$_it_pos = 0 [protected, inherited]

Definition at line 26 of file spldoublylinkedlist.inc.

SplDoublyLinkedList::$_llist = array() [protected, inherited]

Definition at line 24 of file spldoublylinkedlist.inc.

const SplDoublyLinkedList::IT_MODE_DELETE = 0x00000001 [inherited]

Iterator mode.

See also:
setIteratorMode

Definition at line 46 of file spldoublylinkedlist.inc.

const SplDoublyLinkedList::IT_MODE_FIFO = 0x00000000 [inherited]

Iterator mode.

See also:
setIteratorMode

Definition at line 36 of file spldoublylinkedlist.inc.

const SplDoublyLinkedList::IT_MODE_KEEP = 0x00000000 [inherited]

Iterator mode.

See also:
setIteratorMode

Definition at line 41 of file spldoublylinkedlist.inc.

const SplDoublyLinkedList::IT_MODE_LIFO = 0x00000002 [inherited]

Iterator mode.

See also:
setIteratorMode

Definition at line 31 of file spldoublylinkedlist.inc.

class SplStack

Implementation of a stack through a DoublyLinkedList.

As SplStack extends SplDoublyLinkedList, shift() and unshift() are still available even though they don't make much sense for a stack.

Since:
PHP 5.3

The SplStack class provides the main functionalities of a stack implemented using a doubly linked list (DLL).

Definition at line 21 of file splstack.inc.

Inheritance diagram for SplStack:
Collaboration diagram for SplStack:

Public Member Functions

 setIteratorMode ($mode)
 Changes the iteration mode.
 pop ()
 shift ()
 push ($data)
 Pushes an element to the end of the DLL.
 unshift ($data)
 Adds an element to the beginning of the DLL.
 top ()
 bottom ()
 count ()
 isEmpty ()
 getIteratorMode ()
 rewind ()
 Rewind to top iterator as set in constructor.
 valid ()
 key ()
 current ()
 next ()
 Forward to next element.
 offsetExists ($offset)
 offsetGet ($offset)
 offsetSet ($offset, $value)
 Defines the data at a certain offset in the DLL.
 offsetUnset ($offset)
 Unsets the element at a certain offset in the DLL.

Public Attributes

const IT_MODE_LIFO = 0x00000002
 Iterator mode.
const IT_MODE_FIFO = 0x00000000
 Iterator mode.
const IT_MODE_KEEP = 0x00000000
 Iterator mode.
const IT_MODE_DELETE = 0x00000001
 Iterator mode.

Protected Attributes

 $_it_mode = parent::IT_MODE_LIFO
 $_llist = array()
 $_it_pos = 0

Member Function Documentation

SplDoublyLinkedList::bottom ( ) [inherited]
Returns:
the element at the end of the DLL.

Definition at line 97 of file spldoublylinkedlist.inc.

       {
              return reset($this->_llist);
       }
SplDoublyLinkedList::count ( ) [inherited]
Returns:
number elements in the DLL.

Implements Countable.

Definition at line 104 of file spldoublylinkedlist.inc.

       {
              return count($this->_llist);
       }

Here is the caller graph for this function:

Returns:
current object

Implements Iterator.

Definition at line 170 of file spldoublylinkedlist.inc.

       {
              return $this->_llist[$this->_it_pos];
       }
Returns:
the current iteration mode
See also:
setIteratorMode

Definition at line 138 of file spldoublylinkedlist.inc.

       {
              return $this->_it_mode;
       }
Returns:
whether the DLL is empty.

Definition at line 111 of file spldoublylinkedlist.inc.

       {
              return ($this->count() == 0);
       }

Here is the call graph for this function:

SplDoublyLinkedList::key ( ) [inherited]
Returns:
current key

Implements Iterator.

Definition at line 163 of file spldoublylinkedlist.inc.

       {
              return $this->_it_pos;
       }
SplDoublyLinkedList::next ( ) [inherited]

Forward to next element.

Implements Iterator.

Definition at line 177 of file spldoublylinkedlist.inc.

       {
              if ($this->_it_mode & self::IT_MODE_LIFO) {
                     if ($this->_it_mode & self::IT_MODE_DELETE) {
                            $this->pop();
                     }
                     $this->_it_pos--;
              } else {
                     if ($this->_it_mode & self::IT_MODE_DELETE) {
                            $this->shift();
                     } else {
                            $this->_it_pos++;
                     }
              }
       }

Here is the call graph for this function:

SplDoublyLinkedList::offsetExists ( offset) [inherited]
Returns:
whether a certain offset exists in the DLL
Parameters:
$offsetThe offset
Exceptions:
OutOfRangeExceptionIf the offset is either invalid or out of range.

Implements ArrayAccess.

Definition at line 199 of file spldoublylinkedlist.inc.

       {
              if (!is_numeric($offset)) {
                     throw new OutOfRangeException("Offset invalid or out of range");
              } else {
                     return array_key_exists($offset, $this->_llist);
              }
       }
SplDoublyLinkedList::offsetGet ( offset) [inherited]
Returns:
the data at a certain offset in the DLL
Parameters:
$offsetThe offset
Exceptions:
OutOfRangeExceptionIf the offset is either invalid or out of range.

Implements ArrayAccess.

Definition at line 214 of file spldoublylinkedlist.inc.

       {
              if ($this->_it_mode & self::IT_MODE_LIFO) {
                     $realOffset = count($this->_llist)-$offset;
              } else {
                     $realOffset = $offset;
              }

              if (!is_numeric($offset) || !array_key_exists($realOffset, $this->_llist)) {
                     throw new OutOfRangeException("Offset invalid or out of range");
              } else {
                     return $this->_llist[$realOffset];
              }
       }

Here is the call graph for this function:

SplDoublyLinkedList::offsetSet ( offset,
value 
) [inherited]

Defines the data at a certain offset in the DLL.

Parameters:
$offsetThe offset
$valueNew value
Exceptions:
OutOfRangeExceptionIf the offset is either invalid or out of range.

Implements ArrayAccess.

Definition at line 236 of file spldoublylinkedlist.inc.

       {
              if ($offset === null) {
                     return $this->push($value);
              }

              if ($this->_it_mode & self::IT_MODE_LIFO) {
                     $realOffset = count($this->_llist)-$offset;
              } else {
                     $realOffset = $offset;
              }

              if (!is_numeric($offset) || !array_key_exists($realOffset, $this->_llist)) {
                     throw new OutOfRangeException("Offset invalid or out of range");
              } else {
                     $this->_llist[$realOffset] = $value;
              }
       }

Here is the call graph for this function:

SplDoublyLinkedList::offsetUnset ( offset) [inherited]

Unsets the element at a certain offset in the DLL.

Parameters:
$offsetThe offset
Exceptions:
OutOfRangeExceptionIf the offset is either invalid or out of range.

Implements ArrayAccess.

Definition at line 261 of file spldoublylinkedlist.inc.

       {
              if ($this->_it_mode & self::IT_MODE_LIFO) {
                     $realOffset = count($this->_llist)-$offset;
              } else {
                     $realOffset = $offset;
              }

              if (!is_numeric($offset) || !array_key_exists($realOffset, $this->_llist)) {
                     throw new OutOfRangeException("Offset invalid or out of range");
              } else {
                     array_splice($this->_llist, $realOffset, 1);
              }
       }

Here is the call graph for this function:

SplDoublyLinkedList::pop ( ) [inherited]
Returns:
the element popped from the end of the DLL.
Exceptions:
RuntimeExceptionIf the datastructure is empty.

Definition at line 51 of file spldoublylinkedlist.inc.

       {
              if (count($this->_llist) == 0) {
                     throw new RuntimeException("Can't pop from an empty datastructure");
              }
              return array_pop($this->_llist);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

SplDoublyLinkedList::push ( data) [inherited]

Pushes an element to the end of the DLL.

Parameters:
$datavariable to add to the DLL.

Definition at line 73 of file spldoublylinkedlist.inc.

       {
              array_push($this->_llist, $data);
              return true;
       }

Here is the caller graph for this function:

SplDoublyLinkedList::rewind ( ) [inherited]

Rewind to top iterator as set in constructor.

Implements Iterator.

Definition at line 145 of file spldoublylinkedlist.inc.

       {
              if ($this->_it_mode & self::IT_MODE_LIFO) {
                     $this->_it_pos = count($this->_llist)-1;
              } else {
                     $this->_it_pos = 0;
              }
       }

Here is the call graph for this function:

Changes the iteration mode.

There are two orthogonal sets of modes that can be set:

  • The behavior of the iterator (either one or the other)
    • SplDoublyLnkedList::IT_MODE_DELETE (Elements are deleted by the iterator)
    • SplDoublyLnkedList::IT_MODE_KEEP (Elements are traversed by the iterator)

The default mode is 0 : SplDoublyLnkedList::IT_MODE_LIFO | SplDoublyLnkedList::IT_MODE_KEEP

Note:
The iteration's direction is not modifiable for stack instances
Parameters:
$modeNew mode of iteration
Exceptions:
RuntimeExceptionIf the new mode affects the iteration's direction.

Reimplemented from SplDoublyLinkedList.

Definition at line 38 of file splstack.inc.

       {
              if ($mode & parent::IT_MODE_LIFO !== parent::IT_MODE_LIFO) {
                     throw new RuntimeException("Iterators' LIFO/FIFO modes for SplStack/SplQueue objects are frozen");
              }

              $this->_it_mode = $mode;
       }
SplDoublyLinkedList::shift ( ) [inherited]
Returns:
the element shifted from the beginning of the DLL.
Exceptions:
RuntimeExceptionIf the datastructure is empty.

Definition at line 62 of file spldoublylinkedlist.inc.

       {
              if (count($this->_llist) == 0) {
                     throw new RuntimeException("Can't shift from an empty datastructure");
              }
              return array_shift($this->_llist);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

SplDoublyLinkedList::top ( ) [inherited]
Returns:
the element at the beginning of the DLL.

Definition at line 90 of file spldoublylinkedlist.inc.

       {
              return end($this->_llist);
       }
SplDoublyLinkedList::unshift ( data) [inherited]

Adds an element to the beginning of the DLL.

Parameters:
$datavariable to add to the DLL.

Definition at line 82 of file spldoublylinkedlist.inc.

       {
              array_unshift($this->_llist, $data);
              return true;
       }
SplDoublyLinkedList::valid ( ) [inherited]
Returns:
whether iterator is valid

Implements Iterator.

Definition at line 156 of file spldoublylinkedlist.inc.

       {
              return array_key_exists($this->_it_pos, $this->_llist);
       }

Member Data Documentation

SplStack::$_it_mode = parent::IT_MODE_LIFO [protected]

Reimplemented from SplDoublyLinkedList.

Definition at line 23 of file splstack.inc.

SplDoublyLinkedList::$_it_pos = 0 [protected, inherited]

Definition at line 26 of file spldoublylinkedlist.inc.

SplDoublyLinkedList::$_llist = array() [protected, inherited]

Definition at line 24 of file spldoublylinkedlist.inc.

const SplDoublyLinkedList::IT_MODE_DELETE = 0x00000001 [inherited]

Iterator mode.

See also:
setIteratorMode

Definition at line 46 of file spldoublylinkedlist.inc.

const SplDoublyLinkedList::IT_MODE_FIFO = 0x00000000 [inherited]

Iterator mode.

See also:
setIteratorMode

Definition at line 36 of file spldoublylinkedlist.inc.

const SplDoublyLinkedList::IT_MODE_KEEP = 0x00000000 [inherited]

Iterator mode.

See also:
setIteratorMode

Definition at line 41 of file spldoublylinkedlist.inc.

const SplDoublyLinkedList::IT_MODE_LIFO = 0x00000002 [inherited]

Iterator mode.

See also:
setIteratorMode

Definition at line 31 of file spldoublylinkedlist.inc.

class LogicException

Exception that represents error in the program logic.

Since:
PHP 5.1

This kind of exceptions should directly leed to a fix in your code.

Definition at line 353 of file spl.php.

Inheritance diagram for LogicException:
Collaboration diagram for LogicException:

Public Member Functions

 getMessage ()
 getCode ()
 getFile ()
 getLine ()
 getTrace ()
 getTraceAsString ()
 __toString ()

Protected Attributes

 $message
 The exception message.
 $code
 The code passed to the constructor.
 $file
 The file name where the exception was instantiated.
 $line
 The line number where the exception was instantiated.

Member Function Documentation

Exception::__toString ( ) [inherited]
Returns:
string represenation of exception

Definition at line 341 of file spl.php.

       {
              return $this->string;
       }
Exception::getCode ( ) [final, inherited]
Returns:
the code passed to the constructor

Definition at line 307 of file spl.php.

       {
              return $this->code;
       }
Exception::getFile ( ) [final, inherited]
Returns:
the name of the file where the exception was thrown

Definition at line 314 of file spl.php.

       {
              return $this->file;
       }
Exception::getLine ( ) [final, inherited]
Returns:
the line number where the exception was thrown

Definition at line 321 of file spl.php.

       {
              return $this->line;
       }
Exception::getMessage ( ) [final, inherited]
Returns:
the message passed to the constructor

Definition at line 300 of file spl.php.

       {
              return $this->message;
       }

Here is the caller graph for this function:

Exception::getTrace ( ) [final, inherited]
Returns:
the stack trace as array

Definition at line 328 of file spl.php.

       {
              return $this->trace;
       }
Exception::getTraceAsString ( ) [final, inherited]
Returns:
the stack trace as string

Definition at line 335 of file spl.php.

       {
       }

Member Data Documentation

Exception::$code [protected, inherited]

The code passed to the constructor.

Definition at line 267 of file spl.php.

Exception::$file [protected, inherited]

The file name where the exception was instantiated.

Definition at line 270 of file spl.php.

Exception::$line [protected, inherited]

The line number where the exception was instantiated.

Definition at line 273 of file spl.php.

Exception::$message [protected, inherited]

The exception message.

Definition at line 261 of file spl.php.

class BadFunctionCallException

Exception thrown when a function call was illegal.

Since:
PHP 5.1

Definition at line 361 of file spl.php.

Inheritance diagram for BadFunctionCallException:
Collaboration diagram for BadFunctionCallException:

Public Member Functions

 getMessage ()
 getCode ()
 getFile ()
 getLine ()
 getTrace ()
 getTraceAsString ()
 __toString ()

Protected Attributes

 $message
 The exception message.
 $code
 The code passed to the constructor.
 $file
 The file name where the exception was instantiated.
 $line
 The line number where the exception was instantiated.

Member Function Documentation

Exception::__toString ( ) [inherited]
Returns:
string represenation of exception

Definition at line 341 of file spl.php.

       {
              return $this->string;
       }
Exception::getCode ( ) [final, inherited]
Returns:
the code passed to the constructor

Definition at line 307 of file spl.php.

       {
              return $this->code;
       }
Exception::getFile ( ) [final, inherited]
Returns:
the name of the file where the exception was thrown

Definition at line 314 of file spl.php.

       {
              return $this->file;
       }
Exception::getLine ( ) [final, inherited]
Returns:
the line number where the exception was thrown

Definition at line 321 of file spl.php.

       {
              return $this->line;
       }
Exception::getMessage ( ) [final, inherited]
Returns:
the message passed to the constructor

Definition at line 300 of file spl.php.

       {
              return $this->message;
       }

Here is the caller graph for this function:

Exception::getTrace ( ) [final, inherited]
Returns:
the stack trace as array

Definition at line 328 of file spl.php.

       {
              return $this->trace;
       }
Exception::getTraceAsString ( ) [final, inherited]
Returns:
the stack trace as string

Definition at line 335 of file spl.php.

       {
       }

Member Data Documentation

Exception::$code [protected, inherited]

The code passed to the constructor.

Definition at line 267 of file spl.php.

Exception::$file [protected, inherited]

The file name where the exception was instantiated.

Definition at line 270 of file spl.php.

Exception::$line [protected, inherited]

The line number where the exception was instantiated.

Definition at line 273 of file spl.php.

Exception::$message [protected, inherited]

The exception message.

Definition at line 261 of file spl.php.

class BadMethodCallException

Exception thrown when a method call was illegal.

Since:
PHP 5.1

Definition at line 369 of file spl.php.

Inheritance diagram for BadMethodCallException:
Collaboration diagram for BadMethodCallException:

Public Member Functions

 getMessage ()
 getCode ()
 getFile ()
 getLine ()
 getTrace ()
 getTraceAsString ()
 __toString ()

Protected Attributes

 $message
 The exception message.
 $code
 The code passed to the constructor.
 $file
 The file name where the exception was instantiated.
 $line
 The line number where the exception was instantiated.

Member Function Documentation

Exception::__toString ( ) [inherited]
Returns:
string represenation of exception

Definition at line 341 of file spl.php.

       {
              return $this->string;
       }
Exception::getCode ( ) [final, inherited]
Returns:
the code passed to the constructor

Definition at line 307 of file spl.php.

       {
              return $this->code;
       }
Exception::getFile ( ) [final, inherited]
Returns:
the name of the file where the exception was thrown

Definition at line 314 of file spl.php.

       {
              return $this->file;
       }
Exception::getLine ( ) [final, inherited]
Returns:
the line number where the exception was thrown

Definition at line 321 of file spl.php.

       {
              return $this->line;
       }
Exception::getMessage ( ) [final, inherited]
Returns:
the message passed to the constructor

Definition at line 300 of file spl.php.

       {
              return $this->message;
       }

Here is the caller graph for this function:

Exception::getTrace ( ) [final, inherited]
Returns:
the stack trace as array

Definition at line 328 of file spl.php.

       {
              return $this->trace;
       }
Exception::getTraceAsString ( ) [final, inherited]
Returns:
the stack trace as string

Definition at line 335 of file spl.php.

       {
       }

Member Data Documentation

Exception::$code [protected, inherited]

The code passed to the constructor.

Definition at line 267 of file spl.php.

Exception::$file [protected, inherited]

The file name where the exception was instantiated.

Definition at line 270 of file spl.php.

Exception::$line [protected, inherited]

The line number where the exception was instantiated.

Definition at line 273 of file spl.php.

Exception::$message [protected, inherited]

The exception message.

Definition at line 261 of file spl.php.

class DomainException

Exception that denotes a value not in the valid domain was used.

Since:
PHP 5.1

This kind of exception should be used to inform about domain erors in mathematical sense.

See also:
RangeException

Definition at line 382 of file spl.php.

Inheritance diagram for DomainException:
Collaboration diagram for DomainException:

Public Member Functions

 getMessage ()
 getCode ()
 getFile ()
 getLine ()
 getTrace ()
 getTraceAsString ()
 __toString ()

Protected Attributes

 $message
 The exception message.
 $code
 The code passed to the constructor.
 $file
 The file name where the exception was instantiated.
 $line
 The line number where the exception was instantiated.

Member Function Documentation

Exception::__toString ( ) [inherited]
Returns:
string represenation of exception

Definition at line 341 of file spl.php.

       {
              return $this->string;
       }
Exception::getCode ( ) [final, inherited]
Returns:
the code passed to the constructor

Definition at line 307 of file spl.php.

       {
              return $this->code;
       }
Exception::getFile ( ) [final, inherited]
Returns:
the name of the file where the exception was thrown

Definition at line 314 of file spl.php.

       {
              return $this->file;
       }
Exception::getLine ( ) [final, inherited]
Returns:
the line number where the exception was thrown

Definition at line 321 of file spl.php.

       {
              return $this->line;
       }
Exception::getMessage ( ) [final, inherited]
Returns:
the message passed to the constructor

Definition at line 300 of file spl.php.

       {
              return $this->message;
       }

Here is the caller graph for this function:

Exception::getTrace ( ) [final, inherited]
Returns:
the stack trace as array

Definition at line 328 of file spl.php.

       {
              return $this->trace;
       }
Exception::getTraceAsString ( ) [final, inherited]
Returns:
the stack trace as string

Definition at line 335 of file spl.php.

       {
       }

Member Data Documentation

Exception::$code [protected, inherited]

The code passed to the constructor.

Definition at line 267 of file spl.php.

Exception::$file [protected, inherited]

The file name where the exception was instantiated.

Definition at line 270 of file spl.php.

Exception::$line [protected, inherited]

The line number where the exception was instantiated.

Definition at line 273 of file spl.php.

Exception::$message [protected, inherited]

The exception message.

Definition at line 261 of file spl.php.

class InvalidArgumentException

Exception that denotes invalid arguments were passed.

Since:
PHP 5.1
See also:
UnexpectedValueException

Definition at line 392 of file spl.php.

Inheritance diagram for InvalidArgumentException:
Collaboration diagram for InvalidArgumentException:

Public Member Functions

 getMessage ()
 getCode ()
 getFile ()
 getLine ()
 getTrace ()
 getTraceAsString ()
 __toString ()

Protected Attributes

 $message
 The exception message.
 $code
 The code passed to the constructor.
 $file
 The file name where the exception was instantiated.
 $line
 The line number where the exception was instantiated.

Member Function Documentation

Exception::__toString ( ) [inherited]
Returns:
string represenation of exception

Definition at line 341 of file spl.php.

       {
              return $this->string;
       }
Exception::getCode ( ) [final, inherited]
Returns:
the code passed to the constructor

Definition at line 307 of file spl.php.

       {
              return $this->code;
       }
Exception::getFile ( ) [final, inherited]
Returns:
the name of the file where the exception was thrown

Definition at line 314 of file spl.php.

       {
              return $this->file;
       }
Exception::getLine ( ) [final, inherited]
Returns:
the line number where the exception was thrown

Definition at line 321 of file spl.php.

       {
              return $this->line;
       }
Exception::getMessage ( ) [final, inherited]
Returns:
the message passed to the constructor

Definition at line 300 of file spl.php.

       {
              return $this->message;
       }

Here is the caller graph for this function:

Exception::getTrace ( ) [final, inherited]
Returns:
the stack trace as array

Definition at line 328 of file spl.php.

       {
              return $this->trace;
       }
Exception::getTraceAsString ( ) [final, inherited]
Returns:
the stack trace as string

Definition at line 335 of file spl.php.

       {
       }

Member Data Documentation

Exception::$code [protected, inherited]

The code passed to the constructor.

Definition at line 267 of file spl.php.

Exception::$file [protected, inherited]

The file name where the exception was instantiated.

Definition at line 270 of file spl.php.

Exception::$line [protected, inherited]

The line number where the exception was instantiated.

Definition at line 273 of file spl.php.

Exception::$message [protected, inherited]

The exception message.

Definition at line 261 of file spl.php.

class LengthException

Exception thrown when a parameter exceeds the allowed length.

Since:
PHP 5.1

This can be used for strings length, array size, file size, number of elements read from an Iterator and so on.

Definition at line 403 of file spl.php.

Inheritance diagram for LengthException:
Collaboration diagram for LengthException:

Public Member Functions

 getMessage ()
 getCode ()
 getFile ()
 getLine ()
 getTrace ()
 getTraceAsString ()
 __toString ()

Protected Attributes

 $message
 The exception message.
 $code
 The code passed to the constructor.
 $file
 The file name where the exception was instantiated.
 $line
 The line number where the exception was instantiated.

Member Function Documentation

Exception::__toString ( ) [inherited]
Returns:
string represenation of exception

Definition at line 341 of file spl.php.

       {
              return $this->string;
       }
Exception::getCode ( ) [final, inherited]
Returns:
the code passed to the constructor

Definition at line 307 of file spl.php.

       {
              return $this->code;
       }
Exception::getFile ( ) [final, inherited]
Returns:
the name of the file where the exception was thrown

Definition at line 314 of file spl.php.

       {
              return $this->file;
       }
Exception::getLine ( ) [final, inherited]
Returns:
the line number where the exception was thrown

Definition at line 321 of file spl.php.

       {
              return $this->line;
       }
Exception::getMessage ( ) [final, inherited]
Returns:
the message passed to the constructor

Definition at line 300 of file spl.php.

       {
              return $this->message;
       }

Here is the caller graph for this function:

Exception::getTrace ( ) [final, inherited]
Returns:
the stack trace as array

Definition at line 328 of file spl.php.

       {
              return $this->trace;
       }
Exception::getTraceAsString ( ) [final, inherited]
Returns:
the stack trace as string

Definition at line 335 of file spl.php.

       {
       }

Member Data Documentation

Exception::$code [protected, inherited]

The code passed to the constructor.

Definition at line 267 of file spl.php.

Exception::$file [protected, inherited]

The file name where the exception was instantiated.

Definition at line 270 of file spl.php.

Exception::$line [protected, inherited]

The line number where the exception was instantiated.

Definition at line 273 of file spl.php.

Exception::$message [protected, inherited]

The exception message.

Definition at line 261 of file spl.php.

class OutOfRangeException

Exception thrown when an illegal index was requested.

Since:
PHP 5.1

This represents errors that should be detected at compile time.

See also:
OutOfBoundsException

Definition at line 415 of file spl.php.

Inheritance diagram for OutOfRangeException:
Collaboration diagram for OutOfRangeException:

Public Member Functions

 getMessage ()
 getCode ()
 getFile ()
 getLine ()
 getTrace ()
 getTraceAsString ()
 __toString ()

Protected Attributes

 $message
 The exception message.
 $code
 The code passed to the constructor.
 $file
 The file name where the exception was instantiated.
 $line
 The line number where the exception was instantiated.

Member Function Documentation

Exception::__toString ( ) [inherited]
Returns:
string represenation of exception

Definition at line 341 of file spl.php.

       {
              return $this->string;
       }
Exception::getCode ( ) [final, inherited]
Returns:
the code passed to the constructor

Definition at line 307 of file spl.php.

       {
              return $this->code;
       }
Exception::getFile ( ) [final, inherited]
Returns:
the name of the file where the exception was thrown

Definition at line 314 of file spl.php.

       {
              return $this->file;
       }
Exception::getLine ( ) [final, inherited]
Returns:
the line number where the exception was thrown

Definition at line 321 of file spl.php.

       {
              return $this->line;
       }
Exception::getMessage ( ) [final, inherited]
Returns:
the message passed to the constructor

Definition at line 300 of file spl.php.

       {
              return $this->message;
       }

Here is the caller graph for this function:

Exception::getTrace ( ) [final, inherited]
Returns:
the stack trace as array

Definition at line 328 of file spl.php.

       {
              return $this->trace;
       }
Exception::getTraceAsString ( ) [final, inherited]
Returns:
the stack trace as string

Definition at line 335 of file spl.php.

       {
       }

Member Data Documentation

Exception::$code [protected, inherited]

The code passed to the constructor.

Definition at line 267 of file spl.php.

Exception::$file [protected, inherited]

The file name where the exception was instantiated.

Definition at line 270 of file spl.php.

Exception::$line [protected, inherited]

The line number where the exception was instantiated.

Definition at line 273 of file spl.php.

Exception::$message [protected, inherited]

The exception message.

Definition at line 261 of file spl.php.

class RuntimeException

Exception thrown for errors that are only detectable at runtime.

Since:
PHP 5.1

Definition at line 423 of file spl.php.

Inheritance diagram for RuntimeException:
Collaboration diagram for RuntimeException:

Public Member Functions

 getMessage ()
 getCode ()
 getFile ()
 getLine ()
 getTrace ()
 getTraceAsString ()
 __toString ()

Protected Attributes

 $message
 The exception message.
 $code
 The code passed to the constructor.
 $file
 The file name where the exception was instantiated.
 $line
 The line number where the exception was instantiated.

Member Function Documentation

Exception::__toString ( ) [inherited]
Returns:
string represenation of exception

Definition at line 341 of file spl.php.

       {
              return $this->string;
       }
Exception::getCode ( ) [final, inherited]
Returns:
the code passed to the constructor

Definition at line 307 of file spl.php.

       {
              return $this->code;
       }
Exception::getFile ( ) [final, inherited]
Returns:
the name of the file where the exception was thrown

Definition at line 314 of file spl.php.

       {
              return $this->file;
       }
Exception::getLine ( ) [final, inherited]
Returns:
the line number where the exception was thrown

Definition at line 321 of file spl.php.

       {
              return $this->line;
       }
Exception::getMessage ( ) [final, inherited]
Returns:
the message passed to the constructor

Definition at line 300 of file spl.php.

       {
              return $this->message;
       }

Here is the caller graph for this function:

Exception::getTrace ( ) [final, inherited]
Returns:
the stack trace as array

Definition at line 328 of file spl.php.

       {
              return $this->trace;
       }
Exception::getTraceAsString ( ) [final, inherited]
Returns:
the stack trace as string

Definition at line 335 of file spl.php.

       {
       }

Member Data Documentation

Exception::$code [protected, inherited]

The code passed to the constructor.

Definition at line 267 of file spl.php.

Exception::$file [protected, inherited]

The file name where the exception was instantiated.

Definition at line 270 of file spl.php.

Exception::$line [protected, inherited]

The line number where the exception was instantiated.

Definition at line 273 of file spl.php.

Exception::$message [protected, inherited]

The exception message.

Definition at line 261 of file spl.php.

class OutOfBoundsException

Exception thrown when an illegal index was requested.

Since:
PHP 5.1

This represents errors that cannot be detected at compile time.

See also:
OutOfRangeException

Definition at line 435 of file spl.php.

Inheritance diagram for OutOfBoundsException:
Collaboration diagram for OutOfBoundsException:

Public Member Functions

 getMessage ()
 getCode ()
 getFile ()
 getLine ()
 getTrace ()
 getTraceAsString ()
 __toString ()

Protected Attributes

 $message
 The exception message.
 $code
 The code passed to the constructor.
 $file
 The file name where the exception was instantiated.
 $line
 The line number where the exception was instantiated.

Member Function Documentation

Exception::__toString ( ) [inherited]
Returns:
string represenation of exception

Definition at line 341 of file spl.php.

       {
              return $this->string;
       }
Exception::getCode ( ) [final, inherited]
Returns:
the code passed to the constructor

Definition at line 307 of file spl.php.

       {
              return $this->code;
       }
Exception::getFile ( ) [final, inherited]
Returns:
the name of the file where the exception was thrown

Definition at line 314 of file spl.php.

       {
              return $this->file;
       }
Exception::getLine ( ) [final, inherited]
Returns:
the line number where the exception was thrown

Definition at line 321 of file spl.php.

       {
              return $this->line;
       }
Exception::getMessage ( ) [final, inherited]
Returns:
the message passed to the constructor

Definition at line 300 of file spl.php.

       {
              return $this->message;
       }

Here is the caller graph for this function:

Exception::getTrace ( ) [final, inherited]
Returns:
the stack trace as array

Definition at line 328 of file spl.php.

       {
              return $this->trace;
       }
Exception::getTraceAsString ( ) [final, inherited]
Returns:
the stack trace as string

Definition at line 335 of file spl.php.

       {
       }

Member Data Documentation

Exception::$code [protected, inherited]

The code passed to the constructor.

Definition at line 267 of file spl.php.

Exception::$file [protected, inherited]

The file name where the exception was instantiated.

Definition at line 270 of file spl.php.

Exception::$line [protected, inherited]

The line number where the exception was instantiated.

Definition at line 273 of file spl.php.

Exception::$message [protected, inherited]

The exception message.

Definition at line 261 of file spl.php.

class OverflowException

Exception thrown to indicate arithmetic/buffer overflow.

Since:
PHP 5.1

Definition at line 443 of file spl.php.

Inheritance diagram for OverflowException:
Collaboration diagram for OverflowException:

Public Member Functions

 getMessage ()
 getCode ()
 getFile ()
 getLine ()
 getTrace ()
 getTraceAsString ()
 __toString ()

Protected Attributes

 $message
 The exception message.
 $code
 The code passed to the constructor.
 $file
 The file name where the exception was instantiated.
 $line
 The line number where the exception was instantiated.

Member Function Documentation

Exception::__toString ( ) [inherited]
Returns:
string represenation of exception

Definition at line 341 of file spl.php.

       {
              return $this->string;
       }
Exception::getCode ( ) [final, inherited]
Returns:
the code passed to the constructor

Definition at line 307 of file spl.php.

       {
              return $this->code;
       }
Exception::getFile ( ) [final, inherited]
Returns:
the name of the file where the exception was thrown

Definition at line 314 of file spl.php.

       {
              return $this->file;
       }
Exception::getLine ( ) [final, inherited]
Returns:
the line number where the exception was thrown

Definition at line 321 of file spl.php.

       {
              return $this->line;
       }
Exception::getMessage ( ) [final, inherited]
Returns:
the message passed to the constructor

Definition at line 300 of file spl.php.

       {
              return $this->message;
       }

Here is the caller graph for this function:

Exception::getTrace ( ) [final, inherited]
Returns:
the stack trace as array

Definition at line 328 of file spl.php.

       {
              return $this->trace;
       }
Exception::getTraceAsString ( ) [final, inherited]
Returns:
the stack trace as string

Definition at line 335 of file spl.php.

       {
       }

Member Data Documentation

Exception::$code [protected, inherited]

The code passed to the constructor.

Definition at line 267 of file spl.php.

Exception::$file [protected, inherited]

The file name where the exception was instantiated.

Definition at line 270 of file spl.php.

Exception::$line [protected, inherited]

The line number where the exception was instantiated.

Definition at line 273 of file spl.php.

Exception::$message [protected, inherited]

The exception message.

Definition at line 261 of file spl.php.

class RangeException

Exception thrown to indicate range errors during program execution.

Since:
PHP 5.1

Normally this means there was an arithmetic error other than under/overflow. This is the runtime version of DomainException.

See also:
DomainException

Definition at line 456 of file spl.php.

Inheritance diagram for RangeException:
Collaboration diagram for RangeException:

Public Member Functions

 getMessage ()
 getCode ()
 getFile ()
 getLine ()
 getTrace ()
 getTraceAsString ()
 __toString ()

Protected Attributes

 $message
 The exception message.
 $code
 The code passed to the constructor.
 $file
 The file name where the exception was instantiated.
 $line
 The line number where the exception was instantiated.

Member Function Documentation

Exception::__toString ( ) [inherited]
Returns:
string represenation of exception

Definition at line 341 of file spl.php.

       {
              return $this->string;
       }
Exception::getCode ( ) [final, inherited]
Returns:
the code passed to the constructor

Definition at line 307 of file spl.php.

       {
              return $this->code;
       }
Exception::getFile ( ) [final, inherited]
Returns:
the name of the file where the exception was thrown

Definition at line 314 of file spl.php.

       {
              return $this->file;
       }
Exception::getLine ( ) [final, inherited]
Returns:
the line number where the exception was thrown

Definition at line 321 of file spl.php.

       {
              return $this->line;
       }
Exception::getMessage ( ) [final, inherited]
Returns:
the message passed to the constructor

Definition at line 300 of file spl.php.

       {
              return $this->message;
       }

Here is the caller graph for this function:

Exception::getTrace ( ) [final, inherited]
Returns:
the stack trace as array

Definition at line 328 of file spl.php.

       {
              return $this->trace;
       }
Exception::getTraceAsString ( ) [final, inherited]
Returns:
the stack trace as string

Definition at line 335 of file spl.php.

       {
       }

Member Data Documentation

Exception::$code [protected, inherited]

The code passed to the constructor.

Definition at line 267 of file spl.php.

Exception::$file [protected, inherited]

The file name where the exception was instantiated.

Definition at line 270 of file spl.php.

Exception::$line [protected, inherited]

The line number where the exception was instantiated.

Definition at line 273 of file spl.php.

Exception::$message [protected, inherited]

The exception message.

Definition at line 261 of file spl.php.

class UnderflowException

Exception thrown to indicate arithmetic/buffer underflow.

Since:
PHP 5.1

Definition at line 464 of file spl.php.

Inheritance diagram for UnderflowException:
Collaboration diagram for UnderflowException:

Public Member Functions

 getMessage ()
 getCode ()
 getFile ()
 getLine ()
 getTrace ()
 getTraceAsString ()
 __toString ()

Protected Attributes

 $message
 The exception message.
 $code
 The code passed to the constructor.
 $file
 The file name where the exception was instantiated.
 $line
 The line number where the exception was instantiated.

Member Function Documentation

Exception::__toString ( ) [inherited]
Returns:
string represenation of exception

Definition at line 341 of file spl.php.

       {
              return $this->string;
       }
Exception::getCode ( ) [final, inherited]
Returns:
the code passed to the constructor

Definition at line 307 of file spl.php.

       {
              return $this->code;
       }
Exception::getFile ( ) [final, inherited]
Returns:
the name of the file where the exception was thrown

Definition at line 314 of file spl.php.

       {
              return $this->file;
       }
Exception::getLine ( ) [final, inherited]
Returns:
the line number where the exception was thrown

Definition at line 321 of file spl.php.

       {
              return $this->line;
       }
Exception::getMessage ( ) [final, inherited]
Returns:
the message passed to the constructor

Definition at line 300 of file spl.php.

       {
              return $this->message;
       }

Here is the caller graph for this function:

Exception::getTrace ( ) [final, inherited]
Returns:
the stack trace as array

Definition at line 328 of file spl.php.

       {
              return $this->trace;
       }
Exception::getTraceAsString ( ) [final, inherited]
Returns:
the stack trace as string

Definition at line 335 of file spl.php.

       {
       }

Member Data Documentation

Exception::$code [protected, inherited]

The code passed to the constructor.

Definition at line 267 of file spl.php.

Exception::$file [protected, inherited]

The file name where the exception was instantiated.

Definition at line 270 of file spl.php.

Exception::$line [protected, inherited]

The line number where the exception was instantiated.

Definition at line 273 of file spl.php.

Exception::$message [protected, inherited]

The exception message.

Definition at line 261 of file spl.php.

class UnexpectedValueException

Exception thrown to indicate an unexpected value.

Since:
PHP 5.1

Typically this happens when a function calls another function and espects the return value to be of a certain type or value not including arithmetic or buffer related errors.

See also:
InvalidArgumentException

Definition at line 478 of file spl.php.

Inheritance diagram for UnexpectedValueException:
Collaboration diagram for UnexpectedValueException:

Public Member Functions

 getMessage ()
 getCode ()
 getFile ()
 getLine ()
 getTrace ()
 getTraceAsString ()
 __toString ()

Protected Attributes

 $message
 The exception message.
 $code
 The code passed to the constructor.
 $file
 The file name where the exception was instantiated.
 $line
 The line number where the exception was instantiated.

Member Function Documentation

Exception::__toString ( ) [inherited]
Returns:
string represenation of exception

Definition at line 341 of file spl.php.

       {
              return $this->string;
       }
Exception::getCode ( ) [final, inherited]
Returns:
the code passed to the constructor

Definition at line 307 of file spl.php.

       {
              return $this->code;
       }
Exception::getFile ( ) [final, inherited]
Returns:
the name of the file where the exception was thrown

Definition at line 314 of file spl.php.

       {
              return $this->file;
       }
Exception::getLine ( ) [final, inherited]
Returns:
the line number where the exception was thrown

Definition at line 321 of file spl.php.

       {
              return $this->line;
       }
Exception::getMessage ( ) [final, inherited]
Returns:
the message passed to the constructor

Definition at line 300 of file spl.php.

       {
              return $this->message;
       }

Here is the caller graph for this function:

Exception::getTrace ( ) [final, inherited]
Returns:
the stack trace as array

Definition at line 328 of file spl.php.

       {
              return $this->trace;
       }
Exception::getTraceAsString ( ) [final, inherited]
Returns:
the stack trace as string

Definition at line 335 of file spl.php.

       {
       }

Member Data Documentation

Exception::$code [protected, inherited]

The code passed to the constructor.

Definition at line 267 of file spl.php.

Exception::$file [protected, inherited]

The file name where the exception was instantiated.

Definition at line 270 of file spl.php.

Exception::$line [protected, inherited]

The line number where the exception was instantiated.

Definition at line 273 of file spl.php.

Exception::$message [protected, inherited]

The exception message.

Definition at line 261 of file spl.php.

interface Countable

This Interface allows to hook into the global count() function.

Since:
PHP 5.1

Definition at line 576 of file spl.php.

Inheritance diagram for Countable:

Public Member Functions

 count ()

Member Function Documentation

Returns:
the number the global function count() should show

Implemented in SimpleXMLIterator, ArrayIterator, ArrayObject, SplDoublyLinkedList, and SplObjectStorage.

class ArrayObject

An Array wrapper.

Since:
PHP 5.0
Version:
1.2

This array wrapper allows to recursively iterate over Arrays and public Object properties.

See also:
ArrayIterator

Definition at line 620 of file spl.php.

Inheritance diagram for ArrayObject:
Collaboration diagram for ArrayObject:

Public Member Functions

 __construct ($array, $flags=0, $iterator_class="ArrayIterator")
 Construct a new array iterator from anything that has a hash table.
 setFlags ($flags)
 Set behavior flags.
 getFlags ()
 asort ()
 Sort the entries by values.
 ksort ()
 Sort the entries by key.
 uasort (mixed cmp_function)
 Sort the entries by values using user defined function.
 uksort (mixed cmp_function)
 Sort the entries by key using user defined function.
 natsort ()
 Sort the entries by values using "natural order" algorithm.
 natcasesort ()
 Sort the entries by values using case insensitive "natural order" algorithm.
 exchangeArray ($array)
 getIterator ()
 offsetExists ($index)
 offsetGet ($index)
 offsetSet ($index, $newval)
 offsetUnset ($index)
 append ($value)
 getArrayCopy ()
 count ()
 setIteratorClass ($itertor_class)
 getIteratorClass ()

Public Attributes

const STD_PROP_LIST = 0x00000001
 Properties of the object have their normal functionality when accessed as list (var_dump, foreach, etc.)
const ARRAY_AS_PROPS = 0x00000002
 Array indices can be accessed as properties in read/write.

Constructor & Destructor Documentation

ArrayObject::__construct ( array,
flags = 0,
iterator_class = "ArrayIterator" 
)

Construct a new array iterator from anything that has a hash table.

That is any Array or Object.

Parameters:
$arraythe array to use.
$flagssee setFlags().
$iterator_classclass used in getIterator()

Definition at line 635 of file spl.php.

{}

Member Function Documentation

ArrayObject::append ( value)
Parameters:
$valueis appended as last element
Warning:
this method cannot be called when the ArrayObject refers to an object.

Definition at line 706 of file spl.php.

{}

Sort the entries by values.

Definition at line 652 of file spl.php.

{}
Returns:
the number of elements in the array or the number of public properties in the object.

Implements Countable.

Definition at line 717 of file spl.php.

{}
Parameters:
$arraynew array or object

Definition at line 676 of file spl.php.

{}
Returns:
a copy of the array
Note:
when the ArrayObject refers to an object then this method returns an array of the public properties.

Definition at line 712 of file spl.php.

{}
Returns:
current flags

Definition at line 648 of file spl.php.

{}
Returns:
the iterator which is an ArrayIterator object connected to this object.

Implements IteratorAggregate.

Definition at line 681 of file spl.php.

{}

Definition at line 725 of file spl.php.

{}

Sort the entries by key.

Definition at line 656 of file spl.php.

{}

Sort the entries by values using case insensitive "natural order" algorithm.

Definition at line 672 of file spl.php.

{}

Sort the entries by values using "natural order" algorithm.

Definition at line 668 of file spl.php.

{}
Parameters:
$indexoffset to inspect
Returns:
whetehr offset $index esists

Implements ArrayAccess.

Definition at line 686 of file spl.php.

{}
ArrayObject::offsetGet ( index)
Parameters:
$indexoffset to return value for
Returns:
value at offset $index

Implements ArrayAccess.

Definition at line 691 of file spl.php.

{}
ArrayObject::offsetSet ( index,
newval 
)
Parameters:
$indexindex to set
$newvalnew value to store at offset $index

Implements ArrayAccess.

Definition at line 696 of file spl.php.

{}
Parameters:
$indexoffset to unset

Implements ArrayAccess.

Definition at line 700 of file spl.php.

{}
ArrayObject::setFlags ( flags)

Set behavior flags.

Parameters:
$flagsbitmask as follows: 0 set: properties of the object have their normal functionality when accessed as list (var_dump, foreach, etc.) 1 set: array indices can be accessed as properties in read/write

Definition at line 644 of file spl.php.

{}
ArrayObject::setIteratorClass ( itertor_class)

Definition at line 721 of file spl.php.

{}
ArrayObject::uasort ( mixed  cmp_function)

Sort the entries by values using user defined function.

Definition at line 660 of file spl.php.

{}
ArrayObject::uksort ( mixed  cmp_function)

Sort the entries by key using user defined function.

Definition at line 664 of file spl.php.

{}

Member Data Documentation

const ArrayObject::ARRAY_AS_PROPS = 0x00000002

Array indices can be accessed as properties in read/write.

Definition at line 626 of file spl.php.

const ArrayObject::STD_PROP_LIST = 0x00000001

Properties of the object have their normal functionality when accessed as list (var_dump, foreach, etc.)

Definition at line 624 of file spl.php.

class ArrayIterator

An Array iterator.

Since:
PHP 5.0
Version:
1.2

This iterator allows to unset and modify values and keys while iterating over Arrays and Objects.

When you want to iterate over the same array multiple times you need to instanciate ArrayObject and let it create ArrayIterator instances that refer to it either by using foreach or by calling its getIterator() method manually.

Definition at line 741 of file spl.php.

Inheritance diagram for ArrayIterator:
Collaboration diagram for ArrayIterator:

Public Member Functions

 __construct ($array, $flags=0)
 Construct a new array iterator from anything that has a hash table.
 setFlags ($flags)
 Set behavior flags.
 getFlags ()
 asort ()
 Sort the entries by values.
 ksort ()
 Sort the entries by key.
 uasort (mixed cmp_function)
 Sort the entries by values using user defined function.
 uksort (mixed cmp_function)
 Sort the entries by key using user defined function.
 natsort ()
 Sort the entries by values using "natural order" algorithm.
 natcasesort ()
 Sort the entries by values using case insensitive "natural order" algorithm.
 offsetExists ($index)
 offsetGet ($index)
 offsetSet ($index, $newval)
 offsetUnset ($index)
 append ($value)
 getArrayCopy ()
 seek ($position)
 count ()
 rewind ()
 Rewind the Iterator to the first element.
 valid ()
 Check if there is a current element after calls to rewind() or next().
 current ()
 Return the current element.
 key ()
 Return the key of the current element.
 next ()
 Move forward to next element.

Public Attributes

const STD_PROP_LIST = 0x00000001
 Properties of the object have their normal functionality when accessed as list (var_dump, foreach, etc.)
const ARRAY_AS_PROPS = 0x00000002
 Array indices can be accessed as properties in read/write.

Constructor & Destructor Documentation

ArrayIterator::__construct ( array,
flags = 0 
)

Construct a new array iterator from anything that has a hash table.

That is any Array or Object.

Parameters:
$arraythe array to use.
$flagssee setFlags().

Reimplemented in SubClasses, and IncludeFiles.

Definition at line 755 of file spl.php.

{}

Member Function Documentation

ArrayIterator::append ( value)
Parameters:
$valueis appended as last element
Warning:
this method cannot be called when the ArrayIterator refers to an object.

Definition at line 818 of file spl.php.

{}

Here is the caller graph for this function:

Sort the entries by values.

Definition at line 773 of file spl.php.

{}
Returns:
the number of elements in the array or the number of public properties in the object.

Implements Countable.

Definition at line 834 of file spl.php.

{}

Return the current element.

Implements Iterator.

Reimplemented in SubClasses.

Definition at line 843 of file spl.php.

{}

Here is the caller graph for this function:

Returns:
a copy of the array
Note:
when the ArrayIterator refers to an object then this method returns an array of the public properties.

Definition at line 824 of file spl.php.

{}
Returns:
current flags

Definition at line 769 of file spl.php.

{}

Return the key of the current element.

Implements Iterator.

Definition at line 846 of file spl.php.

{}

Here is the caller graph for this function:

Sort the entries by key.

Definition at line 777 of file spl.php.

{}

Sort the entries by values using case insensitive "natural order" algorithm.

Definition at line 793 of file spl.php.

{}

Here is the caller graph for this function:

Sort the entries by values using "natural order" algorithm.

Definition at line 789 of file spl.php.

{}

Move forward to next element.

Implements Iterator.

Definition at line 849 of file spl.php.

{}
Parameters:
$indexoffset to inspect
Returns:
whetehr offset $index esists

Implements ArrayAccess.

Definition at line 798 of file spl.php.

{}
Parameters:
$indexoffset to return value for
Returns:
value at offset $index

Implements ArrayAccess.

Definition at line 803 of file spl.php.

{}
ArrayIterator::offsetSet ( index,
newval 
)
Parameters:
$indexindex to set
$newvalnew value to store at offset $index

Implements ArrayAccess.

Definition at line 808 of file spl.php.

{}

Here is the caller graph for this function:

Parameters:
$indexoffset to unset

Implements ArrayAccess.

Definition at line 812 of file spl.php.

{}

Rewind the Iterator to the first element.

Implements Iterator.

Definition at line 837 of file spl.php.

{}
ArrayIterator::seek ( position)
Parameters:
$positionoffset to seek to
Exceptions:
OutOfBoundsExceptionif $position is invalid

Implements SeekableIterator.

Definition at line 829 of file spl.php.

{}

Set behavior flags.

Parameters:
$flagsbitmask as follows: 0 set: properties of the object have their normal functionality when accessed as list (var_dump, foreach, etc.) 1 set: array indices can be accessed as properties in read/write

Definition at line 764 of file spl.php.

{}
ArrayIterator::uasort ( mixed  cmp_function)

Sort the entries by values using user defined function.

Definition at line 781 of file spl.php.

{}
ArrayIterator::uksort ( mixed  cmp_function)

Sort the entries by key using user defined function.

Definition at line 785 of file spl.php.

{}

Here is the caller graph for this function:

Check if there is a current element after calls to rewind() or next().

Implements Iterator.

Definition at line 840 of file spl.php.

{}

Member Data Documentation

const ArrayIterator::ARRAY_AS_PROPS = 0x00000002

Array indices can be accessed as properties in read/write.

Definition at line 747 of file spl.php.

const ArrayIterator::STD_PROP_LIST = 0x00000001

Properties of the object have their normal functionality when accessed as list (var_dump, foreach, etc.)

Definition at line 745 of file spl.php.

class SplFileInfo

File info class.

Since:
PHP 5.1.3

Definition at line 856 of file spl.php.

Inheritance diagram for SplFileInfo:

Public Member Functions

 __construct ($file_name)
 Construct a file info object.
 getPath ()
 getFilename ()
 getFileInfo (string class_name=NULL)
 getPathname ()
 getPathInfo (string class_name=NULL)
 getPerms ()
 getInode ()
 getSize ()
 getOwner ()
 getGroup ()
 getATime ()
 getMTime ()
 getCTime ()
 getType ()
 isWritable ()
 isReadable ()
 isExecutable ()
 isFile ()
 isDir ()
 isLink ()
 getLinkTarget ()
 getRealPath ()
 __toString ()
 openFile ($mode= 'r', $use_include_path=false, $context=NULL)
 Open the current file as a SplFileObject instance.
 setFileClass (string class_name="SplFileObject")
 setInfoClass (string class_name="SplFileInfo")

Constructor & Destructor Documentation

SplFileInfo::__construct ( file_name)

Construct a file info object.

Parameters:
$file_namepath or file name

Reimplemented in DirectoryIterator.

Definition at line 862 of file spl.php.

{}

Member Function Documentation

Returns:
getPathname()

Reimplemented in DirectoryIterator, and SplFileObject.

Definition at line 958 of file spl.php.

{}
Returns:
The current entry's last access time.

Definition at line 910 of file spl.php.

{}
Returns:
The current entry's last change time.

Definition at line 918 of file spl.php.

{}
Returns:
SplFileInfo created for the file
Parameters:
class_namename of class to instantiate
See also:
SplFileInfo::setInfoClass()

Definition at line 876 of file spl.php.

{}
Returns:
the filename only.

Definition at line 870 of file spl.php.

{}
Returns:
The current entry's group name.

Definition at line 906 of file spl.php.

{}
Returns:
The current entry's inode.

Definition at line 894 of file spl.php.

{}
Returns:
target of link.

Definition at line 950 of file spl.php.

{}
Returns:
The current entry's last modification time.

Definition at line 914 of file spl.php.

{}
Returns:
The current entry's owner name.

Definition at line 902 of file spl.php.

{}
Returns:
the path part only.

Definition at line 866 of file spl.php.

{}
Returns:
SplFileInfo created for the path
Parameters:
class_namename of class to instantiate
See also:
SplFileInfo::setInfoClass()

Definition at line 886 of file spl.php.

{}
Returns:
The current entries path and file name.

Definition at line 880 of file spl.php.

{}
Returns:
The current entry's permissions.

Definition at line 890 of file spl.php.

{}
Returns:
The resolved path

Definition at line 954 of file spl.php.

{}
Returns:
The current entry's size in bytes .

Definition at line 898 of file spl.php.

{}
Returns:
The current entry's file type.

Definition at line 922 of file spl.php.

{}
Returns:
Whether the current entry is a directory.

Definition at line 942 of file spl.php.

{}
Returns:
Whether the current entry is executable.

Definition at line 934 of file spl.php.

{}
Returns:
Whether the current entry is .

Definition at line 938 of file spl.php.

{}
Returns:
whether the current entry is a link.

Reimplemented in DirectoryIterator.

Definition at line 946 of file spl.php.

{}
Returns:
Whether the current entry is readable.

Definition at line 930 of file spl.php.

{}
Returns:
Whether the current entry is writeable.

Definition at line 926 of file spl.php.

{}
SplFileInfo::openFile ( mode = 'r',
use_include_path = false,
context = NULL 
)

Open the current file as a SplFileObject instance.

Parameters:
modeopen mode
use_include_pathwhether to search include paths (don't use)
contextresource context to pased to open function
Exceptions:
RuntimeExceptionif file cannot be opened (e.g. insufficient access rights).
Returns:
The opened file as a SplFileObject instance
See also:
SplFileObject
SplFileInfo::setFileClass()
file()

Definition at line 973 of file spl.php.

{}
SplFileInfo::setFileClass ( string  class_name = "SplFileObject")
Parameters:
class_namename of class used with openFile(). Must be derived from SPLFileObject.

Definition at line 978 of file spl.php.

{}
SplFileInfo::setInfoClass ( string  class_name = "SplFileInfo")
Parameters:
class_namename of class used with getFileInfo(), getPathInfo(). Must be derived from SplFileInfo.

Definition at line 983 of file spl.php.

{}
class DirectoryIterator

Directory iterator.

Version:
1.1
Since:
PHP 5.0

Definition at line 991 of file spl.php.

Inheritance diagram for DirectoryIterator:
Collaboration diagram for DirectoryIterator:

Public Member Functions

 __construct ($path)
 Construct a directory iterator from a path-string.
 rewind ()
 Rewind the Iterator to the first element.
 valid ()
 Check if there is a current element after calls to rewind() or next().
 key ()
 current ()
 next ()
 Move forward to next element.
 isDot ()
 isLink ()
 __toString ()
 getPath ()
 getFilename ()
 getFileInfo (string class_name=NULL)
 getPathname ()
 getPathInfo (string class_name=NULL)
 getPerms ()
 getInode ()
 getSize ()
 getOwner ()
 getGroup ()
 getATime ()
 getMTime ()
 getCTime ()
 getType ()
 isWritable ()
 isReadable ()
 isExecutable ()
 isFile ()
 isDir ()
 getLinkTarget ()
 getRealPath ()
 openFile ($mode= 'r', $use_include_path=false, $context=NULL)
 Open the current file as a SplFileObject instance.
 setFileClass (string class_name="SplFileObject")
 setInfoClass (string class_name="SplFileInfo")

Constructor & Destructor Documentation

Construct a directory iterator from a path-string.

Parameters:
$pathdirectory to iterate.

Reimplemented from SplFileInfo.

Definition at line 997 of file spl.php.

{}

Member Function Documentation

Returns:
getFilename()

Reimplemented from SplFileInfo.

Definition at line 1026 of file spl.php.

{}
Returns:
$this

Implements Iterator.

Reimplemented in RecursiveDirectoryIterator.

Definition at line 1011 of file spl.php.

{}
SplFileInfo::getATime ( ) [inherited]
Returns:
The current entry's last access time.

Definition at line 910 of file spl.php.

{}
SplFileInfo::getCTime ( ) [inherited]
Returns:
The current entry's last change time.

Definition at line 918 of file spl.php.

{}
SplFileInfo::getFileInfo ( string  class_name = NULL) [inherited]
Returns:
SplFileInfo created for the file
Parameters:
class_namename of class to instantiate
See also:
SplFileInfo::setInfoClass()

Definition at line 876 of file spl.php.

{}
SplFileInfo::getFilename ( ) [inherited]
Returns:
the filename only.

Definition at line 870 of file spl.php.

{}
SplFileInfo::getGroup ( ) [inherited]
Returns:
The current entry's group name.

Definition at line 906 of file spl.php.

{}
SplFileInfo::getInode ( ) [inherited]
Returns:
The current entry's inode.

Definition at line 894 of file spl.php.

{}
SplFileInfo::getLinkTarget ( ) [inherited]
Returns:
target of link.

Definition at line 950 of file spl.php.

{}
SplFileInfo::getMTime ( ) [inherited]
Returns:
The current entry's last modification time.

Definition at line 914 of file spl.php.

{}
SplFileInfo::getOwner ( ) [inherited]
Returns:
The current entry's owner name.

Definition at line 902 of file spl.php.

{}
SplFileInfo::getPath ( ) [inherited]
Returns:
the path part only.

Definition at line 866 of file spl.php.

{}
SplFileInfo::getPathInfo ( string  class_name = NULL) [inherited]
Returns:
SplFileInfo created for the path
Parameters:
class_namename of class to instantiate
See also:
SplFileInfo::setInfoClass()

Definition at line 886 of file spl.php.

{}
SplFileInfo::getPathname ( ) [inherited]
Returns:
The current entries path and file name.

Definition at line 880 of file spl.php.

{}
SplFileInfo::getPerms ( ) [inherited]
Returns:
The current entry's permissions.

Definition at line 890 of file spl.php.

{}
SplFileInfo::getRealPath ( ) [inherited]
Returns:
The resolved path

Definition at line 954 of file spl.php.

{}
SplFileInfo::getSize ( ) [inherited]
Returns:
The current entry's size in bytes .

Definition at line 898 of file spl.php.

{}
SplFileInfo::getType ( ) [inherited]
Returns:
The current entry's file type.

Definition at line 922 of file spl.php.

{}
SplFileInfo::isDir ( ) [inherited]
Returns:
Whether the current entry is a directory.

Definition at line 942 of file spl.php.

{}
Returns:
Whether the current entry is either '.' or '..'.

Definition at line 1018 of file spl.php.

{}
SplFileInfo::isExecutable ( ) [inherited]
Returns:
Whether the current entry is executable.

Definition at line 934 of file spl.php.

{}
SplFileInfo::isFile ( ) [inherited]
Returns:
Whether the current entry is .

Definition at line 938 of file spl.php.

{}
Returns:
whether the current entry is a link.

Reimplemented from SplFileInfo.

Definition at line 1022 of file spl.php.

{}
SplFileInfo::isReadable ( ) [inherited]
Returns:
Whether the current entry is readable.

Definition at line 930 of file spl.php.

{}
SplFileInfo::isWritable ( ) [inherited]
Returns:
Whether the current entry is writeable.

Definition at line 926 of file spl.php.

{}
Returns:
index of entry

Implements Iterator.

Reimplemented in RecursiveDirectoryIterator.

Definition at line 1007 of file spl.php.

{}

Move forward to next element.

Implements Iterator.

Definition at line 1014 of file spl.php.

{}
SplFileInfo::openFile ( mode = 'r',
use_include_path = false,
context = NULL 
) [inherited]

Open the current file as a SplFileObject instance.

Parameters:
modeopen mode
use_include_pathwhether to search include paths (don't use)
contextresource context to pased to open function
Exceptions:
RuntimeExceptionif file cannot be opened (e.g. insufficient access rights).
Returns:
The opened file as a SplFileObject instance
See also:
SplFileObject
SplFileInfo::setFileClass()
file()

Definition at line 973 of file spl.php.

{}

Rewind the Iterator to the first element.

Implements Iterator.

Definition at line 1000 of file spl.php.

{}
SplFileInfo::setFileClass ( string  class_name = "SplFileObject") [inherited]
Parameters:
class_namename of class used with openFile(). Must be derived from SPLFileObject.

Definition at line 978 of file spl.php.

{}
SplFileInfo::setInfoClass ( string  class_name = "SplFileInfo") [inherited]
Parameters:
class_namename of class used with getFileInfo(), getPathInfo(). Must be derived from SplFileInfo.

Definition at line 983 of file spl.php.

{}

Check if there is a current element after calls to rewind() or next().

Implements Iterator.

Definition at line 1003 of file spl.php.

{}
class RecursiveDirectoryIterator

recursive directory iterator

Version:
1.1
Since:
PHP 5.0

Definition at line 1034 of file spl.php.

Inheritance diagram for RecursiveDirectoryIterator:
Collaboration diagram for RecursiveDirectoryIterator:

Public Member Functions

 __construct ($path, $flags=0)
 Construct a directory iterator from a path-string.
 key ()
 current ()
 hasChildren ()
 getChildren ()
 getSubPath ()
 getSubPathname ()
 rewind ()
 Rewind the Iterator to the first element.
 valid ()
 Check if there is a current element after calls to rewind() or next().
 next ()
 Move forward to next element.
 isDot ()
 isLink ()
 __toString ()
 getPath ()
 getFilename ()
 getFileInfo (string class_name=NULL)
 getPathname ()
 getPathInfo (string class_name=NULL)
 getPerms ()
 getInode ()
 getSize ()
 getOwner ()
 getGroup ()
 getATime ()
 getMTime ()
 getCTime ()
 getType ()
 isWritable ()
 isReadable ()
 isExecutable ()
 isFile ()
 isDir ()
 getLinkTarget ()
 getRealPath ()
 openFile ($mode= 'r', $use_include_path=false, $context=NULL)
 Open the current file as a SplFileObject instance.
 setFileClass (string class_name="SplFileObject")
 setInfoClass (string class_name="SplFileInfo")

Public Attributes

const CURRENT_AS_FILEINFO
const CURRENT_AS_SELF
const CURRENT_AS_PATHNAME
const KEY_AS_PATHNAME
const KEY_AS_FILENAME
const NEW_CURRENT_AND_KEY

Constructor & Destructor Documentation

RecursiveDirectoryIterator::__construct ( path,
flags = 0 
)

Construct a directory iterator from a path-string.

Parameters:
$pathdirectory to iterate.
$flagsopen flags
  • CURRENT_AS_FILEINFO
  • CURRENT_AS_SELF
  • CURRENT_AS_PATHNAME
  • KEY_AS_PATHNAME
  • KEY_AS_FILENAME
  • NEW_CURRENT_AND_KEY

Definition at line 1056 of file spl.php.

{}

Member Function Documentation

Returns:
getFilename()

Reimplemented from SplFileInfo.

Definition at line 1026 of file spl.php.

{}
Returns:
getFilename() or getFileInfo() depending on flags

Reimplemented from DirectoryIterator.

Definition at line 1064 of file spl.php.

{}
SplFileInfo::getATime ( ) [inherited]
Returns:
The current entry's last access time.

Definition at line 910 of file spl.php.

{}
Returns:
a RecursiveDirectoryIterator for the current entry.

Implements RecursiveIterator.

Definition at line 1072 of file spl.php.

{}
SplFileInfo::getCTime ( ) [inherited]
Returns:
The current entry's last change time.

Definition at line 918 of file spl.php.

{}
SplFileInfo::getFileInfo ( string  class_name = NULL) [inherited]
Returns:
SplFileInfo created for the file
Parameters:
class_namename of class to instantiate
See also:
SplFileInfo::setInfoClass()

Definition at line 876 of file spl.php.

{}
SplFileInfo::getFilename ( ) [inherited]
Returns:
the filename only.

Definition at line 870 of file spl.php.

{}
SplFileInfo::getGroup ( ) [inherited]
Returns:
The current entry's group name.

Definition at line 906 of file spl.php.

{}
SplFileInfo::getInode ( ) [inherited]
Returns:
The current entry's inode.

Definition at line 894 of file spl.php.

{}
SplFileInfo::getLinkTarget ( ) [inherited]
Returns:
target of link.

Definition at line 950 of file spl.php.

{}
SplFileInfo::getMTime ( ) [inherited]
Returns:
The current entry's last modification time.

Definition at line 914 of file spl.php.

{}
SplFileInfo::getOwner ( ) [inherited]
Returns:
The current entry's owner name.

Definition at line 902 of file spl.php.

{}
SplFileInfo::getPath ( ) [inherited]
Returns:
the path part only.

Definition at line 866 of file spl.php.

{}
SplFileInfo::getPathInfo ( string  class_name = NULL) [inherited]
Returns:
SplFileInfo created for the path
Parameters:
class_namename of class to instantiate
See also:
SplFileInfo::setInfoClass()

Definition at line 886 of file spl.php.

{}
SplFileInfo::getPathname ( ) [inherited]
Returns:
The current entries path and file name.

Definition at line 880 of file spl.php.

{}
SplFileInfo::getPerms ( ) [inherited]
Returns:
The current entry's permissions.

Definition at line 890 of file spl.php.

{}
SplFileInfo::getRealPath ( ) [inherited]
Returns:
The resolved path

Definition at line 954 of file spl.php.

{}
SplFileInfo::getSize ( ) [inherited]
Returns:
The current entry's size in bytes .

Definition at line 898 of file spl.php.

{}
Returns:
sub path only (without main path)

Definition at line 1076 of file spl.php.

{}
Returns:
the current sub path

Definition at line 1080 of file spl.php.

{}
SplFileInfo::getType ( ) [inherited]
Returns:
The current entry's file type.

Definition at line 922 of file spl.php.

{}
Returns:
whether the current is a directory (not '.' or '..').

Implements RecursiveIterator.

Definition at line 1068 of file spl.php.

{}
SplFileInfo::isDir ( ) [inherited]
Returns:
Whether the current entry is a directory.

Definition at line 942 of file spl.php.

{}
DirectoryIterator::isDot ( ) [inherited]
Returns:
Whether the current entry is either '.' or '..'.

Definition at line 1018 of file spl.php.

{}
SplFileInfo::isExecutable ( ) [inherited]
Returns:
Whether the current entry is executable.

Definition at line 934 of file spl.php.

{}
SplFileInfo::isFile ( ) [inherited]
Returns:
Whether the current entry is .

Definition at line 938 of file spl.php.

{}
DirectoryIterator::isLink ( ) [inherited]
Returns:
whether the current entry is a link.

Reimplemented from SplFileInfo.

Definition at line 1022 of file spl.php.

{}
SplFileInfo::isReadable ( ) [inherited]
Returns:
Whether the current entry is readable.

Definition at line 930 of file spl.php.

{}