public function register(Application $app)
 {
     $this->app = $app;
     $app['file'] = function ($app) {
         return new FileProvider($app);
     };
     $app->extend('migrator', function ($migrator, $app) {
         $migrator->setLoader(new FilesystemLoader($app['locator']));
         return $migrator;
     });
     $app->extend('view', function ($view, $app) {
         $view->setEngine($app['tmpl']);
         $view->set('app', $app);
         $view->set('url', $app['url']);
         return $view;
     });
     $app['extensions'] = function ($app) {
         $loader = new ExtensionLoader();
         $repository = new ExtensionRepository($app['config']['extension.path'], $loader);
         $installer = new PackageInstaller($repository, $loader);
         return new ExtensionManager($app, $repository, $installer, $app['autoloader'], $app['locator']);
     };
     $app['config']['app.storage'] = ltrim($app['config']['app.storage'] ?: 'storage', '/');
     $app['path.storage'] = $app['config']['locator.paths.storage'] = rtrim($app['path'] . '/' . $app['config']['app.storage'], '/');
     $app['extensions.boot'] = [];
 }
 public function register(Application $app)
 {
     if (!$app['config']['profiler.enabled']) {
         return;
     }
     if (!(class_exists('SQLite3') || class_exists('PDO') && in_array('sqlite', \PDO::getAvailableDrivers(), true))) {
         return;
     }
     $app['profiler'] = function ($app) {
         $profiler = new Profiler($app['profiler.storage']);
         if ($app['events'] instanceof TraceableEventDispatcherInterface) {
             $app['events']->setProfiler($profiler);
         }
         return $profiler;
     };
     $app['profiler.storage'] = function ($app) {
         return new SqliteProfilerStorage('sqlite:' . $app['config']['profiler.file'], '', '', 86400);
     };
     $app['profiler.stopwatch'] = function () {
         return new Stopwatch();
     };
     $app->extend('events', function ($dispatcher, $app) {
         return new TraceableEventDispatcher($dispatcher, $app['profiler.stopwatch']);
     });
 }
 public function register(Application $app)
 {
     $this->app = $app;
     $app['file'] = function ($app) {
         return new FileProvider($app);
     };
     $app->extend('view', function ($view, $app) {
         $view->setEngine($app['tmpl']);
         $view->set('app', $app);
         $view->set('url', $app['url']);
         return $view;
     });
     $app['extensions'] = function ($app) {
         $loader = new ExtensionLoader();
         $repository = new ExtensionRepository($app['config']['extension.path'], $loader);
         $installer = new PackageInstaller($repository, $loader);
         return new ExtensionManager($app, $repository, $installer, $app['autoloader'], $app['locator']);
     };
     $app['extensions.boot'] = [];
 }