public function register(ContainerInterface $container)
    {
        if (! isset($container['session'])) {
            $container['session'] = function (ContainerInterface $container) {
                return new Session;
            };
        }

        if (! isset($container['router'])) {
            /**
             * This service MUST return a SHARED instance
             * of Mbh\Interfaces\RouterInterface.
             *
             * @param Container $container
             * @return RouterInterface
             */
            $container['router'] = function (ContainerInterface $container) {
                $routerCacheFile = false;
                if (isset($container->get('settings')['routerCacheFile'])) {
                    $routerCacheFile = $container->get('settings')['routerCacheFile'];
                }

                $router = (new Router)->setCacheFile($routerCacheFile);
                if (method_exists($router, 'setContainer')) {
                    $router->setContainer($container);
                }

                if (method_exists($router, 'setCallableResolver')) {
                    $router->setCallableResolver($container['callableResolver']);
                }

                return $router;
            };
        }
    }
public function register(ContainerInterface $container)
    {
        if (! isset($container['session'])) {
            $container['session'] = function (ContainerInterface $container) {
                return new Session;
            };
        }

        if (! isset($container['router'])) {
            /**
             * This service MUST return a SHARED instance
             * of Mbh\Interfaces\RouterInterface.
             *
             * @param Container $container
             * @return RouterInterface
             */
            $container['router'] = function (ContainerInterface $container) {
                $routerCacheFile = false;
                if (isset($container->get('settings')['routerCacheFile'])) {
                    $routerCacheFile = $container->get('settings')['routerCacheFile'];
                }

                $router = (new Router)->setCacheFile($routerCacheFile);
                if (method_exists($router, 'setContainer')) {
                    $router->setContainer($container);
                }

                if (method_exists($router, 'setCallableResolver')) {
                    $router->setCallableResolver($container['callableResolver']);
                }

                return $router;
            };
        }
    }
public function register ( ContainerInterface $ container ) { if ( ! isset ( $ container [ 'session' ] ) ) { $ container [ 'session' ] = function ( ContainerInterface $ container ) { return new Session ; } ; } if ( ! isset ( $ container [ 'router' ] ) ) { /**
             * This service MUST return a SHARED instance
             * of Mbh\Interfaces\RouterInterface.
             *
             * @param Container $container
             * @return RouterInterface
             */ $ container [ 'router' ] = function ( ContainerInterface $ container ) { $ routerCacheFile = false ; if ( isset ( $ container -> get ( 'settings' ) [ 'routerCacheFile' ] ) ) { $ routerCacheFile = $ container -> get ( 'settings' ) [ 'routerCacheFile' ] ; } $ router = ( new Router ) -> setCacheFile ( $ routerCacheFile ) ; if ( method_exists ( $ router , 'setContainer' ) ) { $ router -> setContainer ( $ container ) ; } if ( method_exists ( $ router , 'setCallableResolver' ) ) { $ router -> setCallableResolver ( $ container [ 'callableResolver' ] ) ; } return $ router ; } ; } }
Register Mbh's default services.

@param Container $container A DI container implementing ArrayAccess and container-interop.
Register Mbh s default services .