Skip to content
Permalink
Browse files

formatting

  • Loading branch information...
taylorotwell committed Sep 6, 2019
1 parent 7227083 commit ac9dbf6beaded2ad86f5595958c75e3c4b1147ae
Showing with 12 additions and 16 deletions.
  1. +12 −16 src/Illuminate/Foundation/Application.php
@@ -894,7 +894,7 @@ public function shouldSkipMiddleware()
*/
public function getCachedServicesPath()
{
return $this->normalizeCachePath('cache/services.php', 'APP_SERVICES_CACHE');
return $this->normalizeCachePath('APP_SERVICES_CACHE', 'cache/services.php');
}
/**
@@ -904,7 +904,7 @@ public function getCachedServicesPath()
*/
public function getCachedPackagesPath()
{
return $this->normalizeCachePath('cache/packages.php', 'APP_PACKAGES_CACHE');
return $this->normalizeCachePath('APP_PACKAGES_CACHE', 'cache/packages.php');
}
/**
@@ -924,7 +924,7 @@ public function configurationIsCached()
*/
public function getCachedConfigPath()
{
return $this->normalizeCachePath('cache/config.php', 'APP_CONFIG_CACHE');
return $this->normalizeCachePath('APP_CONFIG_CACHE', 'cache/config.php');
}
/**
@@ -944,7 +944,7 @@ public function routesAreCached()
*/
public function getCachedRoutesPath()
{
return $this->normalizeCachePath('cache/routes.php', 'APP_ROUTES_CACHE');
return $this->normalizeCachePath('APP_ROUTES_CACHE', 'cache/routes.php');
}
/**
@@ -964,29 +964,25 @@ public function eventsAreCached()
*/
public function getCachedEventsPath()
{
return $this->normalizeCachePath('cache/events.php', 'APP_EVENTS_CACHE');
return $this->normalizeCachePath('APP_EVENTS_CACHE', 'cache/events.php');
}
/**
* Normalize a relative or absolute path to a cache file.
*
* @param string $path
* @param string $key
* @param string $default
* @return string
*/
protected function normalizeCachePath($path, $key)
protected function normalizeCachePath($key, $default)
{
$env = Env::get($key);
if ($env === null) {
return $this->bootstrapPath($path);
}
if (Str::startsWith($env, '/')) {
return $env;
if (is_null($env = Env::get($key))) {
return $this->bootstrapPath($default);
}
return $this->basePath($env);
return Str::startsWith($env, '/')
? $env
: $this->basePath($env);
}
/**

0 comments on commit ac9dbf6

Please sign in to comment.
You can’t perform that action at this time.