Beispiel #1
0
 function import($namespace)
 {
     $inst =& AriKernel::instance();
     if (isset($inst->_loadedNamespace[$namespace])) {
         return;
     }
     $part = explode('.', $namespace);
     $lastPos = count($part) - 1;
     $part[$lastPos] = 'class.' . $part[$lastPos] . '.php';
     $pathList = $inst->_frameworkPathList;
     $fileLocalPath = join('/', $part);
     foreach ($pathList as $path) {
         $filePath = $path . $fileLocalPath;
         if (file_exists($filePath)) {
             require_once $filePath;
             $inst->_loadedNamespace[$namespace] = true;
             break;
         }
     }
 }