/** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * * @throws \Symfony\Component\HttpKernel\Exception\HttpException * @return mixed */ public function handle($request, Closure $next) { if ($this->application->isDownForMaintenance()) { $data = json_decode(file_get_contents($this->application->storagePath() . '/bootstraps/down'), true); throw new MaintenanceModeException($data['time'], $data['retry'], $data['message']); } return $next($request); }
/** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { if (file_exists($this->app->storagePath() . '/framework/readonly')) { if ($request->method() != 'GET') { throw new RequestNotAllowedException(); } } return $next($request); }
public function bootstrap(Application $app) { $this->app = $app; $this->fs = new Filesystem(); $paths = [$app->exportPath(), $app->homePath(), $app->storagePath(), $app->databasePath(), $app->publicPath(), $app->configPath()]; foreach ($paths as $path) { $this->ensureDirectory($path); } $storagePaths = ['app', 'framework', 'framework/cache', 'framework/views', 'framework/sessions', 'logs', $app->getSlug()]; foreach ($storagePaths as $path) { $this->ensureDirectory(path_join($app->storagePath(), $path)); } }
/** * getChunkPath. * * @method getChunkPath * * @return string */ protected function getChunkPath() { $path = $this->app->storagePath() . '/uploadchunks/'; if ($this->filesystem->isDirectory($path) === false) { $this->filesystem->makeDirectory($path, 0755, true, true); } return $path; }
/** * Custom handler for integrating LogEntries * * @param \Illuminate\Contracts\Foundation\Application $app * @param NrgiWriter $log */ public function configureCustomHandler(Application $app, NrgiWriter $log) { if (env('APP_ENV') == 'production') { $handler = $this->logglyHandler(); $log->getMonolog()->pushHandler($handler); } $log->useDailyFiles($app->storagePath() . '/logs/laravel.log', $app->make('config')->get('app.log_max_files', 5)); }
/** * Custom Monolog handler . * * @param \Illuminate\Contracts\Foundation\Application $app * @param AsWriter|\Illuminate\Log\Writer $log */ public function configureCustomHandler(Application $app, AsWriter $log) { if (!env('APP_DEBUG')) { $handler = new LogEntriesHandler(getenv('LOGENTRY_TOKEN')); $log->getMonolog()->pushHandler($handler); } // Also Log to Daily files too. $log->useDailyFiles($app->storagePath() . '/logs/laravel.log', 5); }
/** * Configure the Monolog handlers for the application. * * @param \Illuminate\Contracts\Foundation\Application $app * @param \Illuminate\Log\Writer $log * @return void */ protected function configureHandlers(Application $app, Writer $log) { // Stream handlers $logPath = $app->storagePath() . '/logs/app.log'; $logLevel = Monolog::INFO; $logStreamHandler = new StreamHandler($logPath, $logLevel); // push handlers $logger = $log->getMonolog(); $logger->pushHandler($logStreamHandler); }
/** * Configure the Monolog handlers for the application. * * @param \Illuminate\Contracts\Foundation\Application $app * @param \Illuminate\Log\Writer $log * @return void */ protected function configureDailyHandler(Application $app, Writer $log) { $log->useDailyFiles($app->storagePath() . '/logs/laravel.log', $app->make('config')->get('app.log_max_files', 5)); }
/** * Custom Monolog handler that for AppEngine ManagedVMs. * * @param \Illuminate\Contracts\Foundation\Application $app * @param \Illuminate\Log\Writer $log * * @return void */ protected function configureAppenginemvmHandler(Application $app, Writer $log) { // Log to designated $log->useFiles($app->storagePath() . '/logs/laravel.log'); $log->useFiles('/var/log/app_engine/custom_logs/laravel.log'); }
/** * @param \Illuminate\Contracts\Foundation\Application|\Notadd\Foundation\Application $app * @param \Illuminate\Log\Writer $log * * @return void */ protected function configureDailyHandler(Application $app, Writer $log) { $config = $app->make('config'); $maxFiles = $config->get('app.log_max_files'); $log->useDailyFiles($app->storagePath() . '/logs/laravel.log', is_null($maxFiles) ? 5 : $maxFiles, $config->get('app.log_level', 'debug')); }
/** * Configure the Monolog handlers for the application. * * @param \Illuminate\Contracts\Foundation\Application $app * @param \Illuminate\Log\Writer $log * @return void */ protected function configureDailyHandler(Application $app, Writer $log) { $log->useDailyFiles($app->storagePath() . '/logs/laravel.log', 5); }
/** * Compiler constructor. * @param \Illuminate\Contracts\Foundation\Application $application */ public function __construct(Application $application) { $this->js = new JsCompiler(); $this->less = new LessCompiler(['cache_dir' => $application->storagePath() . DIRECTORY_SEPARATOR . 'less', 'compress' => true, 'strictMath' => true]); $this->sass = new SassCompiler(); }
/** * Configure the Monolog handlers for the application. * * @param \Illuminate\Contracts\Foundation\Application $app * @param \Illuminate\Log\Writer $log * * @return void */ protected function configureSingleHandler(Application $app, Writer $log) { $log->useFiles($app->storagePath() . '/logs/firefly-iii.log', $app->make('config')->get('app.log_level', 'debug')); }
public function isReadOnlyModeEnabled() { return file_exists($this->app->storagePath() . '/framework/readonly'); }
/** * Configure the Monolog handlers for the application. * * @param \Illuminate\Contracts\Foundation\Application $app * @param \Illuminate\Log\Writer $log * @return void */ protected function configureDailyHandler(Application $app, Writer $log) { $fileName = php_sapi_name(); $log->useDailyFiles($app->storagePath() . '/logs/' . $fileName . '.log', $app->make('config')->get('app.log_max_files', 5)); }