Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update the Foundation to v11.31.0 #103

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions config/cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
| well as their drivers. You may even define multiple stores for the
| same cache driver to group types of items stored in your caches.
|
| Supported drivers: "apc", "array", "database", "file", "memcached",
| Supported drivers: "array", "database", "file", "memcached",
| "redis", "dynamodb", "octane", "null"
|
*/
Expand All @@ -40,9 +40,10 @@

'database' => [
'driver' => 'database',
'table' => env('DB_CACHE_TABLE', 'cache'),
'connection' => env('DB_CACHE_CONNECTION'),
'table' => env('DB_CACHE_TABLE', 'cache'),
'lock_connection' => env('DB_CACHE_LOCK_CONNECTION'),
'lock_table' => env('DB_CACHE_LOCK_TABLE'),
],

'file' => [
Expand Down
20 changes: 20 additions & 0 deletions config/concurrency.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

return [

/*
|--------------------------------------------------------------------------
| Default Concurrency Driver
|--------------------------------------------------------------------------
|
| This option determines the default concurrency driver that will be used
| by Laravel's concurrency functions. By default, concurrent work will
| be sent to isolated PHP processes which will return their results.
|
| Supported: "process", "fork", "sync"
|
*/

'default' => env('CONCURRENCY_DRIVER', 'process'),

];
3 changes: 3 additions & 0 deletions config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => '',
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
'busy_timeout' => null,
'journal_mode' => null,
'synchronous' => null,
],

'mysql' => [
Expand Down
2 changes: 1 addition & 1 deletion config/filesystems.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
| may even configure multiple disks for the same driver. Examples for
| most supported storage drivers are configured here for reference.
|
| Supported Drivers: "local", "ftp", "sftp", "s3"
| Supported drivers: "local", "ftp", "sftp", "s3"
|
*/

Expand Down
2 changes: 1 addition & 1 deletion config/logging.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
| utilizes the Monolog PHP logging library, which includes a variety
| of powerful log handlers and formatters that you're free to use.
|
| Available Drivers: "single", "daily", "slack", "syslog",
| Available drivers: "single", "daily", "slack", "syslog",
| "errorlog", "monolog", "custom", "stack"
|
*/
Expand Down
19 changes: 16 additions & 3 deletions config/mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
| your mailers below. You may also add additional mailers if needed.
|
| Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2",
| "postmark", "log", "array", "failover", "roundrobin"
| "postmark", "resend", "log", "array",
| "failover", "roundrobin"
|
*/

Expand All @@ -45,7 +46,7 @@
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'timeout' => null,
'local_domain' => env('MAIL_EHLO_DOMAIN'),
'local_domain' => env('MAIL_EHLO_DOMAIN', parse_url(env('APP_URL', 'http://localhost'), PHP_URL_HOST)),
],

'ses' => [
Expand All @@ -54,12 +55,16 @@

'postmark' => [
'transport' => 'postmark',
// 'message_stream_id' => null,
// 'message_stream_id' => env('POSTMARK_MESSAGE_STREAM_ID'),
// 'client' => [
// 'timeout' => 5,
// ],
],

'resend' => [
'transport' => 'resend',
],

'sendmail' => [
'transport' => 'sendmail',
'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'),
Expand All @@ -82,6 +87,14 @@
],
],

'roundrobin' => [
'transport' => 'roundrobin',
'mailers' => [
'ses',
'postmark',
],
],

],

/*
Expand Down
4 changes: 4 additions & 0 deletions config/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
],

'resend' => [
'key' => env('RESEND_KEY'),
],

'slack' => [
'notifications' => [
'bot_user_oauth_token' => env('SLACK_BOT_USER_OAUTH_TOKEN'),
Expand Down
2 changes: 1 addition & 1 deletion config/session.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
|
| This option determines how your cookies behave when cross-site requests
| take place, and can be used to mitigate CSRF attacks. By default, we
| will set this value to "lax" since this is a secure default value.
| will set this value to "lax" to permit secure cross-site requests.
|
| See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#samesitesamesite-value
|
Expand Down
81 changes: 69 additions & 12 deletions src/Illuminate/Foundation/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Application extends Container implements ApplicationContract, CachesConfig
*
* @var string
*/
const VERSION = '11.5.0';
const VERSION = '11.31.0';

/**
* The base path for the Laravel installation.
Expand Down Expand Up @@ -98,7 +98,7 @@ class Application extends Container implements ApplicationContract, CachesConfig
/**
* All of the registered service providers.
*
* @var \Illuminate\Support\ServiceProvider[]
* @var array<string, \Illuminate\Support\ServiceProvider>
*/
protected $serviceProviders = [];

Expand Down Expand Up @@ -193,6 +193,13 @@ class Application extends Container implements ApplicationContract, CachesConfig
*/
protected $namespace;

/**
* Indicates if the framework's base configuration should be merged.
*
* @var bool
*/
protected $mergeFrameworkConfiguration = true;

/**
* The prefixes of absolute cache paths for use during normalization.
*
Expand Down Expand Up @@ -590,6 +597,10 @@ public function storagePath($path = '')
return $this->joinPaths($this->storagePath ?: $_ENV['LARAVEL_STORAGE_PATH'], $path);
}

if (isset($_SERVER['LARAVEL_STORAGE_PATH'])) {
return $this->joinPaths($this->storagePath ?: $_SERVER['LARAVEL_STORAGE_PATH'], $path);
}

return $this->joinPaths($this->storagePath ?: $this->basePath('storage'), $path);
}

Expand Down Expand Up @@ -747,7 +758,9 @@ public function isProduction()
*/
public function detectEnvironment(Closure $callback)
{
$args = $_SERVER['argv'] ?? null;
$args = $this->runningInConsole() && isset($_SERVER['argv'])
? $_SERVER['argv']
: null;

return $this['env'] = (new EnvironmentDetector)->detect($callback, $args);
}
Expand Down Expand Up @@ -892,7 +905,9 @@ public function register($provider, $force = false)
*/
public function getProvider($provider)
{
return array_values($this->getProviders($provider))[0] ?? null;
$name = is_string($provider) ? $provider : get_class($provider);

return $this->serviceProviders[$name] ?? null;
}

/**
Expand Down Expand Up @@ -927,9 +942,11 @@ public function resolveProvider($provider)
*/
protected function markAsRegistered($provider)
{
$this->serviceProviders[] = $provider;
$class = get_class($provider);

$this->serviceProviders[$class] = $provider;

$this->loadedProviders[get_class($provider)] = true;
$this->loadedProviders[$class] = true;
}

/**
Expand Down Expand Up @@ -1002,6 +1019,8 @@ public function registerDeferredProvider($provider, $service = null)
* @param string $abstract
* @param array $parameters
* @return mixed
*
* @throws \Illuminate\Contracts\Container\BindingResolutionException
*/
public function make($abstract, array $parameters = [])
{
Expand All @@ -1017,6 +1036,9 @@ public function make($abstract, array $parameters = [])
* @param array $parameters
* @param bool $raiseEvents
* @return mixed
*
* @throws \Illuminate\Contracts\Container\BindingResolutionException
* @throws \Illuminate\Contracts\Container\CircularDependencyException
*/
protected function resolve($abstract, $parameters = [], $raiseEvents = true)
{
Expand Down Expand Up @@ -1189,6 +1211,28 @@ public function handleCommand(InputInterface $input)
return $status;
}

/**
* Determine if the framework's base configuration should be merged.
*
* @return bool
*/
public function shouldMergeFrameworkConfiguration()
{
return $this->mergeFrameworkConfiguration;
}

/**
* Indicate that the framework's base configuration should not be merged.
*
* @return $this
*/
public function dontMergeFrameworkConfiguration()
{
$this->mergeFrameworkConfiguration = false;

return $this;
}

/**
* Determine if middleware has been disabled for the application.
*
Expand Down Expand Up @@ -1383,7 +1427,7 @@ public function terminate()
/**
* Get the service providers that have been loaded.
*
* @return array
* @return array<string, bool>
*/
public function getLoadedProviders()
{
Expand Down Expand Up @@ -1422,6 +1466,17 @@ public function setDeferredServices(array $services)
$this->deferredServices = $services;
}

/**
* Determine if the given service is a deferred service.
*
* @param string $service
* @return bool
*/
public function isDeferredService($service)
{
return isset($this->deferredServices[$service]);
}

/**
* Add an array of services to the application's deferred services.
*
Expand All @@ -1434,14 +1489,16 @@ public function addDeferredServices(array $services)
}

/**
* Determine if the given service is a deferred service.
* Remove an array of services from the application's deferred services.
*
* @param string $service
* @return bool
* @param array $services
* @return void
*/
public function isDeferredService($service)
public function removeDeferredServices(array $services)
{
return isset($this->deferredServices[$service]);
foreach ($services as $service) {
unset($this->deferredServices[$service]);
}
}

/**
Expand Down
8 changes: 4 additions & 4 deletions src/Illuminate/Foundation/Auth/Access/Authorizable.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ trait Authorizable
/**
* Determine if the entity has the given abilities.
*
* @param iterable|string $abilities
* @param iterable|\BackedEnum|string $abilities
* @param array|mixed $arguments
* @return bool
*/
Expand All @@ -21,7 +21,7 @@ public function can($abilities, $arguments = [])
/**
* Determine if the entity has any of the given abilities.
*
* @param iterable|string $abilities
* @param iterable|\BackedEnum|string $abilities
* @param array|mixed $arguments
* @return bool
*/
Expand All @@ -33,7 +33,7 @@ public function canAny($abilities, $arguments = [])
/**
* Determine if the entity does not have the given abilities.
*
* @param iterable|string $abilities
* @param iterable|\BackedEnum|string $abilities
* @param array|mixed $arguments
* @return bool
*/
Expand All @@ -45,7 +45,7 @@ public function cant($abilities, $arguments = [])
/**
* Determine if the entity does not have the given abilities.
*
* @param iterable|string $abilities
* @param iterable|\BackedEnum|string $abilities
* @param array|mixed $arguments
* @return bool
*/
Expand Down
4 changes: 4 additions & 0 deletions src/Illuminate/Foundation/Auth/Access/AuthorizesRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
use Illuminate\Contracts\Auth\Access\Gate;
use Illuminate\Support\Str;

use function Illuminate\Support\enum_value;

trait AuthorizesRequests
{
/**
Expand Down Expand Up @@ -49,6 +51,8 @@ public function authorizeForUser($user, $ability, $arguments = [])
*/
protected function parseAbilityAndArguments($ability, $arguments)
{
$ability = enum_value($ability);

if (is_string($ability) && ! str_contains($ability, '\\')) {
return [$ability, $arguments];
}
Expand Down
Loading