diff options
author | webchick | 2013-11-20 20:52:58 (GMT) |
---|---|---|
committer | webchick | 2013-11-20 20:52:58 (GMT) |
commit | 40e903f89794e1cf99af881c8292ad1937c77379 (patch) | |
tree | f846a425e6595f0fbc30eef9fef4c39e36ac7713 | |
parent | 76e6e2a92083f52d66f4581e6b95308b3658c91e (diff) |
Rollback of Issue #2138239 by damiankloip, tim.plunkett, amateescu: Use GlobIterator instead of glob. — breaks testbot.
-rw-r--r-- | core/lib/Drupal/Core/Config/FileStorage.php | 13 | ||||
-rw-r--r-- | core/lib/Drupal/Core/Config/InstallStorage.php | 7 | ||||
-rw-r--r-- | core/modules/ckeditor/lib/Drupal/ckeditor/Plugin/Editor/CKEditor.php | 6 |
3 files changed, 12 insertions, 14 deletions
diff --git a/core/lib/Drupal/Core/Config/FileStorage.php b/core/lib/Drupal/Core/Config/FileStorage.php index 52c9aa5..bf178c5 100644 --- a/core/lib/Drupal/Core/Config/FileStorage.php +++ b/core/lib/Drupal/Core/Config/FileStorage.php @@ -204,14 +204,11 @@ class FileStorage implements StorageInterface { throw new StorageException($this->directory . '/ not found.'); } $extension = '.' . static::getFileExtension(); - $files = new \GlobIterator(DRUPAL_ROOT . '/' . $this->directory . '/' . $prefix . '*' . $extension); - - $names = array(); - foreach ($files as $file) { - $names[] = $file->getBasename($extension); - } - - return $names; + $files = glob($this->directory . '/' . $prefix . '*' . $extension); + $clean_name = function ($value) use ($extension) { + return basename($value, $extension); + }; + return array_map($clean_name, $files); } /** diff --git a/core/lib/Drupal/Core/Config/InstallStorage.php b/core/lib/Drupal/Core/Config/InstallStorage.php index 16bcc1c..e8442ea 100644 --- a/core/lib/Drupal/Core/Config/InstallStorage.php +++ b/core/lib/Drupal/Core/Config/InstallStorage.php @@ -134,9 +134,10 @@ class InstallStorage extends FileStorage { foreach ($list as $name) { $directory = $this->getComponentFolder($type, $name); if (file_exists($directory)) { - $files = new \GlobIterator(DRUPAL_ROOT . '/' . $directory . '/*' . $extension); - foreach ($files as $file) { - $folders[$file->getBasename($extension)] = $directory; + $files = glob($directory . '/*' . $extension); + foreach ($files as $filename) { + $name = basename($filename, $extension); + $folders[$name] = $directory; } } } diff --git a/core/modules/ckeditor/lib/Drupal/ckeditor/Plugin/Editor/CKEditor.php b/core/modules/ckeditor/lib/Drupal/ckeditor/Plugin/Editor/CKEditor.php index 3eefd37..bc0dc61 100644 --- a/core/modules/ckeditor/lib/Drupal/ckeditor/Plugin/Editor/CKEditor.php +++ b/core/modules/ckeditor/lib/Drupal/ckeditor/Plugin/Editor/CKEditor.php @@ -320,9 +320,9 @@ class CKEditor extends EditorBase implements ContainerFactoryPluginInterface { if (empty($langcodes)) { $langcodes = array(); // Collect languages included with CKEditor based on file listing. - $ckeditor_languages = new \GlobIterator(DRUPAL_ROOT . '/core/assets/vendor/ckeditor/lang/*.js'); - foreach ($ckeditor_languages as $language_file) { - $langcode = $language_file->getBasename('.js'); + $ckeditor_languages = glob(DRUPAL_ROOT . '/core/assets/vendor/ckeditor/lang/*.js'); + foreach ($ckeditor_languages as $language_filename) { + $langcode = basename($language_filename, '.js'); $langcodes[$langcode] = $langcode; } cache('ckeditor.languages')->set('langcodes', $langcodes); |