Commit bb665be5 authored by Steven Jones's avatar Steven Jones Committed by Steven Jones
Browse files

Issue #3112602 by Steven Jones: Remove Drupal 8 deprecations

parent 7d56b15f
......@@ -7,6 +7,7 @@ use Drupal\Core\Cache\Cache;
use Drupal\Core\Config\Entity\ConfigEntityBase;
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Entity\EntityWithPluginCollectionInterface;
use Drupal\Core\File\FileSystemInterface;
use Drupal\imageapi_optimize\ImageAPIOptimizeProcessorPluginCollection;
use Drupal\imageapi_optimize\ImageAPIOptimizeProcessorInterface;
use Drupal\imageapi_optimize\ImageAPIOptimizePipelineInterface;
......@@ -182,7 +183,7 @@ class ImageAPIOptimizePipeline extends ConfigEntityBase implements ImageAPIOptim
foreach ($this->getProcessors() as $processor) {
// Create a copy of this image for the processor to work on.
$temp_image_uri = file_unmanaged_copy($image_uri, $temp_image_uri, FILE_EXISTS_RENAME);
$temp_image_uri = \Drupal::service('file_system')->copy($image_uri, $temp_image_uri, FileSystemInterface::EXISTS_RENAME);
if ($temp_image_uri === FALSE) {
return FALSE;
}
......@@ -200,7 +201,7 @@ class ImageAPIOptimizePipeline extends ConfigEntityBase implements ImageAPIOptim
if ($image_changed) {
// Copy the temporary file back over the original image.
file_unmanaged_move($temp_image_uri, $image_uri, FILE_EXISTS_REPLACE);
\Drupal::service('file_system')->move($temp_image_uri, $image_uri, FileSystemInterface::EXISTS_REPLACE);
}
}
......@@ -297,7 +298,7 @@ class ImageAPIOptimizePipeline extends ConfigEntityBase implements ImageAPIOptim
public function __destruct() {
foreach ($this->temporaryFiles as $file) {
if (file_exists($file)) {
file_unmanaged_delete($file);
\Drupal::service('file_system')->delete($file);
}
}
}
......
......@@ -2,7 +2,9 @@
namespace Drupal\imageapi_optimize;
use Drupal\Component\Plugin\ConfigurableInterface;
use Drupal\Component\Plugin\ConfigurablePluginInterface;
use Drupal\Component\Plugin\DependentPluginInterface;
use Drupal\Component\Plugin\PluginInspectionInterface;
/**
......@@ -15,7 +17,7 @@ use Drupal\Component\Plugin\PluginInspectionInterface;
* @see \Drupal\imageapi_optimize\ImageAPIOptimizeProcessorManager
* @see plugin_api
*/
interface ImageAPIOptimizeProcessorInterface extends PluginInspectionInterface, ConfigurablePluginInterface {
interface ImageAPIOptimizeProcessorInterface extends PluginInspectionInterface, ConfigurableInterface, DependentPluginInterface, ConfigurablePluginInterface {
/**
* Returns a render array summarizing the configuration of the image optimize processor.
......
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