public static function init(array $config = [], $devMode = false)
    {
        if (static::$instance instanceof static) {
            return;
        }

        $system = static::$instance = new static();

        $system->devMode = (bool) $devMode;

        $services = $system->getServices();
        $services->set('System', $system);

        $items = [];
        if (isset($config['components'])) {
            $items = (array) $config['components'];
        }
        $components = $system->getComponents();
        foreach ($items as $index => $item) {
            $config['components'][$index] = $components->register($item);
        }

        $systemConfig = new SystemConfig($config);
        $services->set('Config', $systemConfig);

        $listeners = new Listeners();
        $services->set('Listeners', $listeners);

        $events = new Events();
        $services->set('Events', $events);

        $components->init($services, $listeners, $events, $systemConfig);
        $events->trigger($system->getEvent());

        return $system;
    }