comparison core/lib/Drupal/Core/Updater/Updater.php @ 18:af1871eacc83

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:33:08 +0100
parents 129ea1e6d783
children
comparison
equal deleted inserted replaced
17:129ea1e6d783 18:af1871eacc83
109 $info_files = file_scan_directory($directory, '/.*\.info.yml$/'); 109 $info_files = file_scan_directory($directory, '/.*\.info.yml$/');
110 if (!$info_files) { 110 if (!$info_files) {
111 return FALSE; 111 return FALSE;
112 } 112 }
113 foreach ($info_files as $info_file) { 113 foreach ($info_files as $info_file) {
114 if (mb_substr($info_file->filename, 0, -9) == drupal_basename($directory)) { 114 if (mb_substr($info_file->filename, 0, -9) == \Drupal::service('file_system')->basename($directory)) {
115 // Info file Has the same name as the directory, return it. 115 // Info file Has the same name as the directory, return it.
116 return $info_file->uri; 116 return $info_file->uri;
117 } 117 }
118 } 118 }
119 // Otherwise, return the first one. 119 // Otherwise, return the first one.
153 * 153 *
154 * @return string 154 * @return string
155 * The name of the project. 155 * The name of the project.
156 */ 156 */
157 public static function getProjectName($directory) { 157 public static function getProjectName($directory) {
158 return drupal_basename($directory); 158 return \Drupal::service('file_system')->basename($directory);
159 } 159 }
160 160
161 /** 161 /**
162 * Returns the project name from a Drupal info file. 162 * Returns the project name from a Drupal info file.
163 * 163 *