private function setRegistryDir($conf) { $dir = $_SERVER['DOCUMENT_ROOT']; $dir .= DIRECTORY_SEPARATOR . $conf->config->paths->vendor; $dir .= DIRECTORY_SEPARATOR . $conf->config->paths->registry; $dir = core\HelperFunctions::replaceSlashes($dir); //echo 'freezedir set to: '.$dir.'<br>'; if (!file_exists($dir)) { mkdir($dir); } $this->ensure(file_exists($dir), "{$dir} does not exist and cannot be created."); core\ApplicationRegistry::setRegistryDirectory($dir); }
function resolveCommand($cmd) { $classroot = $this->controllerMap->getClassroot($cmd); $namespaceRoot = core\ApplicationRegistry::getNamespaceRoot(); $filepath = core\HelperFunctions::replaceSlashes("{$namespaceRoot}/command/{$classroot}.php"); $classname = "\\{$namespaceRoot}\\command\\{$classroot}"; if (file_exists($filepath)) { require_once $filepath; if (class_exists($classname)) { $cmd_class = new \ReflectionClass($classname); if ($cmd_class->isSubClassOf(self::$base_cmd)) { return $cmd_class->newInstance(); } } } return null; }