App_CLI::readConfig PHP Méthode

readConfig() public méthode

Read config file and store it in $this->config. Use getConfig() to access.
public readConfig ( string $file = 'config.php' ) : boolean
$file string Filename
Résultat boolean
    public function readConfig($file = 'config.php')
    {
        $orig_file = $file;
        if (strpos($file, '.php') != strlen($file) - 4) {
            $file .= '.php';
        }
        if (strpos($file, '/') === false) {
            $file = getcwd() . '/' . $this->config_location . '/' . $file;
        }
        if (file_exists($file)) {
            // some tricky thing to make config be read in some cases it could not in simple way
            unset($config);
            $config =& $this->config;
            $this->config_files_loaded[] = $file;
            include $file;
            unset($config);
            return true;
        }
        return false;
    }