Prado\TApplication::resolvePaths PHP Метод

resolvePaths() защищенный Метод

This method is invoked by the application constructor to determine the application configuration file, application root path and the runtime path.
См. также: setBasePath
См. также: setRuntimePath
См. также: setConfigurationFile
protected resolvePaths ( $basePath )
    protected function resolvePaths($basePath)
    {
        // determine configuration path and file
        if (empty($basePath) || ($basePath = realpath($basePath)) === false) {
            throw new TConfigurationException('application_basepath_invalid', $basePath);
        }
        if (is_dir($basePath) && is_file($basePath . DIRECTORY_SEPARATOR . $this->getConfigurationFileName())) {
            $configFile = $basePath . DIRECTORY_SEPARATOR . $this->getConfigurationFileName();
        } else {
            if (is_file($basePath)) {
                $configFile = $basePath;
                $basePath = dirname($configFile);
            } else {
                $configFile = null;
            }
        }
        // determine runtime path
        $runtimePath = $basePath . DIRECTORY_SEPARATOR . self::RUNTIME_PATH;
        if (is_writable($runtimePath)) {
            if ($configFile !== null) {
                $runtimePath .= DIRECTORY_SEPARATOR . basename($configFile) . '-' . Prado::getVersion();
                if (!is_dir($runtimePath)) {
                    if (@mkdir($runtimePath) === false) {
                        throw new TConfigurationException('application_runtimepath_failed', $runtimePath);
                    }
                    @chmod($runtimePath, PRADO_CHMOD);
                    //make it deletable
                }
                $this->setConfigurationFile($configFile);
            }
            $this->setBasePath($basePath);
            $this->setRuntimePath($runtimePath);
        } else {
            throw new TConfigurationException('application_runtimepath_invalid', $runtimePath);
        }
    }