public static function loadListeners()
    {
        $manager = self::instance();
        $plugins = Plugin::loaded();

        foreach ($plugins as $plugin) {
            $events = Plugin::getData($plugin, 'events')->getArrayCopy();
            foreach ($events as $name => $config) {
                if (is_numeric($name)) {
                    $name   = $config;
                    $config = [];
                }

                $class  = App::className($name, 'Event');
                $config = (array) $config;

                if ($class !== false) {
                    $listener = new $class($config);
                    $manager->on($listener, $config);
                }
            }
        }
    }