register events to system
@return bool
192737
public function unRegisterEvents()
    {
        if (is_array($this->events()) && count($this->events()))
        {
            $event = new Event($this);
            return $event->remove();
        }
        return true;
    }
648458
protected function listenEvents()
    {
        $registry = Eresus_Plugin_Registry::getInstance();
        for ($i=0; $i < func_num_args(); $i++)
        {
            $event = func_get_arg($i);
            if (!array_key_exists($event, $registry->events))
            {
                $registry->events[$event] = array();
            }
            $registry->events[$event] []= $this->getName();
        }
    }
1021062
public function register() {
        foreach(Boot::$configs as $path_config => $is_deploy) {
            $path_config = str_replace('\\', '/', $path_config);
            $files       = rglob('*.php', 0, $path_config);
            
            foreach($files as $path) {
                $path = str_replace('\\', '/', $path);
                //                dump($path);
                $file = ltrim(str_replace([$path_config], [''], $path), '/');
                
                $key    = str_replace(['.php', '/',], ['', '.'], $file);
                $config = app('config')->get($key, []);
                //                dd($path, require $path);
                //                dump(require $path, $config, array_merge(require $path, $config));
                app('config')->set($key, array_merge(require $path, $config));
                if($is_deploy) {
                    $this->publishes([$path => config_path($file),], 'config');
                }
            }
        }
        foreach(Boot::$migrations as $path) {
            $this->publishes([
                $path => base_path('database/migrations'),
            ], 'migrations');
        }
    }
65135
protected function registerSystem()
    {
        $this->app->singleton(SystemContract::class, function (Container $app) {
            $config = $app['config'];
            $auth = $app['auth.driver'];

            return new System($config, $auth);
        });
    }
632107
public function register()
    {
        spl_autoload_register(function ($class) {
            $prefix = $class;
            while (false !== $pos = strrpos($prefix, '\\')) {
                $prefix = substr($class, 0, $pos + 1);
                $relativeClass = substr($class, $pos + 1);
                $paths = $this->getPaths($prefix);
                if ($paths !== null) {
                    foreach ($paths as $baseDir) {
                        $file = $baseDir.str_replace('\\', DIRECTORY_SEPARATOR, $relativeClass).'.php';
                        if (file_exists($file)) {
                            require $file;

                            return true;
                        }
                    }
                }
                $prefix = rtrim($prefix, '\\');
            }

            return false;
        });
    }
601771
protected function registerLogging()
    {
        Event::listen(\Illuminate\Log\Events\MessageLogged::class, function ($event) {
            if (EventLog::useLogging()) {
                EventLog::add($event->message, $event->level);
            }
        });
    }
1174612
public static function register(){
        ini_set('unserialize_callback_func', 'spl_autoload_call');
        spl_autoload_register(function($class){
            $cfile = strtr($class,'_\\','//') . '.php';
            foreach (static::$paths as $path => $v) {
                $file = rtrim($path,'/').'/'.$cfile;
                if(is_file($file)) return include($file);
            }
            return false;
        },false,true);
    }
1093995
protected function registerEvents()
    {
        $this->app->terminating(function () {
            $this->app->make('events')->fire('antares.done');
            $this->app->make('events')->fire(new AntaresDone());
        });
    }
405188
protected function registerEventScanner()
    {
        $this->app->singleton('annotations.event.scanner', function ($app) {
            $scanner = new EventScanner([]);

            $scanner->addAnnotationNamespace(
              'Collective\Annotations\Events\Annotations\Annotations',
              __DIR__.'/Events/Annotations/Annotations'
            );

            return $scanner;
        });
    }
64503
public function registerPortEvents(): void
    {
        foreach ((array)$this->options['events'] as $event => $method) {
            // ['onConnect'] --> 'Connect', 'onConnect
            if (\is_int($event)) {
                $event = substr($method, 2);
            }

            // e.g $server->on('Request', [$this, 'onRequest']);
            if (method_exists($this, $method)) {
                $this->port->on($event, [$this, $method]);
            }
        }
    }
104556
public function register()
    {
        if (! $this->isRegistered) {
            spl_autoload_register([$this, 'load'], true, true);
            $this->isRegistered = true;
        }

        return $this;
    }
1267602
public function register()
    {
        $this->helper_callbacks = array();
        $arguments= func_get_args();
        if(count($arguments) > 0){
            foreach($arguments as $argument){
                if($argument instanceof Plugin){ //this is a plugin object
                    $callback = $argument->getEventHelperCallback($this->getName());
                    if(is_callable($callback)){
                        $this->helper_callbacks[] = $callback;
                    }                 
                }
                else if(is_callable($argument)){ //this is a closure
                    $this->helper_callbacks[] = $argument;
                }
            }
        }

        return $this; //return the event object reference to allow chainable calls
    }
735574
public function register()
    {
        // Configure any bindings that are version dependent
        $this->provider->register();

        // Let the IoC container be able to make a Symfony event dispatcher
        $this->app->bind(
            'Symfony\Component\EventDispatcher\EventDispatcherInterface',
            'Symfony\Component\EventDispatcher\EventDispatcher'
        );

        // Setup default configurations for the Tmdb Client
        $this->app->singleton('Tmdb\Client', function() {
            $config = $this->provider->config();
            $options = $config['options'];

            // Use an Event Dispatcher that uses the Laravel event dispatcher
            $options['event_dispatcher'] = $this->app->make('Tmdb\Laravel\Adapters\EventDispatcherAdapter');

            // Register the client using the key and options from config
            $token = new ApiToken($config['api_key']);
            return new Client($token, $options);
        });

        // bind the configuration (used by the image helper)
        $this->app->bind('Tmdb\Model\Configuration', function() {
            $configuration = $this->app->make('Tmdb\Repository\ConfigurationRepository');
            return $configuration->load();
        });
    }
786996
protected function registerListeners()
    {
        $this->process->getDispatcher()->addListener(LogEvent::EVENT_NAME, function (LogEvent $event) {
            $this->data = $event->toArray();
            $this->stream();
        });
    }
94596
protected function registerEventListeners()
    {
        foreach ($this->events as $event => $listener) {
            Event::listen($event, $listener);
        }

        return $this;
    }
91402
public function register()
    {
        parent::register();

        $this->registerConfig();
        $this->bindModels();

        if ($this->config()->get('laravel-auth.events.enabled', false))
            $this->registerProvider(Providers\EventServiceProvider::class);
    }
251298
protected function bindEvents()
    {
        if(!$this->isSubServer)
        {
            $this->swooleServer->on('start', function(\swoole_server $server){
                try{
                    Event::trigger('IMI.MAIN_SERVER.START', [
                        'server' => $this,
                    ], $this, StartEventParam::class);
                }
                catch(\Throwable $ex)
                {
                    App::getBean('ErrorLog')->onException($ex);
                }
            });
    
            $this->swooleServer->on('shutdown', function(\swoole_server $server){
                try{
                    Event::trigger('IMI.MAIN_SERVER.SHUTDOWN', [
                        'server' => $this,
                    ], $this, ShutdownEventParam::class);
                }
                catch(\Throwable $ex)
                {
                    App::getBean('ErrorLog')->onException($ex);
                }
            });
    
            $this->swooleServer->on('WorkerStart', function(\swoole_server $server, int $workerID){
                try{
                    Event::trigger('IMI.MAIN_SERVER.WORKER.START', [
                        'server'    => $this,
                        'workerID'  => $workerID,
                    ], $this, WorkerStartEventParam::class);
                }
                catch(\Throwable $ex)
                {
                    App::getBean('ErrorLog')->onException($ex);
                }
            });
    
            $this->swooleServer->on('WorkerStop', function(\swoole_server $server, int $workerID){
                try{
                    Event::trigger('IMI.MAIN_SERVER.WORKER.STOP', [
                        'server'    => $this,
                        'workerID'  => $workerID,
                    ], $this, WorkerStopEventParam::class);
                }
                catch(\Throwable $ex)
                {
                    App::getBean('ErrorLog')->onException($ex);
                }
            });
    
            $this->swooleServer->on('ManagerStart', function(\swoole_server $server){
                try{
                    Event::trigger('IMI.MAIN_SERVER.MANAGER.START', [
                        'server' => $this,
                    ], $this, ManagerStartEventParam::class);
                }
                catch(\Throwable $ex)
                {
                    App::getBean('ErrorLog')->onException($ex);
                }
            });
    
            $this->swooleServer->on('ManagerStop', function(\swoole_server $server){
                try{
                    Event::trigger('IMI.MAIN_SERVER.MANAGER.STOP', [
                        'server' => $this,
                    ], $this, ManagerStopEventParam::class);
                }
                catch(\Throwable $ex)
                {
                    App::getBean('ErrorLog')->onException($ex);
                }
            });
    
            $this->swooleServer->on('task', function(\swoole_server $server, int $taskID, int $workerID, $data){
                try{
                    Event::trigger('IMI.MAIN_SERVER.TASK', [
                        'server'    => $this,
                        'taskID'    => $taskID,
                        'workerID'  => $workerID,
                        'data'      => $data,
                    ], $this, TaskEventParam::class);
                }
                catch(\Throwable $ex)
                {
                    App::getBean('ErrorLog')->onException($ex);
                }
            });
    
            $this->swooleServer->on('finish', function(\swoole_server $server, int $taskID, $data){
                try{
                    Event::trigger('IMI.MAIN_SERVER.FINISH', [
                        'server'    => $this,
                        'taskID'    => $taskID,
                        'data'      => $data,
                    ], $this, FinishEventParam::class);
                }
                catch(\Throwable $ex)
                {
                    App::getBean('ErrorLog')->onException($ex);
                }
            });
    
            $this->swooleServer->on('PipeMessage', function(\swoole_server $server, int $workerID, $message){
                try{
                    Event::trigger('IMI.MAIN_SERVER.PIPE_MESSAGE', [
                        'server'    => $this,
                        'workerID'  => $workerID,
                        'message'   => $message,
                    ], $this, PipeMessageEventParam::class);
                }
                catch(\Throwable $ex)
                {
                    App::getBean('ErrorLog')->onException($ex);
                }
            });

            $this->swooleServer->on('WorkerError', function(\swoole_server $server, int $workerID, int $workerPid, int $exitCode, int $signal){
                try{
                    Event::trigger('IMI.MAIN_SERVER.WORKER_ERROR', [
                        'server'    => $this,
                        'workerID'  => $workerID,
                        'workerPid' => $workerPid,
                        'exitCode'  => $exitCode,
                        'signal'    => $signal,
                    ], $this, WorkerErrorEventParam::class);
                }
                catch(\Throwable $ex)
                {
                    App::getBean('ErrorLog')->onException($ex);
                }
            });
        }
        $this->__bindEvents();
    }