Example #1
0
 /**
  * @param Application $app
  */
 protected function registerLogger(Application $app)
 {
     $logger = new Logger($app->environment());
     $logPath = $app->storagePath() . '/logs/flarum.log';
     $handler = new StreamHandler($logPath, Logger::DEBUG);
     $handler->setFormatter(new LineFormatter(null, null, true, true));
     $logger->pushHandler($handler);
     $app->instance('log', $logger);
     $app->alias('log', 'Psr\\Log\\LoggerInterface');
 }
Example #2
0
 /**
  * @param Application $app
  */
 protected function registerCache(Application $app)
 {
     $app->singleton('cache.store', function ($app) {
         return new \Illuminate\Cache\Repository($app->make('cache.filestore'));
     });
     $app->singleton('cache.filestore', function ($app) {
         return new \Illuminate\Cache\FileStore(new \Illuminate\Filesystem\Filesystem(), $app->storagePath() . '/cache');
     });
     $app->alias('cache.filestore', 'Illuminate\\Contracts\\Cache\\Store');
     $app->alias('cache.store', 'Illuminate\\Contracts\\Cache\\Repository');
 }