示例#1
0
 /**
  * Autoload
  * @param ArrayAccess $aditionalDirectories
  * @return void
  */
 public function load(ArrayAccess $aditionalDirectories = null)
 {
     if (isset(self::$str_autoload)) {
         return;
     }
     $this->scandir(dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR);
     //        $this->scandir(dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'library' . DIRECTORY_SEPARATOR);
     $arrobj_autoload = $this->directoryTree;
     foreach ($arrobj_autoload as $path) {
         self::$str_autoload .= $path . PATH_SEPARATOR;
     }
     if ($aditionalDirectories instanceof ArrayAccess && $aditionalDirectories->count() > 0) {
         foreach ($aditionalDirectories as $directory) {
             self::$str_autoload .= $directory . PATH_SEPARATOR;
         }
     }
     set_include_path(self::$str_autoload . get_include_path());
 }
 /**
  * (PHP 5 &gt;= 5.1.0)<br/>
  * Checks if current position is valid
  * @link http://php.net/manual/en/iterator.valid.php
  * @return boolean The return value will be casted to boolean and then evaluated.
  * Returns true on success or false on failure.
  */
 public function valid()
 {
     return $this->position < $this->object->count();
 }