public function __destruct() { if (!$this->_from_cache && is_array($this->_config) && count($this->_config)) { $tmp = $this->_opts['temp']; smp_File::serialize($tmp . 'config.php', $this->_config); } }
private function harvest($path) { $iterator = new RecursiveDirectoryIterator($path); foreach (new RecursiveIteratorIterator($iterator) as $file) { $ext = substr($file, -3); if ($ext == 'php') { $code = smp_File::read($file); $tokens = token_get_all($code); foreach ($tokens as $k => $token) { if ($token[0] == T_CLASS || $token[0] == T_INTERFACE) { $class_token = $k + 2; $class_token = $tokens[$class_token]; if ($class_token[0] == T_STRING && $class_token[2] == $token[2]) { $this->_class_registry[$class_token[1]] = (string) $file; } } } } } }