Commit 618f0bcf authored by catch's avatar catch

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
......@@ -112,6 +112,10 @@
/**
* 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
*/
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() {
$drivers = [];
// 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 */
$file_system = \Drupal::service('file_system');
$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) {
$incompatible = [];
/** @var \Drupal\Core\File\FileSystemInterface $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) {
// Get the .info.yml file for the module or theme this file belongs to.
$info = \Drupal::service('info_parser')->parse($file->uri);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment