TYPO3 CMS  TYPO3_6-2
GraphicsMagickPreset.php
Go to the documentation of this file.
1 <?php
3 
18 
23 
27  protected $name = 'GraphicsMagick';
28 
32  protected $priority = 80;
33 
37  protected $configurationValues = array(
38  'GFX/image_processing' => 1,
39  'GFX/im' => 1,
40  // im_path and im_path_lzw are determined and set by path lookup methods
41  'GFX/im_path' => '',
42  'GFX/im_path_lzw' => '',
43  'GFX/im_version_5' => 'gm',
44  'GFX/im_v5effects' => -1,
45  'GFX/im_mask_temp_ext_gif' => 1,
46  'GFX/colorspace' => 'RGB',
47  );
48 
55  protected function findExecutableInPath(array $searchPaths) {
56  return $this->findGraphicsMagickInPaths($searchPaths);
57  }
58 
65  protected function findGraphicsMagickInPaths(array $searchPaths) {
66  $result = FALSE;
67  foreach ($searchPaths as $path) {
68  if (TYPO3_OS === 'WIN') {
69  $executable = 'gm.exe';
70  } else {
71  $executable = 'gm';
72  }
73  if (@is_file($path . $executable)) {
74  $command = escapeshellarg($path . $executable) . ' -version';
75  $executingResult = FALSE;
76  \TYPO3\CMS\Core\Utility\CommandUtility::exec($command, $executingResult);
77  // First line of exec command should contain string GraphicsMagick
78  $firstResultLine = array_shift($executingResult);
79  if (strpos($firstResultLine, 'GraphicsMagick') !== FALSE) {
80  $this->foundPath = $path;
81  $result = TRUE;
82  break;
83  }
84  }
85  }
86  return $result;
87  }
88 }
if($list_of_literals) if(!empty($literals)) if(!empty($literals)) $result
Analyse literals to prepend the N char to them if their contents aren&#39;t numeric.
static exec($command, &$output=NULL, &$returnValue=0)