Registers Container object as default context option for scheme associated with FileSystem instance.

@param Container $container
973301
protected function registerContextOptions(Container $container)
    {
        $defaultOptions = stream_context_get_options(stream_context_get_default());
        stream_context_set_default(array_merge(
            $defaultOptions,
            array($this->scheme => array('Container' => $container))
        ));
    }
901759
public function containersStart($container = NULL) {
    $this->validateConfig();
    $this->title('Starting containers');
    $command = $this->taskDockerComposeUp();

    if ($container) {
      $this->limitComposeContainer($command, $container);
    }

    $command->file($this->dockerComposeFile)
      ->projectName($this->config->get('name'))
      ->detachedMode()
      ->run();
  }
1066607
public function register(Container $container)
    {
        /**
         * @param  Container $container A container instance.
         * @return LoggerConfig
         */
        $container['logger/config'] = function (Container $container) {
            $appConfig    = isset($container['config']) ? $container['config'] : [];
            $loggerConfig = isset($appConfig['logger']) ? $appConfig['logger'] : null;
            return new LoggerConfig($loggerConfig);
        };

        /**
         * @return FactoryInterface
         */
        $container['logger/processor/factory'] = function () {
            return new Factory([
                'map' => [
                    'memory-usage' => MemoryUsageProcessor::class,
                    'uid'          => UidProcessor::class
                ]
            ]);
        };

        /**
         * @param  Container $container A container instance.
         * @return StreamHandler|null
         */
        $container['logger/handler/stream'] = function (Container $container) {
            $loggerConfig  = $container['logger/config'];
            $handlerConfig = $loggerConfig['handlers.stream'];

            if ($handlerConfig['active'] !== true) {
                return null;
            }

            $level = $handlerConfig['level'] ?: $loggerConfig['level'];
            return new StreamHandler($handlerConfig['stream'], $level);
        };

        /**
         * @param  Container $container A container instance.
         * @return BrowserConsoleHandler|null
         */
        $container['logger/handler/browser-console'] = function (Container $container) {
            $loggerConfig  = $container['logger/config'];
            $handlerConfig = $loggerConfig['handlers.console'];

            if ($handlerConfig['active'] !== true) {
                return null;
            }

            $level = $handlerConfig['level'] ?: $loggerConfig['level'];
            return new BrowserConsoleHandler($level);
        };

        /**
         * @param  Container $container A container instance.
         * @return Container Collection of defined record handlers, in a service container.
         */
        $container['logger/handlers'] = function (Container $container) {
            $loggerConfig   = $container['logger/config'];
            $handlersConfig = $loggerConfig['handlers'];
            $handlerFactory = $container['logger/handler/factory'];

            $handlers = new Container();
            foreach ($handlersConfig as $handler) {
                $handlers[$handler['type']] = function () use ($handler, $handlerFactory) {
                    $type    = $handler['type'];
                    $handler = $handlerFactory->create($type);
                    return $handler;
                };
            }

            return $handlers;
        };

        /**
         * Fulfills the PSR-3 dependency with a Monolog logger.
         *
         * @param  Container $container A container instance.
         * @return LoggerInterface
         */
        $container['logger'] = function (Container $container) {
            $loggerConfig = $container['logger/config'];

            if ($loggerConfig['active'] !== true) {
                return new NullLogger();
            }

            $logger = new Logger($loggerConfig['channel']);

            $memProcessor = new MemoryUsageProcessor();
            $logger->pushProcessor($memProcessor);

            $uidProcessor = new UidProcessor();
            $logger->pushProcessor($uidProcessor);

            $consoleHandler = $container['logger/handler/browser-console'];
            if ($consoleHandler) {
                $logger->pushHandler($consoleHandler);
            }

            $streamHandler = $container['logger/handler/stream'];
            if ($streamHandler) {
                $logger->pushHandler($streamHandler);
            }

            return $logger;
        };
    }
29573
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;
            };
        }
    }
664002
public function register(Container $container)
    {
        $container['aura.html.locatorFactory'] = function () {
            return new HelperLocatorFactory();
        };
        $container['aura.html.locator'] = function (Container $container) {
            return $container['aura.html.locatorFactory']->newInstance();
        };
        $container['aura.html.escaper'] = function (Container $container) {
            return $container['aura.html.locator']->escape();
        };
    }
793634
public function register( Container $container ) {
		$this->container = $container;

		$this->container->define( array( 'router' => 'Intraxia\Jaxion\Http\Router' ), $router = new Router );

		$this->add_routes( $router );
	}
885116
public function register( Container $container ) {
		$this->container = $container;

		$container->define(
			array( 'assets' => 'Intraxia\Jaxion\Contract\Assets\Register' ),
			$register = new Register( $container->fetch( 'url' ), $container->fetch( 'version' ) )
		);

		$this->add_assets( $register );
	}
59911
protected function registerProviders(Container $container): void
    {
        foreach (self::$providers as $className) {
            $container->addServiceProvider($className);
        }
    }
1359083
private function bindDefaultServices(MutableContainer $container)
    {
        $container->bind(Container::class, new ContainerProxy($container));
        $container->bind(Kernel::class, $this);
    }
1278841
public function boot(Container $container)
    {
        // register an extension
        $container['events']->on(
            'f.extension.load',
            function (Extension $extension, array $options, $safe) use ($container) {
                $extension->setup($options);
                $container['command']->registerFunctions($extension->provideFunctions(), $safe);
                $container['command']->registerFilters($extension->provideFilters());
                if ($extension instanceof TemplateAware) {
                    $extension->setStack($container['template.stack']);
                }
                if ($extension instanceof FinderAware) {
                    $extension->setFinder($container['template.finder']);
                }
                if ($extension instanceof EngineAware) {
                    $extension->setEngine($container['engine']);
                }
                $container['events']->fire('f.extension.registered', $extension);
            }
        );

        // register a function
        $container['events']->on(
            'f.function.register',
            function ($function, callable $callback, $safe) use ($container) {
                $container['command']->registerFunctions([$function => $callback], $safe);
            }
        );

        // register a filter
        $container['events']->on(
            'f.filter.register',
            function ($filter, callable $callback) use ($container) {
                $container['command']->registerFilters([$filter => $callback]);
            }
        );

        $container['events']->on('f.bootstrapped', function () use ($container) {
            $container['command']->lock();
        });
    }
1244890
public function register(Container $container)
    {
        /** @var Config $configuration */
        $configuration = $container['config'];

        $logger = Logger::get();
        $logger->setLogLevel($configuration->logLevel);

        return $logger;
    }
360007
protected function setDependencies(Container $container)
    {
        parent::setDependencies($container);

        $this->basePath   = $container['config']['base_path'];
        $this->publicPath = $container['config']['public_path'];
    }
806052
public function register(Container $container)
    {
        $container->prepareSharedObject(
            EventDispatcher::class,
            function (EventDispatcher $dispatcher, Container $container) {
                $dispatcher->foo = 'bar';

                return $dispatcher->setDebug($container->get('config')->get('system.debug'));
            }
        )->bindShared(Dispatcher::class, EventDispatcher::class)
            ->bindShared(DispatcherInterface::class, EventDispatcher::class);
    }
653638
public function register(Container $container)
    {
        $dir = app()->getPath().'/config';
        $config = $container->get('config');
        $config->load($dir.'/config.php');
        $config->merge([
            'database' => load($dir.'/database.php'),
            'cache' => load($dir.'/cache.php'),
        ]);
        if (file_exists(app()->getPath().'/.env.yml')) {
            $config->merge(load(app()->getPath().'/.env.yml'));
        }
    }
544879
public function setupEnvironment(Container $container)
    {
        $env = new Environment(
            $container->get('Minty\\AbstractTemplateLoader'),
            $this->getConfiguration('options')
        );

        /** @var $request \Miny\HTTP\Request */
        $request = $container->get('Miny\\HTTP\\Request');

        $env->addGlobalVariable('is_ajax', $request->isAjax());
        $env->addGlobalVariable('is_internal_request', $request->isSubRequest());

        $env->addExtension(new Core());
        $env->addExtension(new Optimizer());
        $env->addExtension($container->get(__NAMESPACE__ . '\\Extensions\\Miny'));

        if ($env->getOption('debug')) {
            $env->addExtension(new Debug());

            if ($this->getConfiguration('enable_node_tree_visualizer')) {
                $env->addExtension($container->get(__NAMESPACE__ . '\\Extensions\\Visualizer'));
            }
        }

        return $env;
    }
1075691
public function register(Container $container)
    {
        $container->register(new CacheServiceProvider());
        $container->register(new DatabaseServiceProvider());
        $container->register(new FilesystemServiceProvider());
        $container->register(new LoggerServiceProvider());
        $container->register(new ScriptServiceProvider());
        $container->register(new TranslatorServiceProvider());
        $container->register(new ViewServiceProvider());

        $this->registerKernelServices($container);
        $this->registerHandlerServices($container);
        $this->registerRouteServices($container);
        $this->registerMiddlewareServices($container);
        $this->registerRequestControllerServices($container);
        $this->registerModuleServices($container);
        $this->registerViewServices($container);
    }
265835
public function setContainer(ContainerInterface $container = null)
    {
        $this->container = $container;
        $this->resourceManager = $container->get('claroline.manager.resource_manager');
        $this->workspaceManager = $container->get('claroline.manager.workspace_manager');
        $this->om = $container->get('claroline.persistence.object_manager');
        $this->tokenStorage = $container->get('security.token_storage');
        $this->request = $container->get('request_stack');
        $this->httpKernel = $container->get('httpKernel');
        $this->filesDir = $container->getParameter('claroline.param.files_directory');
    }