public static function initByArray(
        array $config, array $options = [
            'registry' => Recursive::ALL_INCLUSIVE,
        ]
    )
    {
        if (!is_array($config)) {
            throw new InvalidArgumentException(
                sprintf(
                    "Passed argument isn't array (%s)",
                    gettype($config)
                ),
                self::EX_INVALID_ARG
            );
        }
        $registry = static::getRegistry($config, $options['registry']);
        // static::modifyRegistryOnStart($registry);
        $registry->set(
            'core/env', isset($_SERVER['DOCUMENT_URI']) ? "web" : "CLI"
        );
        $evtManager = new Event\Manager;
        $evtManager->setDebug($registry->get(
            'core/event/debug', false
        ));
        Log\Factory::run($registry, $evtManager);
        $registry->set('core/event/manager', $evtManager);

        return $registry;
    }