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;
}