comparison core/lib/Drupal/Core/Image/Image.php @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents c75dbcec494b
children
comparison
equal deleted inserted replaced
4:a9cd425dd02b 5:12f9dff5fda9
126 // Clear the cached file size and refresh the image information. 126 // Clear the cached file size and refresh the image information.
127 clearstatcache(TRUE, $destination); 127 clearstatcache(TRUE, $destination);
128 $this->fileSize = filesize($destination); 128 $this->fileSize = filesize($destination);
129 $this->source = $destination; 129 $this->source = $destination;
130 130
131 // @todo Use File utility when https://www.drupal.org/node/2050759 is in. 131 if (\Drupal::service('file_system')->chmod($destination)) {
132 if ($this->chmod($destination)) {
133 return $return; 132 return $return;
134 } 133 }
135 } 134 }
136 return FALSE; 135 return FALSE;
137 } 136 }
206 * A string containing a URI file, or directory path. 205 * A string containing a URI file, or directory path.
207 * @param int $mode 206 * @param int $mode
208 * Integer value for the permissions. Consult PHP chmod() documentation for 207 * Integer value for the permissions. Consult PHP chmod() documentation for
209 * more information. 208 * more information.
210 * 209 *
211 * @see drupal_chmod()
212 *
213 * @todo Remove when https://www.drupal.org/node/2050759 is in.
214 *
215 * @return bool 210 * @return bool
216 * TRUE for success, FALSE in the event of an error. 211 * TRUE for success, FALSE in the event of an error.
212 *
213 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
214 * Use \Drupal\Core\File\FileSystem::chmod().
215 *
216 * @see \Drupal\Core\File\FileSystemInterface::chmod()
217 * @see https://www.drupal.org/node/2418133
217 */ 218 */
218 protected function chmod($uri, $mode = NULL) { 219 protected function chmod($uri, $mode = NULL) {
219 return drupal_chmod($uri, $mode); 220 @trigger_error('chmod() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\File\FileSystemInterface::chmod(). See https://www.drupal.org/node/2418133.', E_USER_DEPRECATED);
221 return \Drupal::service('file_system')->chmod($uri, $mode);
220 } 222 }
221 223
222 } 224 }