Skip to content
Snippets Groups Projects
Commit 618f0bcf authored by catch's avatar catch
Browse files

Issue #2936105 by SerShevchyk, voleger, RoSk0, Charlie ChX Negyesi: Deprecate...

Issue #2936105 by SerShevchyk, voleger, RoSk0, Charlie ChX Negyesi: Deprecate DRUPAL_PHP_FUNCTION_PATTERN and replace its usages
parent 4bfd652e
No related branches found
No related tags found
6 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!1012Issue #3226887: Hreflang on non-canonical content pages,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10,!596Issue #3046532: deleting an entity reference field, used in a contextual view, makes the whole site unrecoverable,!496Issue #2463967: Use .user.ini file for PHP settings,!144Issue #2666286: Clean up menu_ui to conform to Drupal coding standards
...@@ -112,6 +112,10 @@ ...@@ -112,6 +112,10 @@
/** /**
* Regular expression to match PHP function names. * Regular expression to match PHP function names.
* *
* @deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use
* \Drupal\Core\Extension\ExtensionDiscovery::PHP_FUNCTION_PATTERN instead.
*
* @see https://www.drupal.org/node/2936107
* @see http://php.net/manual/language.functions.php * @see http://php.net/manual/language.functions.php
*/ */
const DRUPAL_PHP_FUNCTION_PATTERN = '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*'; const DRUPAL_PHP_FUNCTION_PATTERN = '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*';
......
...@@ -164,7 +164,7 @@ function drupal_get_database_types() { ...@@ -164,7 +164,7 @@ function drupal_get_database_types() {
$drivers = []; $drivers = [];
// The internal database driver name is any valid PHP identifier. // The internal database driver name is any valid PHP identifier.
$mask = '/^' . DRUPAL_PHP_FUNCTION_PATTERN . '$/'; $mask = ExtensionDiscovery::PHP_FUNCTION_PATTERN;
/** @var \Drupal\Core\File\FileSystemInterface $file_system */ /** @var \Drupal\Core\File\FileSystemInterface $file_system */
$file_system = \Drupal::service('file_system'); $file_system = \Drupal::service('file_system');
$files = $file_system->scanDirectory(DRUPAL_ROOT . '/core/lib/Drupal/Core/Database/Driver', $mask, ['recurse' => FALSE]); $files = $file_system->scanDirectory(DRUPAL_ROOT . '/core/lib/Drupal/Core/Database/Driver', $mask, ['recurse' => FALSE]);
......
...@@ -696,7 +696,7 @@ function update_verify_update_archive($project, $archive_file, $directory) { ...@@ -696,7 +696,7 @@ function update_verify_update_archive($project, $archive_file, $directory) {
$incompatible = []; $incompatible = [];
/** @var \Drupal\Core\File\FileSystemInterface $file_system */ /** @var \Drupal\Core\File\FileSystemInterface $file_system */
$file_system = \Drupal::service('file_system'); $file_system = \Drupal::service('file_system');
$files = $file_system->scanDirectory("$directory/$project", '/^' . DRUPAL_PHP_FUNCTION_PATTERN . '\.info.yml$/', ['key' => 'name', 'min_depth' => 0]); $files = $file_system->scanDirectory("$directory/$project", '/.*\.info.yml$/', ['key' => 'name', 'min_depth' => 0]);
foreach ($files as $file) { foreach ($files as $file) {
// Get the .info.yml file for the module or theme this file belongs to. // Get the .info.yml file for the module or theme this file belongs to.
$info = \Drupal::service('info_parser')->parse($file->uri); $info = \Drupal::service('info_parser')->parse($file->uri);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment