当前位置: 首页>>代码示例>>PHP>>正文


PHP ezcBaseFeatures::findExecutableInPath方法代码示例

本文整理汇总了PHP中ezcBaseFeatures::findExecutableInPath方法的典型用法代码示例。如果您正苦于以下问题:PHP ezcBaseFeatures::findExecutableInPath方法的具体用法?PHP ezcBaseFeatures::findExecutableInPath怎么用?PHP ezcBaseFeatures::findExecutableInPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ezcBaseFeatures的用法示例。


在下文中一共展示了ezcBaseFeatures::findExecutableInPath方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: checkImageMagickComposite

 private function checkImageMagickComposite()
 {
     if (!isset($settings->options['binary_composite'])) {
         $this->binary_composite = ezcBaseFeatures::findExecutableInPath('composite');
     } else {
         if (file_exists($settings->options['binary_composite'])) {
             $this->binary_composite = $settings->options['binary_composite'];
         }
     }
     if ($this->binary_composite === null) {
         throw new ezcImageHandlerNotAvailableException('ezcImageImagemagickHandler', 'ImageMagick not installed or not available in PATH variable.');
     }
     // Prepare to run ImageMagick command
     $descriptors = array(array('pipe', 'r'), array('pipe', 'w'), array('pipe', 'w'));
     // Open ImageMagick process
     $imageProcess = proc_open($this->binary_composite, $descriptors, $pipes);
     // Close STDIN pipe
     fclose($pipes[0]);
     $outputString = '';
     // Read STDOUT
     do {
         $outputString .= rtrim(fgets($pipes[1], 1024), "\n");
     } while (!feof($pipes[1]));
     $errorString = '';
     // Read STDERR
     do {
         $errorString .= rtrim(fgets($pipes[2], 1024), "\n");
     } while (!feof($pipes[2]));
     // Wait for process to terminate and store return value
     $return = proc_close($imageProcess);
     // Process potential errors
     if (strlen($errorString) > 0 || strpos($outputString, 'ImageMagick') === false) {
         throw new ezcImageHandlerNotAvailableException('ezcImageImagemagickHandler', 'ImageMagick not installed or not available in PATH variable.');
     }
 }
开发者ID:Adeelgill,项目名称:livehelperchat,代码行数:35,代码来源:lhgalleryconverterhandler.php

示例2: swfCompare

 /**
  * Compares to flash files comparing the output of `swftophp`
  * 
  * @param string $generated Filename of generated image
  * @param string $compare Filename of stored image
  * @return void
  */
 protected function swfCompare($generated, $compare)
 {
     $this->assertTrue(file_exists($generated), 'No image file has been created.');
     $this->assertTrue(file_exists($compare), 'Comparision image does not exist.');
     $executeable = ezcBaseFeatures::findExecutableInPath('swftophp');
     if (!$executeable) {
         $this->markTestSkipped('Could not find swftophp executeable to compare flash files. Please check your $PATH.');
     }
     $this->assertEquals($this->normalizeFlashCode(shell_exec($executeable . ' ' . escapeshellarg($compare))), $this->normalizeFlashCode(shell_exec($executeable . ' ' . escapeshellarg($generated))), 'Rendered image is not correct.');
 }
开发者ID:madscientist159,项目名称:Graph,代码行数:17,代码来源:test_case.php

示例3: swfCompare

 /**
  * Compares to flash files comparing the output of `swftophp`
  * 
  * @param string $generated Filename of generated image
  * @param string $compare Filename of stored image
  * @return void
  */
 protected function swfCompare($generated, $compare)
 {
     $this->assertTrue(file_exists($generated), 'No image file has been created.');
     $this->assertTrue(file_exists($compare), 'Comparision image does not exist.');
     $executeable = ezcBaseFeatures::findExecutableInPath('swftophp');
     if (!$executeable) {
         $this->markTestSkipped('Could not find swftophp executeable to compare flash files. Please check your $PATH.');
     }
     $generatedCode = shell_exec($executeable . ' ' . escapeshellarg($generated));
     $compareCode = shell_exec($executeable . ' ' . escapeshellarg($compare));
     foreach (array('generatedCode' => $generatedCode, 'compareCode' => $compareCode) as $var => $content) {
         $content = preg_replace('/\\$[sf]\\d+/', '$var', $content);
         $content = preg_replace('[/\\*.*\\*/]i', '/* Comment irrelevant */', $content);
         ${$var} = $content;
     }
     $this->assertEquals($generatedCode, $compareCode, 'Rendered image is not correct.');
 }
开发者ID:mediasadc,项目名称:alba,代码行数:24,代码来源:test_case.php


注:本文中的ezcBaseFeatures::findExecutableInPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。