本文整理汇总了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;
}