diff -u b/core/core.services.yml b/core/core.services.yml --- b/core/core.services.yml +++ b/core/core.services.yml @@ -1372,6 +1372,18 @@ class: Drupal\Core\StreamWrapper\TemporaryStream tags: - { name: stream_wrapper, scheme: temporary } + stream_wrapper.module: + class: Drupal\Core\StreamWrapper\ModuleStream + tags: + - { name: stream_wrapper, scheme: module } + stream_wrapper.theme: + class: Drupal\Core\StreamWrapper\ThemeStream + tags: + - { name: stream_wrapper, scheme: theme } + stream_wrapper.profile: + class: Drupal\Core\StreamWrapper\ProfileStream + tags: + - { name: stream_wrapper, scheme: profile } kernel_destruct_subscriber: class: Drupal\Core\EventSubscriber\KernelDestructionSubscriber tags: @@ -1401,18 +1413,6 @@ class: Drupal\Core\StreamWrapper\TemporaryStream tags: - { name: stream_wrapper, scheme: temporary } - stream_wrapper.module: - class: Drupal\Core\StreamWrapper\ModuleStream - tags: - - { name: stream_wrapper, scheme: module } - stream_wrapper.theme: - class: Drupal\Core\StreamWrapper\ThemeStream - tags: - - { name: stream_wrapper, scheme: theme } - stream_wrapper.profile: - class: Drupal\Core\StreamWrapper\ProfileStream - tags: - - { name: stream_wrapper, scheme: profile } kernel_destruct_subscriber: class: Drupal\Core\EventSubscriber\KernelDestructionSubscriber tags: diff -u b/core/includes/bootstrap.inc b/core/includes/bootstrap.inc --- b/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -193,10 +193,14 @@ /** * Returns the path to a system item (module, theme, etc.). * - * @param $type + * This function should only be used when including a file containing PHP code; + * the 'module://', 'profile://' and 'theme://' stream wrappers should be used + * for other use cases. + * + * @param string $type * The type of the item; one of 'core', 'profile', 'module', 'theme', or * 'theme_engine'. - * @param $name + * @param string $name * The name of the item for which the path is requested. Ignored for * $type 'core'. * @@ -300,14 +304,10 @@ /** * Returns the path to a system item (module, theme, etc.). * - * This function should only be used when including a file containing PHP code; - * the 'module://', 'profile://' and 'theme://' stream wrappers should be used - * for other use cases. - * - * @param string $type + * @param $type * The type of the item; one of 'core', 'profile', 'module', 'theme', or * 'theme_engine'. - * @param string $name + * @param $name * The name of the item for which the path is requested. Ignored for * $type 'core'. * diff -u b/core/modules/color/color.module b/core/modules/color/color.module --- b/core/modules/color/color.module +++ b/core/modules/color/color.module @@ -386,7 +386,7 @@ // Make sure enough memory is available. if (isset($info['base_image'])) { // Fetch source image dimensions. - $source = drupal_get_path('theme', $theme) . '/' . $info['base_image']; + $source = "theme://$theme/{$info['base_image']}"; list($width, $height) = getimagesize($source); // We need at least a copy of the source and a target buffer of the same @@ -399,7 +399,7 @@ // Make sure enough memory is available. if (isset($info['base_image'])) { // Fetch source image dimensions. - $source = "theme://$theme/{$info['base_image']}"; + $source = drupal_get_path('theme', $theme) . '/' . $info['base_image']; list($width, $height) = getimagesize($source); // We need at least a copy of the source and a target buffer of the same