本文整理汇总了PHP中Illuminate\Contracts\Foundation\Application::storagePath方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::storagePath方法的具体用法?PHP Application::storagePath怎么用?PHP Application::storagePath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Contracts\Foundation\Application
的用法示例。
在下文中一共展示了Application::storagePath方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handle
/**
* 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);
}
示例2: handle
/**
* 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);
}
示例3: bootstrap
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));
}
}
示例4: getChunkPath
/**
* 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;
}
示例5: configureCustomHandler
/**
* 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));
}
示例6: configureCustomHandler
/**
* 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);
}
示例7: configureHandlers
/**
* 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);
}
示例8: configureDailyHandler
/**
* 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));
}
示例9: configureAppenginemvmHandler
/**
* 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');
}
示例10: configureDailyHandler
/**
* @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'));
}
示例11: configureDailyHandler
/**
* 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);
}
示例12: __construct
/**
* 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();
}
示例13: configureSingleHandler
/**
* 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'));
}
示例14: isReadOnlyModeEnabled
public function isReadOnlyModeEnabled()
{
return file_exists($this->app->storagePath() . '/framework/readonly');
}
示例15: configureDailyHandler
/**
* 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));
}