Bind the core classes to the Container

@param  Container  $app
@return Container
517076
public function bindIlluminateCore(Container $app = null)
    {
        if (! $app) {
            $app = new Container();
        }

        $this->ensureIlluminateBase($app);

        // Core classes
        $app->bindIf('url', $this->illuminateClasses[ 'url' ]);

        // Session and request
        $app->bindIf('session.manager', function ($app) {
            return new SessionManager($app);
        });

        $app->bindIf('session', function ($app) {
            return $app['session.manager']->driver('array');
        }, true);

        $app->bindIf('request', function ($app) {
            $request = Request::createFromGlobals();

            if (method_exists($request, 'setSessionStore')) {
                $request->setSessionStore($app['session']);
            } else {
                $request->setSession($app['session']);
            }

            return $request;
        }, true);

        // Config
        $app->bindIf('path.config', function ($app) {
            return $this->illuminateConfigPath;
        }, true);

        $app->bindIf('config', function ($app) {
            $config = new Repository;
            $this->loadIlluminateConfig($app, $config);

            return $config;
        }, true);

        // Localization
        $app->bindIf('translation.loader', function ($app) {
            return new FileLoader($app['files'], 'src/config');
        });

        $app->bindIf('translator', function ($app) {
            $loader = new FileLoader($app['files'], 'lang');

            return new Translator($loader, 'en');
        });

        return $app;
    }
39003
public function provideBusinessLayerDependencies(Container $container): Container
    {
        $container = parent::provideBusinessLayerDependencies($container);

        $container[static::SERVICE_COMPUTOP_API] = function () use ($container) {
            return $container->getLocator()->computopApi()->service();
        };

        $container[static::FACADE_STORE] = function () use ($container) {
            return new ComputopApiToStoreFacadeBridge($container->getLocator()->store()->facade());
        };

        return $container;
    }
506747
public function configure(Container $app): Pointcut
    {
        $interceptor = new TransactionalInterceptor;
        $interceptor->setDatabaseManager($app['Illuminate\Database\DatabaseManager']);
        $this->setInterceptor($interceptor);

        return $this->withAnnotatedAnyInterceptor();
    }
804644
public function register(PimpleContainer $app)
    {
        $app['capsule.connectionDefault'] = [
            'driver' => 'mysql',
            'host' => 'localhost',
            'port' => 3306,
            'database' => null,
            'username' => null,
            'password' => null,
            'charset' => 'utf8',
            'collation' => 'utf8_unicode_ci',
            'prefix' => '',
            'strict' => false,
            'engine' => null,
        ];

        $app['capsule.connections'] = [];

        $app['capsule.container'] = function (PimpleContainer $app) {
            return new CapsuleContainer();
        };

        $app['capsule.dispatcher'] = function (PimpleContainer $app) {
            return new Dispatcher($app['capsule.container']);
        };

        $app['capsule.options'] = [
            'setAsGlobal' => true,
            'bootEloquent' => true,
            'enableQueryLog' => true,
        ];

        $app['capsule'] = function (PimpleContainer $app) {
            $capsule = new Capsule($app['capsule.container']);

            // Set the event dispatcher used by Eloquent models...
            if (!empty($app['capsule.dispatcher'])) {
                $capsule->setEventDispatcher($app['capsule.dispatcher']);
            }

            // Connections
            foreach ($app['capsule.connections'] as $connectionName => $connectionConfig) {
                $connectionConfig += $app['capsule.connectionDefault'];
                $capsule->addConnection($connectionConfig, $connectionName);

                if ($app['capsule.options']['enableQueryLog']) {
                    $capsule->getConnection($connectionName)->enableQueryLog();
                }
            }

            // Make this Capsule instance available globally via static methods...
            if (!empty($app['capsule.options']['setAsGlobal'])) {
                $capsule->setAsGlobal();
            }

            // Setup the Eloquent ORM... (optional; unless you've used setEventDispatcher())
            if (!empty($app['capsule.options']['bootEloquent'])) {
                $capsule->bootEloquent();
            }

            return $capsule;
        };
    }
1208131
protected function getConfigurationFiles(Container $app)
    {
        $files = [];
        $configPath = realpath($app['path.config']);

        /** @var \Symfony\Component\Finder\SplFileInfo $file */
        foreach (Finder::create()->files()->name('*.php')->in($configPath) as $file) {
            $nesting = $this->getConfigurationNesting($file, $configPath);
            $files[$nesting . basename($file->getRealPath(), '.php')] = $file->getRealPath();
        }

        return $files;
    }
692496
public function boot(Container $app)
    {
        $app->afterResolving(function (Factory $factory, $app) {

            $factory->addExtension('php', 'php', function () {
                return new PhpEngine();
            });

            $factory->addExtension('blade.php', 'blade', function () use ($app) {
                return new CompilerEngine($app->make(BladeCompiler::class));
            });

            $factory->addExtension('md', 'markdown', function () use ($app) {
                return new CompilerEngine($app->make(Markdown::class));
            });

        });

        $app->when(BladeCompiler::class)
            ->needs('$cachePath')
            ->give(vfsStream::setup('root/.blade')->url());
    }
453972
protected function instantiateUploadAdapters(Container $app)
    {
        /** @var Settings $settings */
        $settings = $app->make(Settings::class);

        $settings->getMimeTypesConfiguration()
            ->each(function ($mimetype) use ($app, $settings) {
                $adapter = Arr::get($mimetype, 'adapter', $mimetype);

                // Skip if already bound.
                if ($app->bound("flagrow.upload-adapter.$adapter")) {
                    return;
                }

                $app->bind("flagrow.upload-adapter.$adapter", function () use ($settings, $adapter) {
                    switch ($adapter) {
                        case 'aws-s3':
                            if (class_exists(S3Client::class)) {
                                return $this->awsS3($settings);
                            }
                        case 'ovh-svfs':
                            if (class_exists(OVHClient::class)) {
                                return $this->ovh($settings);
                            }
                        case 'imgur':
                            return $this->imgur($settings);

                        default:
                            return $this->local($settings);
                    }
                });
            });
    }
1877
public function providePersistenceLayerDependencies(Container $container): Container
    {
        $container = parent::providePersistenceLayerDependencies($container);
        $container = $this->addProductListPropelQuery($container);

        return $container;
    }
938017
public function resetApp(Container $app)
    {
        foreach ($this->resetters as $resetter) {
            $resetter->handle($app, $this);
        }
    }
6370
public static function Init(\Puzzlout\Framework\Core\Application $app) {
        $instance = new ArrayFilterFileSearch();
        $instance->FileList = array();
        $instance->ContextApp = $app;
        return $instance;
    }
1042317
protected function getThemeConfigurationFiles(Container $app)
    {
        $files = [];
        $config_path = $app->make('config')->get('theme.config_path', realpath($app->make('wp.theme')->getRoot()) . '/config');
        
        if (file_exists($config_path) && is_dir($config_path)) {
            foreach (Finder::create()->files()->name('*.php')->in($config_path) as $file) {
                $nesting = $this->getThemeConfigurationNesting($file, $config_path);
                
                $files[$nesting . basename($file->getRealPath(), '.php')] = $file->getRealPath();
            }
        }
        
        return $files;
    }
603484
public function handle(Container $app, Sandbox $sandbox)
    {
        foreach ($sandbox->getProviders() as $provider) {
            $this->rebindProviderContainer($app, $provider);
            if (method_exists($provider, 'register')) {
                $provider->register();
            }
            if (method_exists($provider, 'boot')) {
                $app->call([$provider, 'boot']);
            }
        }

        return $app;
    }
1021544
protected function registerFlysystems(Container $app)
    {
        $app['flysystem.filesystems'] = [];
        $app['flysystem.plugins'] = [
            new EmptyDir(),
            new GetWithMetadata(),
            new ListFiles(),
            new ListPaths(),
            new ListWith(),
        ];
        $app['flysystems'] = function (Container $app) {
            $flysystems = new Container();
            foreach ($app['flysystem.filesystems'] as $alias => $parameters) {
                $flysystems[$alias] = $this->buildFilesystem($app, $parameters);
            }
            return $flysystems;
        };

        $app['flysystem.mount_manager'] = function (Container $app) {
            $mountManager = new MountManager();
            foreach ($app['flysystem.filesystems'] as $alias => $parameters) {
                $mountManager->mountFilesystem($alias, $app['flysystems'][$alias]);
            }
            return $mountManager;
        };
    }
308621
public function setInstance(Container $app)
    {
        $app->instance('app', $app);
        $app->instance(Container::class, $app);

        if ($this->framework === 'lumen') {
            $app->instance(LumenApplication::class, $app);
        }

        Container::setInstance($app);
        Context::setApp($app);
        Facade::clearResolvedInstances();
        Facade::setFacadeApplication($app);
    }
673866
public function register(Container $app): void
    {
        $app['markdown'] = function () {
            return Parsedown::instance();
        };

        $partialsCollection = new Collection();
        $app['partials'] = $partialsCollection;

        /** @var Partial[] $partials */
        $partials = []; //$config->getPartials();
        if ($partials) {
            foreach ($partials as $partial) {
                if (! $partial->getName()) {
                    throw new MissingNameForPartialException('The name of the partial to load is missing');
                }

                $partial->setParser($app['markdown']);
                if (!$partial->getContent() && $partial->getLink()) {
                    if (! is_readable($partial->getLink())) {
                        $app['monolog']->error(
                            sprintf('Partial "%s" not readable or found.', $partial->getLink())
                        );
                        continue;
                    }
                }

                $partialsCollection->set($partial->getName(), $partial);
            }
        }
    }
219824
protected function setupEventListening(Container $app)
    {
        $app['events']->listen('content.rendering', function (View $view) use ($app) {
            if ($viewData = array_merge($view->getFactory()->getShared(), $view->getData())) {
                $decorator = $app['autopresenter'];
                foreach ($viewData as $key => $value) {
                    $view[$key] = $decorator->decorate($value);
                }
            }
        });
    }
1354977
public function register(Container $app)
    {
        $app[DataInterface::class] = $app->factory(Data::class);
        $app[ConfigInterface::class] = $app->factory(FileConfig::class);
    }