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


PHP kFile::setFileContent方法代码示例

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


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

示例1: createDirDescriber

 protected function createDirDescriber($outDir, $fileName)
 {
     $fileList = kFile::dirList($outDir, false);
     $fileListXml = $this->createImagesListXML($fileList);
     kFile::setFileContent($outDir . DIRECTORY_SEPARATOR . $fileName, $fileListXml->asXML());
     KalturaLog::info('file list xml [' . $outDir . DIRECTORY_SEPARATOR . $fileName . '] created');
 }
开发者ID:kubrickfr,项目名称:server,代码行数:7,代码来源:KOperationEnginePpt2Image.php

示例2: 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->flavorParamsOutput->format;
     } else {
         KalturaLog::debug('failed to create [' . $this->outFilePath . '] directory');
         throw new KOperationEngineException('failed to create [' . $this->outFilePath . '] directory');
     }
     parent::operate($operator, $inFilePath, $configFilePath);
     $imagesListXML = $this->createImagesListXML($outDirPath);
     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');
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:17,代码来源:KOperationEngineImageMagick.php

示例3: 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

示例4: executeImpl

 /**
  * Executes index action
  */
 protected function executeImpl(kshow $kshow)
 {
     $this->xml_content = "";
     $kshow_id = $this->kshow_id;
     if ($kshow_id == NULL || $kshow_id == 0) {
         return sfView::SUCCESS;
     }
     $metadata_creator = new myKshowMetadataCreator();
     $this->show_metadata = $metadata_creator->createMetadata($kshow_id);
     //		$kshow = kshowPeer:retrieveByPK( $kshow_id );
     $entry = entryPeer::retrieveByPK($kshow->getShowEntryId());
     // TODO - this should never happen
     if ($entry == NULL) {
         // there is no show entry for this show !
         $entry = $kshow->createEntry(entry::ENTRY_MEDIA_TYPE_SHOW, $kshow->getProducerId());
     }
     $content_path = myContentStorage::getFSContentRootPath();
     $file_path = $content_path . $entry->getDataPath();
     // check to see if the content of the file changed
     $current_metadata = kFile::getFileContent($file_path);
     $comp_result = strcmp($this->show_metadata, $current_metadata);
     if ($comp_result != 0) {
         $ext = pathinfo($file_path, PATHINFO_EXTENSION);
         if ($ext != "xml") {
             // this is for the first time - override the template path by setting the data to NULL
             $entry->setData(NULL);
             $file_path = pathinfo($file_path, PATHINFO_DIRNAME) . "/" . kFile::getFileNameNoExtension($file_path) . ".xml";
         }
         // this will increment the name if needed
         $entry->setData($file_path);
         $file_path = $content_path . $entry->getDataPath();
         $entry->save();
         kFile::fullMkdir($file_path);
         kFile::setFileContent($file_path, $this->show_metadata);
         $this->xml_content = $this->show_metadata;
     }
 }
开发者ID:DBezemer,项目名称:server,代码行数:40,代码来源:createDefaultMetadataAction.class.php

示例5: uploadJpeg

 public static function uploadJpeg($data, $id, $filename, $hash, $extra_id = null, $return_extended_data = false)
 {
     //$realHash = myContentStorage::getTempUploadHash($filename, $id);
     $origFilename = $filename;
     // filename is OK?
     if (true) {
         $filename = $id . '_' . $filename;
         // add the file extension after the "." character
         $fullPath = myContentStorage::getFSUploadsPath() . $filename . ($extra_id ? "_" . $extra_id : "") . ".jpg";
         kFile::setFileContent($fullPath, $data);
         chmod($fullPath, 0777);
         if ($return_extended_data) {
             return array("token" => $id, "filename" => $filename, "origFilename" => $origFilename, "thumb_url" => null, "thumb_created" => false);
         }
         return true;
     }
     return false;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:18,代码来源:myUploadUtils.class.php

示例6: Zend_Config_Ini

if (isset($_REQUEST['config'])) {
    $configSection = $_REQUEST['config'];
}
$config = new Zend_Config_Ini("../../config/testme.ini");
$indexConfig = $config->get($configSection);
$include = $indexConfig->get("include");
$exclude = $indexConfig->get("exclude");
$cacheFileName = kConf::get("cache_root_path") . '/testme/services';
if (file_exists($cacheFileName)) {
    $services = unserialize(file_get_contents($cacheFileName));
} else {
    $clientGenerator = new DummyForDocsClientGenerator();
    $clientGenerator->setIncludeOrExcludeList($include, $exclude);
    $clientGenerator->load();
    $services = $clientGenerator->getServices();
    kFile::setFileContent($cacheFileName, serialize($services));
}
$list = array();
foreach ($services as $serviceName => $serviceReflector) {
    if ($serviceReflector->isDeprecated() || $serviceReflector->isServerOnly()) {
        unset($services[$serviceName]);
    }
}
ksort($services, SORT_STRING);
if (!isset($_REQUEST['hideMenu']) || !$_REQUEST['hideMenu']) {
    ?>
			<body class="body-bg">
				<ul id="kmcSubMenu">
					<li class="active"><a href="#">Test Console</a></li>
					<li><a href="../testmeDoc/index.php">API Documentation</a></li>
					<li><a href="client-libs.php">API Client Libraries</a></li>
开发者ID:richhl,项目名称:kalturaCE,代码行数:31,代码来源:index.php

示例7: die

    if (in_array($inputPage, array("inout", "notifications", "overview", "terminology", "multirequest"))) {
        require_once __DIR__ . "/static_doc/" . $inputPage . ".php";
    } else {
        die('Page "' . $inputPage . '" not found');
    }
} else {
    if ($inputService && $inputAction) {
        $service = $inputService;
        $action = $inputAction;
        require_once __DIR__ . "/service_action_info.php";
    } else {
        if ($inputService) {
            $service = $inputService;
            require_once __DIR__ . "/service_info.php";
        } else {
            if ($inputObject) {
                $object = $inputObject;
                require_once __DIR__ . "/object_info.php";
            }
        }
    }
}
?>
		</div>
	</div>
<?php 
$out = ob_get_contents();
ob_end_clean();
print $out;
kFile::setFileContent($cacheFilePath, $out);
require_once __DIR__ . "/footer.php";
开发者ID:DBezemer,项目名称:server,代码行数:31,代码来源:index.php

示例8: executeImpl

 protected function executeImpl(kshow $kshow, entry &$entry)
 {
     $this->res = "";
     $likuser_id = $this->getLoggedInUserId();
     // if we allow multiple rouchcuts - there is no reason for one suer to override someone else's thumbnail
     if ($this->allowMultipleRoughcuts()) {
         if ($likuser_id != $entry->getKuserId()) {
             // ERROR - attempting to update an entry which doesnt belong to the user
             return "<xml>!!</xml>";
             //$this->securityViolation( $kshow->getId() );
         }
     }
     $debug = @$_GET["debug"];
     /*
     $kshow_id = @$_GET["kshow_id"];
     $debug = @$_GET["debug"];
     
     $this->kshow_id = $kshow_id;
     
     if ( $kshow_id == NULL || $kshow_id == 0 ) return;
     
     $kshow = kshowPeer::retrieveByPK( $kshow_id );
     
     if ( ! $kshow ) 
     {
     	$this->res = "No kshow " . $kshow_id ;
     	return;	
     }
     
     // is the logged-in-user is not an admin or the producer - check if show can be published	
     $likuser_id = $this->getLoggedInUserId();
     $viewer_type = myKshowUtils::getViewerType($kshow, $likuser_id);
     if ( $viewer_type != KshowKuser::KSHOWKUSER_VIEWER_PRODUCER && ( ! $kshow->getCanPublish() ) ) 
     {
     	// ERROR - attempting to publish a non-publishable show
     	return "<xml>!</xml>";//$this->securityViolation( $kshow->getId() );
     }
     
     
     // ASSUME - the kshow & roughcut already exist
     $show_entry_id = $kshow->getShowEntryId();
     $roughcut = entryPeer::retrieveByPK( $show_entry_id );
     
     $roughcut = entryPeer::retrieveByPK( $entry_id );
     
      
     if ( ! $roughcut)
     {
     	$this->res = "No roughcut for kshow " . $kshow->getId() ;
     	return;	
     }
     */
     //		echo "for entry: $show_entry_id current thumb path: " . $entry->getThumbnail() ;
     $entry->setThumbnail(".jpg");
     $entry->setCreateThumb(false);
     $entry->save();
     //$thumb_data = $_REQUEST["ThumbData"];
     if (isset($HTTP_RAW_POST_DATA)) {
         $thumb_data = $HTTP_RAW_POST_DATA;
     } else {
         $thumb_data = file_get_contents("php://input");
     }
     //		$thumb_data = $GLOBALS["HTTP_RAW_POST_DATA"];
     $thumb_data_size = strlen($thumb_data);
     $bigThumbPath = myContentStorage::getFSContentRootPath() . $entry->getBigThumbnailPath();
     kFile::fullMkdir($bigThumbPath);
     kFile::setFileContent($bigThumbPath, $thumb_data);
     $path = myContentStorage::getFSContentRootPath() . $entry->getThumbnailPath();
     kFile::fullMkdir($path);
     myFileConverter::createImageThumbnail($bigThumbPath, $path);
     $roughcutPath = myContentStorage::getFSContentRootPath() . $entry->getDataPath();
     $xml_doc = new KDOMDocument();
     $xml_doc->load($roughcutPath);
     if (myMetadataUtils::updateThumbUrl($xml_doc, $entry->getBigThumbnailUrl())) {
         $xml_doc->save($roughcutPath);
     }
     $this->res = $entry->getBigThumbnailUrl();
 }
开发者ID:DBezemer,项目名称:server,代码行数:78,代码来源:setRoughcutThumbnailAction.class.php

示例9: transferVideoChunk

 private static function transferVideoChunk($fb, $accessToken, $sessionId, $startOffset, $endOffset, $filePath, $workingDir, $pageId)
 {
     $chunkContent = kFile::getFileContent($filePath, $startOffset, $endOffset);
     $chunkFilePath = $workingDir . DIRECTORY_SEPARATOR . 'file_' . $startOffset;
     kFile::setFileContent($chunkFilePath, $chunkContent);
     $data = array('upload_phase' => 'transfer', 'start_offset' => $startOffset, 'video_file_chunk' => $fb->videoToUpload($chunkFilePath), 'upload_session_id' => $sessionId);
     $response = $fb->post("/" . $pageId . "/videos", $data, $accessToken);
     $graphNode = $response->getGraphNode();
     return $graphNode;
 }
开发者ID:dozernz,项目名称:server,代码行数:10,代码来源:FacebookGraphSdkUtils.php

示例10: executeImpl

 public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
 {
     $kshowId = $this->getP("kshow_id");
     $numberOfVersions = $this->getP("number_of_versions", 5);
     // must be int and not more than 50
     $numberOfVersions = (int) $numberOfVersions;
     $numberOfVersions = min($numberOfVersions, 50);
     $kshow = kshowPeer::retrieveByPK($kshowId);
     if (!$kshow) {
         $this->addError(APIErrors::KSHOW_DOES_NOT_EXISTS);
         return;
     }
     $showEntry = $kshow->getShowEntry();
     if (!$showEntry) {
         $this->addError(APIErrors::ROUGHCUT_NOT_FOUND);
         return;
     }
     $sync_key = $showEntry->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_DATA);
     $showEntryDataPath = kFileSyncUtils::getLocalFilePathForKey($sync_key);
     $versionsInfoFilePath = $showEntryDataPath . '.info';
     $lastVersionDoc = new KDOMDocument();
     $lastVersionDoc->loadXML(kFileSyncUtils::file_get_contents($sync_key, true, false));
     $lastVersion = myContentStorage::getVersion($showEntryDataPath);
     // check if we need to refresh the data in the info file
     $refreshInfoFile = true;
     if (file_exists($versionsInfoFilePath)) {
         $versionsInfoDoc = new KDOMDocument();
         $versionsInfoDoc->load($versionsInfoFilePath);
         $lastVersionInInfoFile = kXml::getLastElementAsText($versionsInfoDoc, "ShowVersion");
         if ($lastVersionInInfoFile && $lastVersion == $lastVersionInInfoFile) {
             $refreshInfoFile = false;
         } else {
             $refreshInfoFile = true;
         }
     } else {
         $refreshInfoFile = true;
     }
     // refresh or create the data in the info file
     if ($refreshInfoFile) {
         $versionsInfoDoc = new KDOMDocument();
         $xmlElement = $versionsInfoDoc->createElement("xml");
         // start from the first edited version (100001) and don't use 100000
         for ($i = myContentStorage::MIN_OBFUSCATOR_VALUE + 1; $i <= $lastVersion; $i++) {
             $version_sync_key = $showEntry->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_DATA, $i);
             if (kFileSyncUtils::file_exists($version_sync_key, false)) {
                 $xmlContent = kFileSyncUtils::file_get_contents($version_sync_key);
                 //echo "[" . htmlspecialchars( $xmlContent ) . "]<br>";
                 $xmlDoc = new KDOMDocument();
                 $xmlDoc->loadXML($xmlContent);
                 $elementToCopy = kXml::getFirstElement($xmlDoc, "MetaData");
                 //echo "[$i]";
                 $elementCloned = $elementToCopy->cloneNode(true);
                 $elementImported = $versionsInfoDoc->importNode($elementCloned, true);
                 $xmlElement->appendChild($elementImported);
             }
         }
         $versionsInfoDoc->appendChild($xmlElement);
         kFile::setFileContent($versionsInfoFilePath, $versionsInfoDoc->saveXML());
         // FileSync OK - created a temp file on DC's disk
     }
     $metadataNodes = $versionsInfoDoc->getElementsByTagName("MetaData");
     $count = 0;
     $versionsInfo = array();
     for ($i = $metadataNodes->length - 1; $i >= 0; $i--) {
         $metadataNode = $metadataNodes->item($i);
         $node = kXml::getFirstElement($metadataNode, "ShowVersion");
         $showVersion = $node ? $node->nodeValue : "";
         $node = kXml::getFirstElement($metadataNode, "PuserId");
         $puserId = $node ? $node->nodeValue : "";
         $node = kXml::getFirstElement($metadataNode, "ScreenName");
         $screenName = $node ? $node->nodeValue : "";
         $node = kXml::getFirstElement($metadataNode, "UpdatedAt");
         $updatedAt = $node ? $node->nodeValue : "";
         $versionsInfo[] = array("version" => $showVersion, "puserId" => $puserId, "screenName" => $screenName, "updatedAt" => $updatedAt);
         $count++;
         if ($count >= $numberOfVersions) {
             break;
         }
     }
     $this->addMsg("show_versions", $versionsInfo);
 }
开发者ID:DBezemer,项目名称:server,代码行数:81,代码来源:getlastversionsinfoAction.class.php


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