acp_styles::read_style_cfg PHP Метод

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

Read style configuration file
protected read_style_cfg ( string $dir ) : array | boolean
$dir string style directory
Результат array | boolean Style data, false on error
    protected function read_style_cfg($dir)
    {
        static $required = array('name', 'phpbb_version', 'copyright');
        $cfg = parse_cfg_file($this->styles_path . $dir . '/style.cfg');
        // Check if it is a valid file
        foreach ($required as $key) {
            if (!isset($cfg[$key])) {
                return false;
            }
        }
        // Check data
        if (!isset($cfg['parent']) || !is_string($cfg['parent']) || $cfg['parent'] == $cfg['name']) {
            $cfg['parent'] = '';
        }
        if (!isset($cfg['template_bitfield'])) {
            $cfg['template_bitfield'] = $this->default_bitfield();
        }
        return $cfg;
    }