Esempio n. 1
0
        {
            $inst =& AriKernel::instance();
            $inst->_frameworkPathList[] = $path;
        }
        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;
                }
            }
        }
    }
    AriKernel::init();
    AriKernel::import('Core.Object');
} else {
    AriKernel::addFrameworkPath(dirname(__FILE__) . '/');
    AriKernel::import('Core.Object');
}