public function loadConfiguration($path = self::CONFIG_DEFAULT_FILE)
    {
        if (!is_file($path)) {
            return false;
        }

        $this->configuration = include $path;

        if (!is_array($this->configuration)) {
            throw new ConfigurationException('Configuration file ' . $path . ' must return an array');
        }

        $filesystem = new Filesystem();

        if ($filesystem->isAbsolutePath($this->configuration['web-dir'])) {
            $this->setDocumentRoot($this->configuration['web-dir']);
        } else {
            $this->setDocumentRoot($this->getRoot() . '/' . $this->configuration['web-dir']);
        }

        if (!is_dir($_SERVER['DOCUMENT_ROOT'])) {
            return false;
        }

        return true;
    }
public function loadConfiguration($path = self::CONFIG_DEFAULT_FILE)
    {
        if (!is_file($path)) {
            return false;
        }

        $this->configuration = include $path;

        if (!is_array($this->configuration)) {
            throw new ConfigurationException('Configuration file ' . $path . ' must return an array');
        }

        $filesystem = new Filesystem();

        if ($filesystem->isAbsolutePath($this->configuration['web-dir'])) {
            $this->setDocumentRoot($this->configuration['web-dir']);
        } else {
            $this->setDocumentRoot($this->getRoot() . '/' . $this->configuration['web-dir']);
        }

        if (!is_dir($_SERVER['DOCUMENT_ROOT'])) {
            return false;
        }

        return true;
    }
public function loadConfiguration ( $ path = self :: CONFIG_DEFAULT_FILE ) { if ( ! is_file ( $ path ) ) { return false ; } $ this -> configuration = include $ path ; if ( ! is_array ( $ this -> configuration ) ) { throw new ConfigurationException ( 'Configuration file ' . $ path . ' must return an array' ) ; } $ filesystem = new Filesystem ( ) ; if ( $ filesystem -> isAbsolutePath ( $ this -> configuration [ 'web-dir' ] ) ) { $ this -> setDocumentRoot ( $ this -> configuration [ 'web-dir' ] ) ; } else { $ this -> setDocumentRoot ( $ this -> getRoot ( ) . '/' . $ this -> configuration [ 'web-dir' ] ) ; } if ( ! is_dir ( $ _SERVER [ 'DOCUMENT_ROOT' ] ) ) { return false ; } return true ; }
Loading application configuration.

@param string $path Path to configuration file.

@return bool

@throws ConfigurationException
Loading application configuration .