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


PHP kFile::linkFile方法代码示例

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


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

示例1: operate

 public function operate(kOperator $operator = null, $inFilePath, $configFilePath = null)
 {
     if (kFile::fullMkfileDir($this->outFilePath)) {
         KalturaLog::debug('dir [' . $this->outFilePath . '] created');
         //outFilePath will be the path to the directory in which the images will be saved.
         $outDirPath = $this->outFilePath;
         //imageMagick decides the format of the output file according to the outFilePath's extension.so the format need to be added.
         $this->outFilePath = $this->outFilePath . DIRECTORY_SEPARATOR . basename($this->outFilePath) . self::LEADING_ZEROS_PADDING . '.' . $this->data->flavorParamsOutput->format;
     } else {
         KalturaLog::debug('failed to create [' . $this->outFilePath . '] directory');
         throw new KOperationEngineException('failed to create [' . $this->outFilePath . '] directory');
     }
     $ext = strtolower(pathinfo($inFilePath, PATHINFO_EXTENSION));
     $inputFormat = $this->getInputFormat();
     if ($inputFormat == self::PDF_FORMAT && $ext != 'pdf' && kFile::linkFile($inFilePath, "{$inFilePath}.pdf")) {
         $inFilePath = "{$inFilePath}.pdf";
     }
     if ($inputFormat == self::JPG_FORMAT && $ext != 'jpg' && kFile::linkFile($inFilePath, "{$inFilePath}.jpg")) {
         $inFilePath = "{$inFilePath}.jpg";
     }
     $realInFilePath = realpath($inFilePath);
     // Test input
     // - Test file type
     $errorMsg = $this->checkFileType($realInFilePath, $this->SUPPORTED_FILE_TYPES);
     if (!is_null($errorMsg)) {
         $this->data->engineMessage = $errorMsg;
     }
     // Test password required
     if ($this->testPasswordRequired($realInFilePath)) {
         $this->data->engineMessage = "Password required.";
     }
     parent::operate($operator, $realInFilePath, $configFilePath);
     $imagesList = kFile::dirList($outDirPath, false);
     // Test output
     // - Test black Image
     $identifyExe = KBatchBase::$taskConfig->params->identify;
     $firstImage = $outDirPath . DIRECTORY_SEPARATOR . $imagesList[0];
     $errorMsg = $this->testBlackImage($identifyExe, $firstImage, $errorMsg);
     if (!is_null($errorMsg)) {
         $this->data->engineMessage = $errorMsg;
     }
     $imagesListXML = $this->createImagesListXML($imagesList);
     kFile::setFileContent($outDirPath . DIRECTORY_SEPARATOR . self::IMAGES_LIST_XML_NAME, $imagesListXML->asXML());
     KalturaLog::info('images list xml [' . $outDirPath . DIRECTORY_SEPARATOR . self::IMAGES_LIST_XML_NAME . '] created');
     return true;
 }
开发者ID:kubrickfr,项目名称:server,代码行数:46,代码来源:KOperationEngineImageMagick.php


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