updated packages

This commit is contained in:
2019-05-18 09:06:43 +00:00
parent 901d16349e
commit e9487fa58a
2025 changed files with 30366 additions and 49653 deletions
+68 -26
View File
@@ -29,7 +29,7 @@ class Application extends Container implements ApplicationContract, HttpKernelIn
*
* @var string
*/
const VERSION = '5.7.20';
const VERSION = '5.8.17';
/**
* The base path for the Laravel installation.
@@ -55,28 +55,28 @@ class Application extends Container implements ApplicationContract, HttpKernelIn
/**
* The array of booting callbacks.
*
* @var array
* @var callable[]
*/
protected $bootingCallbacks = [];
/**
* The array of booted callbacks.
*
* @var array
* @var callable[]
*/
protected $bootedCallbacks = [];
/**
* The array of terminating callbacks.
*
* @var array
* @var callable[]
*/
protected $terminatingCallbacks = [];
/**
* All of the registered service providers.
*
* @var array
* @var \Illuminate\Support\ServiceProvider[]
*/
protected $serviceProviders = [];
@@ -94,6 +94,13 @@ class Application extends Container implements ApplicationContract, HttpKernelIn
*/
protected $deferredServices = [];
/**
* The custom application path defined by the developer.
*
* @var string
*/
protected $appPath;
/**
* The custom database path defined by the developer.
*
@@ -142,9 +149,7 @@ class Application extends Container implements ApplicationContract, HttpKernelIn
}
$this->registerBaseBindings();
$this->registerBaseServiceProviders();
$this->registerCoreContainerAliases();
}
@@ -170,6 +175,7 @@ class Application extends Container implements ApplicationContract, HttpKernelIn
$this->instance('app', $this);
$this->instance(Container::class, $this);
$this->singleton(Mix::class);
$this->instance(PackageManifest::class, new PackageManifest(
new Filesystem, $this->basePath(), $this->getCachedPackagesPath()
@@ -191,7 +197,7 @@ class Application extends Container implements ApplicationContract, HttpKernelIn
/**
* Run the given array of bootstrap classes.
*
* @param array $bootstrappers
* @param string[] $bootstrappers
* @return void
*/
public function bootstrapWith(array $bootstrappers)
@@ -290,12 +296,29 @@ class Application extends Container implements ApplicationContract, HttpKernelIn
/**
* Get the path to the application "app" directory.
*
* @param string $path Optionally, a path to append to the app path
* @param string $path
* @return string
*/
public function path($path = '')
{
return $this->basePath.DIRECTORY_SEPARATOR.'app'.($path ? DIRECTORY_SEPARATOR.$path : $path);
$appPath = $this->appPath ?: $this->basePath.DIRECTORY_SEPARATOR.'app';
return $appPath.($path ? DIRECTORY_SEPARATOR.$path : $path);
}
/**
* Set the application directory.
*
* @param string $path
* @return $this
*/
public function useAppPath($path)
{
$this->appPath = $path;
$this->instance('path', $path);
return $this;
}
/**
@@ -472,12 +495,13 @@ class Application extends Container implements ApplicationContract, HttpKernelIn
/**
* Get or check the current application environment.
*
* @param string|array $environments
* @return string|bool
*/
public function environment()
public function environment(...$environments)
{
if (func_num_args() > 0) {
$patterns = is_array(func_get_arg(0)) ? func_get_arg(0) : func_get_args();
if (count($environments) > 0) {
$patterns = is_array($environments[0]) ? $environments[0] : $environments;
return Str::is($patterns, $this['env']);
}
@@ -570,9 +594,7 @@ class Application extends Container implements ApplicationContract, HttpKernelIn
$provider = $this->resolveProvider($provider);
}
if (method_exists($provider, 'register')) {
$provider->register();
}
$provider->register();
// If there are bindings / singletons set as properties on the provider we
// will spin through them and register them with the application, which
@@ -799,7 +821,7 @@ class Application extends Container implements ApplicationContract, HttpKernelIn
/**
* Register a new boot listener.
*
* @param mixed $callback
* @param callable $callback
* @return void
*/
public function booting($callback)
@@ -810,7 +832,7 @@ class Application extends Container implements ApplicationContract, HttpKernelIn
/**
* Register a new "booted" listener.
*
* @param mixed $callback
* @param callable $callback
* @return void
*/
public function booted($callback)
@@ -825,7 +847,7 @@ class Application extends Container implements ApplicationContract, HttpKernelIn
/**
* Call the booting callbacks for the application.
*
* @param array $callbacks
* @param callable[] $callbacks
* @return void
*/
protected function fireAppCallbacks(array $callbacks)
@@ -861,7 +883,7 @@ class Application extends Container implements ApplicationContract, HttpKernelIn
*/
public function getCachedServicesPath()
{
return $this->bootstrapPath().'/cache/services.php';
return $_ENV['APP_SERVICES_CACHE'] ?? $this->bootstrapPath().'/cache/services.php';
}
/**
@@ -871,7 +893,7 @@ class Application extends Container implements ApplicationContract, HttpKernelIn
*/
public function getCachedPackagesPath()
{
return $this->bootstrapPath().'/cache/packages.php';
return $_ENV['APP_PACKAGES_CACHE'] ?? $this->bootstrapPath().'/cache/packages.php';
}
/**
@@ -911,7 +933,27 @@ class Application extends Container implements ApplicationContract, HttpKernelIn
*/
public function getCachedRoutesPath()
{
return $this->bootstrapPath().'/cache/routes.php';
return $_ENV['APP_ROUTES_CACHE'] ?? $this->bootstrapPath().'/cache/routes.php';
}
/**
* Determine if the application events are cached.
*
* @return bool
*/
public function eventsAreCached()
{
return $this['files']->exists($this->getCachedEventsPath());
}
/**
* Get the path to the events cache file.
*
* @return string
*/
public function getCachedEventsPath()
{
return $_ENV['APP_EVENTS_CACHE'] ?? $this->bootstrapPath().'/cache/events.php';
}
/**
@@ -946,10 +988,10 @@ class Application extends Container implements ApplicationContract, HttpKernelIn
/**
* Register a terminating callback with the application.
*
* @param \Closure $callback
* @param callable|string $callback
* @return $this
*/
public function terminating(Closure $callback)
public function terminating($callback)
{
$this->terminatingCallbacks[] = $callback;
@@ -1152,11 +1194,11 @@ class Application extends Container implements ApplicationContract, HttpKernelIn
return $this->namespace;
}
$composer = json_decode(file_get_contents(base_path('composer.json')), true);
$composer = json_decode(file_get_contents($this->basePath('composer.json')), true);
foreach ((array) data_get($composer, 'autoload.psr-4') as $namespace => $path) {
foreach ((array) $path as $pathChoice) {
if (realpath(app_path()) == realpath(base_path().'/'.$pathChoice)) {
if (realpath($this->path()) === realpath($this->basePath($pathChoice))) {
return $this->namespace = $namespace;
}
}