Ejemplo n.º 1
0
 public function __construct($root, $opts = array())
 {
     $this->_root = $root;
     $this->_opts = $opts;
     if (!isset($this->_opts['paths']) || !is_array($this->_opts['paths'])) {
         return;
     }
     $tmp = $this->_opts['temp'];
     if (file_exists($tmp . 'class_reg.php')) {
         $this->_class_registry = smp_File::unserialize($tmp . 'class_reg.php');
         if (is_array($this->_class_registry) && count($this->_class_registry)) {
             $this->_from_cache = true;
         } else {
             $this->_class_registry = false;
         }
     }
     if (!$this->_from_cache) {
         foreach ($this->_opts['paths'] as $path) {
             $path = $this->_root . $path;
             print_r($path);
             if (file_exists($path)) {
                 $this->harvest($path);
             }
         }
     }
     spl_autoload_register(array($this, 'load'));
 }
Ejemplo n.º 2
0
 public function __construct($root, $opts = array())
 {
     $this->_root = $root;
     $this->_opts = $opts;
     if (!isset($this->_opts['paths']) || !is_array($this->_opts['paths'])) {
         return;
     }
     $tmp = $this->_opts['temp'];
     if (file_exists($tmp . 'config.php')) {
         $this->_config = smp_File::unserialize($tmp . 'config.php');
         if (is_array($this->_config) && count($this->_config)) {
             $this->_from_cache = true;
         } else {
             $this->_config = false;
         }
     }
     if (!$this->_from_cache) {
         foreach ($this->_opts['paths'] as $path) {
             if (file_exists($path)) {
                 $this->harvest($path);
             }
         }
     }
 }