3 namespace Drupal\imagemagick;
6 * Provides an interface for ImageMagick execution managers.
8 interface ImagemagickExecManagerInterface {
11 * Gets the binaries package in use.
13 * @param string $package
14 * (optional) Force the graphics package.
17 * The default package ('imagemagick'|'graphicsmagick'), or the $package
20 public function getPackage($package = NULL);
23 * Gets a translated label of the binaries package in use.
25 * @param string $package
26 * (optional) Force the package.
29 * A translated label of the binaries package in use, or the $package
32 public function getPackageLabel($package = NULL);
35 * Verifies file path of the executable binary by checking its version.
38 * The user-submitted file path to the convert binary.
39 * @param string $package
40 * (optional) The graphics package to use.
43 * An associative array containing:
44 * - output: The shell output of 'convert -version', if any.
45 * - errors: A list of error messages indicating if the executable could
46 * not be found or executed.
48 public function checkPath($path, $package = NULL);
51 * Executes the convert executable as shell command.
53 * @param string $command
54 * The executable to run.
55 * @param \Drupal\imagemagick\ImagemagickExecArguments $arguments
56 * An ImageMagick execution arguments object.
57 * @param string &$output
58 * (optional) A variable to assign the shell stdout to, passed by
60 * @param string &$error
61 * (optional) A variable to assign the shell stderr to, passed by
64 * (optional) A custom file path to the executable binary.
67 * TRUE if the command succeeded, FALSE otherwise. The error exit status
68 * code integer returned by the executable is logged.
70 public function execute($command, ImagemagickExecArguments $arguments, &$output = NULL, &$error = NULL, $path = NULL);
73 * Executes a command on the operating system.
75 * This differs from ::runOsCommand in the sense that here the command to be
76 * executed and its arguments are passed separately.
78 * @param string $command
80 * @param string $arguments
81 * The arguments of the command to run.
83 * An identifier for the process to be spawned on the operating system.
84 * @param string &$output
85 * (optional) A variable to assign the shell stdout to, passed by
87 * @param string &$error
88 * (optional) A variable to assign the shell stderr to, passed by
92 * The operating system returned code, or FALSE if it was not possible to
93 * execute the command.
95 public function runOsShell($command, $arguments, $id, &$output = NULL, &$error = NULL);