Skip to content
Snippets Groups Projects
Commit d582ea74 authored by Steven Jones's avatar Steven Jones Committed by Steven Jones
Browse files

Issue #2994535 by Steven Jones: Processors are broken

parent 3014fd32
Branches
Tags 8.x-1.0-alpha1
No related merge requests found
Showing
with 37 additions and 27 deletions
services: services:
imageapi_optimize.shell_operations: imageapi_optimize_binaries.shell_operations:
class: Drupal\imageapi_optimize\ShellOperations class: Drupal\imageapi_optimize_binaries\ShellOperations
<?php <?php
namespace Drupal\imageapi_optimize; namespace Drupal\imageapi_optimize_binaries;
use Drupal\Core\File\FileSystemInterface; use Drupal\Core\File\FileSystemInterface;
use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Image\ImageFactory; use Drupal\Core\Image\ImageFactory;
use Drupal\imageapi_optimize\ConfigurableImageAPIOptimizeProcessorBase;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
...@@ -23,7 +24,7 @@ abstract class ImageAPIOptimizeProcessorBinaryBase extends ConfigurableImageAPIO ...@@ -23,7 +24,7 @@ abstract class ImageAPIOptimizeProcessorBinaryBase extends ConfigurableImageAPIO
/** /**
* The imageapi shell operation service. * The imageapi shell operation service.
* *
* @var \Drupal\imageapi_optimize\ImageAPIOptimizeShellOperationsInterface * @var \Drupal\imageapi_optimize_binaries\ImageAPIOptimizeShellOperationsInterface
*/ */
protected $shellOperations; protected $shellOperations;
...@@ -48,7 +49,7 @@ abstract class ImageAPIOptimizeProcessorBinaryBase extends ConfigurableImageAPIO ...@@ -48,7 +49,7 @@ abstract class ImageAPIOptimizeProcessorBinaryBase extends ConfigurableImageAPIO
$container->get('logger.factory')->get('imageapi_optimize'), $container->get('logger.factory')->get('imageapi_optimize'),
$container->get('image.factory'), $container->get('image.factory'),
$container->get('file_system'), $container->get('file_system'),
$container->get('imageapi_optimize.shell_operations') $container->get('imageapi_optimize_binaries.shell_operations')
); );
} }
......
<?php
namespace Drupal\imageapi_optimize_binaries;
interface ImageAPIOptimizeShellOperationsInterface {
public function findExecutablePath($executable = NULL);
public function execShellCommand($command, $options, $arguments);
public function saveCommandStdoutToFile($cmd, $dst);
}
<?php <?php
namespace Drupal\imageapi_optimize\Plugin\ImageAPIOptimizeProcessor; namespace Drupal\imageapi_optimize_binaries\Plugin\ImageAPIOptimizeProcessor;
use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Form\FormStateInterface;
use Drupal\imageapi_optimize\ImageAPIOptimizeProcessorBinaryBase; use Drupal\imageapi_optimize_binaries\ImageAPIOptimizeProcessorBinaryBase;
/** /**
* Uses the AdvDef binary to optimize images. * Uses the AdvDef binary to optimize images.
......
<?php <?php
namespace Drupal\imageapi_optimize\Plugin\ImageAPIOptimizeProcessor; namespace Drupal\imageapi_optimize_binaries\Plugin\ImageAPIOptimizeProcessor;
use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Form\FormStateInterface;
use Drupal\imageapi_optimize\ImageAPIOptimizeProcessorBinaryBase; use Drupal\imageapi_optimize_binaries\ImageAPIOptimizeProcessorBinaryBase;
/** /**
* Uses the AdvPng binary to optimize images. * Uses the AdvPng binary to optimize images.
......
<?php <?php
namespace Drupal\imageapi_optimize\Plugin\ImageAPIOptimizeProcessor; namespace Drupal\imageapi_optimize_binaries\Plugin\ImageAPIOptimizeProcessor;
use Drupal\imageapi_optimize\ImageAPIOptimizeProcessorBinaryBase; use Drupal\imageapi_optimize_binaries\ImageAPIOptimizeProcessorBinaryBase;
/** /**
* Uses the JfifRemove binary to optimize images. * Uses the JfifRemove binary to optimize images.
......
<?php <?php
namespace Drupal\imageapi_optimize\Plugin\ImageAPIOptimizeProcessor; namespace Drupal\imageapi_optimize_binaries\Plugin\ImageAPIOptimizeProcessor;
use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Form\FormStateInterface;
use Drupal\imageapi_optimize\ImageAPIOptimizeProcessorBinaryBase; use Drupal\imageapi_optimize_binaries\ImageAPIOptimizeProcessorBinaryBase;
/** /**
* Uses the JpegOptim binary to optimize images. * Uses the JpegOptim binary to optimize images.
......
<?php <?php
namespace Drupal\imageapi_optimize\Plugin\ImageAPIOptimizeProcessor; namespace Drupal\imageapi_optimize_binaries\Plugin\ImageAPIOptimizeProcessor;
use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Form\FormStateInterface;
use Drupal\imageapi_optimize\ImageAPIOptimizeProcessorBinaryBase; use Drupal\imageapi_optimize_binaries\ImageAPIOptimizeProcessorBinaryBase;
/** /**
* Uses the JpegTran binary to optimize images. * Uses the JpegTran binary to optimize images.
......
<?php <?php
namespace Drupal\imageapi_optimize\Plugin\ImageAPIOptimizeProcessor; namespace Drupal\imageapi_optimize_binaries\Plugin\ImageAPIOptimizeProcessor;
use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Form\FormStateInterface;
use Drupal\imageapi_optimize\ImageAPIOptimizeProcessorBinaryBase; use Drupal\imageapi_optimize_binaries\ImageAPIOptimizeProcessorBinaryBase;
/** /**
* Uses the OptiPng binary to optimize images. * Uses the OptiPng binary to optimize images.
......
<?php <?php
namespace Drupal\imageapi_optimize\Plugin\ImageAPIOptimizeProcessor; namespace Drupal\imageapi_optimize_binaries\Plugin\ImageAPIOptimizeProcessor;
use Drupal\imageapi_optimize\ImageAPIOptimizeProcessorBinaryBase; use Drupal\imageapi_optimize_binaries\ImageAPIOptimizeProcessorBinaryBase;
/** /**
* Uses the PngCrush binary to optimize images. * Uses the PngCrush binary to optimize images.
......
<?php <?php
namespace Drupal\imageapi_optimize\Plugin\ImageAPIOptimizeProcessor; namespace Drupal\imageapi_optimize_binaries\Plugin\ImageAPIOptimizeProcessor;
use Drupal\imageapi_optimize\ImageAPIOptimizeProcessorBinaryBase; use Drupal\imageapi_optimize_binaries\ImageAPIOptimizeProcessorBinaryBase;
/** /**
* Uses the PngOut binary to optimize images. * Uses the PngOut binary to optimize images.
......
<?php <?php
namespace Drupal\imageapi_optimize\Plugin\ImageAPIOptimizeProcessor; namespace Drupal\imageapi_optimize_binaries\Plugin\ImageAPIOptimizeProcessor;
use Drupal\imageapi_optimize\ImageAPIOptimizeProcessorBinaryBase; use Drupal\imageapi_optimize_binaries\ImageAPIOptimizeProcessorBinaryBase;
/** /**
* Uses the PngQuant binary to optimize images. * Uses the PngQuant binary to optimize images.
......
<?php <?php
namespace Drupal\imageapi_optimize; namespace Drupal\imageapi_optimize_binaries;
/** /**
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
namespace Drupal\Tests\imageapi_optimize\Unit; namespace Drupal\Tests\imageapi_optimize\Unit;
use Drupal\imageapi_optimize\Plugin\ImageAPIOptimizeProcessor\AdvDef; use Drupal\imageapi_optimize_binaries\Plugin\ImageAPIOptimizeProcessor\AdvDef;
/** /**
* Tests AdvDef image optimize plugin. * Tests AdvDef image optimize plugin.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
namespace Drupal\Tests\imageapi_optimize\Unit; namespace Drupal\Tests\imageapi_optimize\Unit;
use Drupal\imageapi_optimize\Plugin\ImageAPIOptimizeProcessor\AdvPng; use Drupal\imageapi_optimize_binaries\Plugin\ImageAPIOptimizeProcessor\AdvPng;
/** /**
* Tests AdvPng image optimize plugin. * Tests AdvPng image optimize plugin.
......
...@@ -30,7 +30,7 @@ abstract class BinaryTestCase extends UnitTestCase { ...@@ -30,7 +30,7 @@ abstract class BinaryTestCase extends UnitTestCase {
} }
protected function getShellOperationsMock() { protected function getShellOperationsMock() {
$shellOperationsMock = $this->getMockBuilder('\Drupal\imageapi_optimize\ImageAPIOptimizeShellOperationsInterface') $shellOperationsMock = $this->getMockBuilder('\Drupal\imageapi_optimize_binaries\ImageAPIOptimizeShellOperationsInterface')
->setMethods(['findExecutablePath', 'execShellCommand', 'saveCommandStdoutToFile']) ->setMethods(['findExecutablePath', 'execShellCommand', 'saveCommandStdoutToFile'])
->getMock(); ->getMock();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment