Generalize the local config based on the parser class object.

@param object $parser
@return void
507251
protected function startup($parser)
    {
        $reflect = new ReflectionClass($parser);

        $this->configBase = 'parsers.' . $reflect->getShortName();

        if (empty(config("{$this->configBase}.parser.name"))) {
            $this->failed("Required parser.name is missing in parser configuration");
        }

        Log::info(
            get_class($this) . ': ' .
            'Received message from: ' . $this->parsedMail->getHeader('from') . " with subject: '" .
            $this->parsedMail->getHeader('subject') . "' arrived at parser: " .
            config("{$this->configBase}.parser.name")
        );

    }
272195
public void fill(final LmlParser parser) {
        this.parser = parser;
        for (final Entry<String, I18NBundle> bundle : bundles) {
            parser.getData().addI18nBundle(bundle.key, bundle.value);
            if (defaultBundle.equals(bundle.key)) {
                parser.getData().setDefaultI18nBundle(bundle.value);
            }
        }
    }
182760
public function registerParsers(array $parsers)
	{
		foreach ($parsers as $extension => $parser)
		{
			$this->registerParser($extension, $parser);
		}
	}
629651
public function setDispatcherClass($dispatcher)
    {
        if (!is_string($dispatcher)) {
            $this->error->setMessage('Dispatcher class name is not string');

            return;
        }

        $this->dispatcher = $dispatcher;
    }
415613
public function configure()
    {
        if (!isset($this->options['disable_existing_loggers'])) {
            // We disable any existing loggers by default
            $this->options['disable_existing_loggers'] = true;
        }

        if ($this->options['disable_existing_loggers']) {
            Monolog\Registry::clear();
        }

        if (isset($this->options['formatters'])) {
            $this->configureFormatters($this->options['formatters']);
        }

        if (isset($this->options['processors'])) {
            $this->configureProcessors($this->options['processors']);
        }

        if (isset($this->options['handlers'])) {
            $this->configureHandlers($this->options['handlers']);
        }

        if (isset($this->options['loggers'])) {
            $this->configureLoggers($this->options['loggers']);
        } else {
            throw new \RuntimeException(
                'Cannot configure loggers. No logger configuration options provided.'
            );
        }
    }
714816
public function setLocale($locale)
    {
        $this['config']->set('app.locale', $locale);

        $this['translator']->setLocale($locale);

        $this['events']->dispatch(new Events\LocaleUpdated($locale));
    }
1365849
protected function applyConfig()
    {
        parent::applyConfig();
        foreach ($this->config as $k => $v) {
            if (is_object($v) && $v instanceof \PHPDaemon\Config\Entry\Generic) {
                $v = $v->getValue();
            }
            $k = strtolower($k);
            if ($k === 'allowedclients') {
                $this->allowedClients = $v;
            }
        }
    }
471696
private function setDefaultConfiguration(): void
    {
        $this->parameterBag->set('app.devmode', false);
        $this->parameterBag->set('container.dumper.inline_class_loader', true);

        $this->config->addPass($this->parameterBag);
    }
529892
public function fileParser()
    {

        $globalFile = '../App/Config/global.php';
        $localFile = '../App/Config/local.php';

        $data = $global = include($globalFile);

        if (file_exists($localFile)) {

            $local = include($localFile);

            // Overlay data config
            $data = array_replace($global, $local);
        }

        // Config validators
        if (!isset($data['session_prefix'])) $data['session_prefix'] = '';
        if (!isset($data['language_code'])) $data['language_code'] = 'en';

        $this->configData = $data;
    }
354006
public function Parse($parser = 'TextParser') {
        if($parser == 'TextParser' || is_subclass_of($parser, 'TextParser')) {
            $obj = Object::create($parser, $this->owner->value);
            return $obj->parse();
        } else {
            return $this->owner->Nice();
        }
    }
1276524
protected function configure(): void
    {
        parent::configure();
        foreach ($this->aArguments as $aArgument) {
            $this->addArgument(
                getFromArray('name', $aArgument),
                getFromArray('mode', $aArgument, InputArgument::OPTIONAL),
                getFromArray('description', $aArgument),
                getFromArray('default', $aArgument)
            );
        }
    }
467245
public function setupParser() {
		$this->parser = xml_parser_create('UTF-8');
		xml_parser_set_option($this->parser, XML_OPTION_SKIP_WHITE, 1);
		xml_parser_set_option($this->parser, XML_OPTION_TARGET_ENCODING, 'UTF-8');
		xml_set_object($this->parser, $this);
		xml_set_element_handler($this->parser, 'startXML', 'endXML');
		xml_set_character_data_handler($this->parser, 'charXML');
	}
556361
protected function configure()
    {
        if (!is_null($this->signature)) {
            $parser = new SignatureParser($this);

            $parser->parse($this->signature);

            $this->setDescription($this->description);
        }
    }
1107463
private function configureParser()
    {
        $renderer = $parser = null;
        $model = new \RunBB\Model\Admin\Parser();

        $configurator = new \s9e\TextFormatter\Configurator();
        $plugins = unserialize(User::get()->g_parser_plugins);

        $useSmilies = false;
        foreach ($plugins as $k => $plugin) {
            $configurator->plugins->load($plugin);
            if ($plugin === 'Emoticons') {
                $useSmilies = true;
            }
        }

        if ($useSmilies) {
            foreach ($model->getSmilies() as $k => $v) {
                $configurator->Emoticons->add($k, $v['html']);
            }
        }

        $configurator->registeredVars['cacheDir'] = ForumEnv::get('FORUM_CACHE_DIR');

        // Get an instance of the parser and the renderer
        extract($configurator->finalize());

        // We save the parser and the renderer to the disk for easy reuse
        Utils::checkDir($this->cacheDir);

        file_put_contents($this->cacheDir.'/'.User::get()->g_title.'Parser.php', serialize($parser));
        file_put_contents($this->cacheDir.'/'.User::get()->g_title.'Renderer.php', serialize($renderer));

        $this->parser = $parser;
        $this->renderer = $renderer;
    }
612283
public function pushParser(Useragent\ParserInterface $parser)
    {
        $this->parser = $parser;
        if ($this->ua) {
            $this->setUA($this->ua);
        }
    }
331577
public static function ParserFirstCallInit(&$parser){
    $parser->setFunctionHook('movetoskin', 'Skinny::moveToSkinPF');
    $parser->setFunctionHook('setskin', 'Skinny::setSkinPF');
    $parser->setFunctionHook('layout', 'Skinny::setLayoutPF');
    $parser->setFunctionHook('skinsert', 'Skinny::insertTemplatePF');
    $parser->setFunctionHook('imageurl', 'Skinny::getImageURLPF');

    return true;
  }
740158
protected static function setProperties($parser, $instance): void
    {
        $instance->malId = $parser->getMalId();
        $instance->url = $parser->getUrl();
        $instance->name = $parser->getName();
        $instance->imageUrl = $parser->getImage();
        $instance->role = $parser->getRole();
    }