-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
[9.x] Add missing php extensions in composer #45941
Conversation
Waiting on @timacdonald review. |
Update: I have done a once over of all sub-package splits and the top level composer. This was actually already on my list to dig into.
Here is how I have approached the decisions made for sub-package spits:
For the top-level
|
@@ -15,7 +15,8 @@ | |||
], | |||
"require": { | |||
"php": "^8.0.2", | |||
"ext-json": "*", | |||
"ext-filter": "*", | |||
"ext-mbstring": "*", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
framework/src/Illuminate/Validation/Concerns/ValidatesAttributes.php
Lines 2352 to 2369 in d3a4cd2
protected function getSize($attribute, $value) | |
{ | |
$hasNumeric = $this->hasRule($attribute, $this->numericRules); | |
// This method will determine if the attribute is a number, string, or file and | |
// return the proper size accordingly. If it is a number, then number itself | |
// is the size. If it is a file, we take kilobytes, and for a string the | |
// entire length of the string will be considered the attribute size. | |
if (is_numeric($value) && $hasNumeric) { | |
return $this->trim($value); | |
} elseif (is_array($value)) { | |
return count($value); | |
} elseif ($value instanceof File) { | |
return $value->getSize() / 1024; | |
} | |
return mb_strlen($value ?? ''); | |
} |
framework/src/Illuminate/Validation/DatabasePresenceVerifier.php
Lines 103 to 114 in d3a4cd2
protected function addWhere($query, $key, $extraValue) | |
{ | |
if ($extraValue === 'NULL') { | |
$query->whereNull($key); | |
} elseif ($extraValue === 'NOT_NULL') { | |
$query->whereNotNull($key); | |
} elseif (str_starts_with($extraValue, '!')) { | |
$query->where($key, '!=', mb_substr($extraValue, 1)); | |
} else { | |
$query->where($key, $extraValue); | |
} | |
} |
@@ -15,7 +15,7 @@ | |||
], | |||
"require": { | |||
"php": "^8.0.2", | |||
"ext-json": "*", | |||
"ext-tokenizer": "*", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See usages of token_get_all
, T_CLOSE_TAG
, T_INLINE_HTML
, T_OPEN_TAG
, and T_OPEN_TAG_WITH_ECHO
.
@@ -39,6 +38,9 @@ | |||
} | |||
}, | |||
"suggest": { | |||
"ext-PDO": "Required to use the database queue worker.", | |||
"ext-filter": "Required to use the SQS queue worker.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
framework/src/Illuminate/Queue/SqsQueue.php
Lines 205 to 212 in d3a4cd2
public function getQueue($queue) | |
{ | |
$queue = $queue ?: $this->default; | |
return filter_var($queue, FILTER_VALIDATE_URL) === false | |
? $this->suffixQueue($queue, $this->suffix) | |
: $queue; | |
} |
@@ -39,6 +38,9 @@ | |||
} | |||
}, | |||
"suggest": { | |||
"ext-PDO": "Required to use the database queue worker.", | |||
"ext-filter": "Required to use the SQS queue worker.", | |||
"ext-mbstring": "Required to use the database failed job providers.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
framework/src/Illuminate/Queue/Failed/DatabaseFailedJobProvider.php
Lines 56 to 65 in d3a4cd2
public function log($connection, $queue, $payload, $exception) | |
{ | |
$failed_at = Date::now(); | |
$exception = (string) mb_convert_encoding($exception, 'UTF-8'); | |
return $this->getTable()->insertGetId(compact( | |
'connection', 'queue', 'payload', 'exception', 'failed_at' | |
)); | |
} |
public function log($connection, $queue, $payload, $exception) | |
{ | |
$this->getTable()->insert([ | |
'uuid' => $uuid = json_decode($payload, true)['uuid'], | |
'connection' => $connection, | |
'queue' => $queue, | |
'payload' => $payload, | |
'exception' => (string) mb_convert_encoding($exception, 'UTF-8'), | |
'failed_at' => Date::now(), | |
]); | |
return $uuid; | |
} |
@@ -32,7 +32,9 @@ | |||
} | |||
}, | |||
"suggest": { | |||
"ext-fileinfo": "Required to use the Filesystem class.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
framework/src/Illuminate/Filesystem/Filesystem.php
Lines 450 to 453 in d3a4cd2
public function mimeType($path) | |
{ | |
return finfo_file(finfo_open(FILEINFO_MIME_TYPE), $path); | |
} |
"ext-ftp": "Required to use the Flysystem FTP driver.", | ||
"ext-hash": "Required to use the Filesystem class.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
framework/src/Illuminate/Filesystem/Filesystem.php
Lines 175 to 178 in d3a4cd2
public function hash($path, $algorithm = 'md5') | |
{ | |
return hash_file($algorithm, $path); | |
} |
@@ -36,6 +36,7 @@ | |||
} | |||
}, | |||
"suggest": { | |||
"ext-filter": "Required to use the Postgres database driver.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
framework/src/Illuminate/Database/Query/Grammars/PostgresGrammar.php
Lines 225 to 251 in d3a4cd2
protected function compileJsonContainsKey($column) | |
{ | |
$segments = explode('->', $column); | |
$lastSegment = array_pop($segments); | |
if (filter_var($lastSegment, FILTER_VALIDATE_INT) !== false) { | |
$i = $lastSegment; | |
} elseif (preg_match('/\[(-?[0-9]+)\]$/', $lastSegment, $matches)) { | |
$segments[] = Str::beforeLast($lastSegment, $matches[0]); | |
$i = $matches[1]; | |
} | |
$column = str_replace('->>', '->', $this->wrap(implode('->', $segments))); | |
if (isset($i)) { | |
return vsprintf('case when %s then %s else false end', [ | |
'jsonb_typeof(('.$column.")::jsonb) = 'array'", | |
'jsonb_array_length(('.$column.')::jsonb) >= '.($i < 0 ? abs($i) : $i + 1), | |
]); | |
} | |
$key = "'".str_replace("'", "''", $lastSegment)."'"; | |
return 'coalesce(('.$column.')::jsonb ?? '.$key.', false)'; | |
} |
framework/src/Illuminate/Database/Query/Grammars/PostgresGrammar.php
Lines 666 to 677 in d3a4cd2
protected function wrapJsonPathAttributes($path) | |
{ | |
$quote = func_num_args() === 2 ? func_get_arg(1) : "'"; | |
return collect($path)->map(function ($attribute) { | |
return $this->parseJsonPathArrayKeys($attribute); | |
})->collapse()->map(function ($attribute) use ($quote) { | |
return filter_var($attribute, FILTER_VALIDATE_INT) !== false | |
? $attribute | |
: $quote.$attribute.$quote; | |
})->all(); | |
} |
@@ -35,6 +36,7 @@ | |||
} | |||
}, | |||
"suggest": { | |||
"ext-pcntl": "Required to use signal trapping.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
framework/src/Illuminate/Console/Signals.php
Lines 77 to 82 in d3a4cd2
protected function initializeSignal($signal) | |
{ | |
return is_callable($existingHandler = pcntl_signal_get_handler($signal)) | |
? [$existingHandler] | |
: null; | |
} |
framework/src/Illuminate/Console/Signals.php
Lines 89 to 102 in d3a4cd2
public function unregister() | |
{ | |
$previousHandlers = $this->previousHandlers; | |
foreach ($previousHandlers as $signal => $handler) { | |
if (is_null($handler)) { | |
pcntl_signal($signal, SIG_DFL); | |
unset($previousHandlers[$signal]); | |
} | |
} | |
$this->setHandlers($previousHandlers); | |
} |
framework/src/Illuminate/Console/Signals.php
Lines 77 to 82 in d3a4cd2
protected function initializeSignal($signal) | |
{ | |
return is_callable($existingHandler = pcntl_signal_get_handler($signal)) | |
? [$existingHandler] | |
: null; | |
} |
@@ -34,6 +34,7 @@ | |||
} | |||
}, | |||
"suggest": { | |||
"ext-filter": "Required to use the DynamoDb cache driver.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
framework/src/Illuminate/Cache/DynamoDbStore.php
Lines 484 to 495 in d3a4cd2
protected function unserialize($value) | |
{ | |
if (filter_var($value, FILTER_VALIDATE_INT) !== false) { | |
return (int) $value; | |
} | |
if (is_numeric($value)) { | |
return (float) $value; | |
} | |
return unserialize($value); | |
} |
@@ -35,6 +34,7 @@ | |||
} | |||
}, | |||
"suggest": { | |||
"ext-hash": "Required to use the Ably and Pusher broadcast drivers.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public function resolveAuthenticatedUser($request) | |
{ | |
if (! $user = parent::resolveAuthenticatedUser($request)) { | |
return; | |
} | |
if (method_exists($this->pusher, 'authenticateUser')) { | |
return $this->pusher->authenticateUser($request->socket_id, $user); | |
} | |
$settings = $this->pusher->getSettings(); | |
$encodedUser = json_encode($user); | |
$decodedString = "{$request->socket_id}::user::{$encodedUser}"; | |
$auth = $settings['auth_key'].':'.hash_hmac( | |
'sha256', $decodedString, $settings['secret'] | |
); | |
return [ | |
'auth' => $auth, | |
'user_data' => $encodedUser, | |
]; | |
} |
framework/src/Illuminate/Broadcasting/Broadcasters/AblyBroadcaster.php
Lines 107 to 114 in d3a4cd2
public function generateAblySignature($channelName, $socketId, $userData = null) | |
{ | |
return hash_hmac( | |
'sha256', | |
sprintf('%s:%s%s', $socketId, $channelName, $userData ? ':'.json_encode($userData) : ''), | |
$this->getPrivateToken(), | |
); | |
} |
@@ -16,7 +16,7 @@ | |||
], | |||
"require": { | |||
"php": "^8.0.2", | |||
"ext-json": "*", | |||
"ext-pdo": "*", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Search usages of \PDO
, \PDOStatement
, and \PDOException
.
@@ -39,6 +38,9 @@ | |||
} | |||
}, | |||
"suggest": { | |||
"ext-pdo": "Required to use the database queue worker.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
framework/src/Illuminate/Queue/DatabaseQueue.php
Lines 256 to 280 in d3a4cd2
protected function getLockForPopping() | |
{ | |
$databaseEngine = $this->database->getPdo()->getAttribute(PDO::ATTR_DRIVER_NAME); | |
$databaseVersion = $this->database->getConfig('version') ?? $this->database->getPdo()->getAttribute(PDO::ATTR_SERVER_VERSION); | |
if (Str::of($databaseVersion)->contains('MariaDB')) { | |
$databaseEngine = 'mariadb'; | |
$databaseVersion = Str::before(Str::after($databaseVersion, '5.5.5-'), '-'); | |
} elseif (Str::of($databaseVersion)->contains(['vitess', 'PlanetScale'])) { | |
$databaseEngine = 'vitess'; | |
$databaseVersion = Str::before($databaseVersion, '-'); | |
} | |
if (($databaseEngine === 'mysql' && version_compare($databaseVersion, '8.0.1', '>=')) || | |
($databaseEngine === 'mariadb' && version_compare($databaseVersion, '10.6.0', '>=')) || | |
($databaseEngine === 'pgsql' && version_compare($databaseVersion, '9.5', '>='))) { | |
return 'FOR UPDATE SKIP LOCKED'; | |
} | |
if ($databaseEngine === 'sqlsrv') { | |
return 'with(rowlock,updlock,readpast)'; | |
} | |
return true; | |
} |
// cc @X-Coder264
@@ -83,6 +88,7 @@ | |||
"illuminate/view": "self.version" | |||
}, | |||
"require-dev": { | |||
"ext-gmp": "*", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we still need this in require-dev
.
See this PR: #43959
Seems best to leave it as GMP objects have some quirks that this addresses and I can't replicate with standard classes.
@@ -16,8 +16,13 @@ | |||
], | |||
"require": { | |||
"php": "^8.0.2", | |||
"ext-ctype": "*", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Required in:
illuminate/session
illuminate/support
@@ -16,8 +16,13 @@ | |||
], | |||
"require": { | |||
"php": "^8.0.2", | |||
"ext-ctype": "*", | |||
"ext-filter": "*", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Required in:
illuminate/routing
illuminate/validation
illuminate/support
illuminate/http
illuminate/pagination
Optional in:
illuminate/queue
illuminate/cache
illuminate/database
@@ -16,8 +16,13 @@ | |||
], | |||
"require": { | |||
"php": "^8.0.2", | |||
"ext-ctype": "*", | |||
"ext-filter": "*", | |||
"ext-hash": "*", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Required in:
illuminate/auth
illuminate/routing
illuminate/cookie
illuminate/encryption
Optional in:
illuminate/filesystem
illuminate/broadcasting
"ext-mbstring": "*", | ||
"ext-openssl": "*", | ||
"ext-session": "*", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Required in:
illuminate/session
"ext-mbstring": "*", | ||
"ext-openssl": "*", | ||
"ext-session": "*", | ||
"ext-tokenizer": "*", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Required in:
illuminate/view
@@ -34,6 +34,8 @@ | |||
} | |||
}, | |||
"suggest": { | |||
"ext-apcu": "Required to use the APC cache driver.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the ApcWrapper
class.
Followup: #45848
add missing necessary (for testing) and suggested PHP extensions.