本文整理匯總了PHP中myContentStorage::getFileNameEdit方法的典型用法代碼示例。如果您正苦於以下問題:PHP myContentStorage::getFileNameEdit方法的具體用法?PHP myContentStorage::getFileNameEdit怎麽用?PHP myContentStorage::getFileNameEdit使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類myContentStorage
的用法示例。
在下文中一共展示了myContentStorage::getFileNameEdit方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: generateFilePathArr
/**
* (non-PHPdoc)
* @see lib/model/ISyncableFile#generateFilePathArr()
*/
public function generateFilePathArr($sub_type, $version = null)
{
static::validateFileSyncSubType($sub_type);
if ($sub_type == self::FILE_SYNC_ENTRY_SUB_TYPE_DATA) {
$data = $this->getData();
if ($this->getType() == entryType::MIX && (!$this->getData() || !strpos($this->getData(), 'xml'))) {
$data .= ".xml";
}
$res = myContentStorage::getGeneralEntityPath("entry/data", $this->getIntId(), $this->getId(), $data, $version);
// $res = myContentStorage::getGeneralEntityPath("entry/data", $this->getIntId(), $this->getId(), $this->getData(), $version);
} elseif ($sub_type == self::FILE_SYNC_ENTRY_SUB_TYPE_DATA_EDIT) {
$res = myContentStorage::getFileNameEdit(myContentStorage::getGeneralEntityPath("entry/data", $this->getIntId(), $this->getId(), $this->getData(), $version));
} elseif ($sub_type == self::FILE_SYNC_ENTRY_SUB_TYPE_THUMB) {
$res = myContentStorage::getGeneralEntityPath("entry/bigthumbnail", $this->getIntId(), $this->getId(), $this->getThumbnail(), $version);
} elseif ($sub_type == self::FILE_SYNC_ENTRY_SUB_TYPE_ARCHIVE) {
$res = null;
$data_path = myContentStorage::getGeneralEntityPath("entry/data", $this->getIntId(), $this->getId(), $this->getData(), $version);
// assume the suffix is not the same as the one on the data
$archive_path = dirname(str_replace("content/entry/", "archive/", $data_path)) . "/" . $this->getId();
if ($this->getArchiveExtension()) {
$res = $archive_path . "." . $this->getArchiveExtension();
} else {
$archive_pattern = $archive_path . ".*";
$arc_files = glob(myContentStorage::getFSContentRootPath() . $archive_pattern);
foreach ($arc_files as $full_path_name) {
// return the first file found
$res = $full_path_name;
break;
}
if (!$res) {
$res = $archive_pattern;
}
}
} elseif ($sub_type == self::FILE_SYNC_ENTRY_SUB_TYPE_DOWNLOAD) {
// in this case the $version is used as the format
$basename = kFile::getFileNameNoExtension($this->getData());
$path = myContentStorage::getGeneralEntityPath("entry/download", $this->getIntId(), $this->getId(), $basename);
$download_path = $path . ".{$version}";
$res = $download_path;
} else {
$path = "entry/data";
switch ($sub_type) {
case self::FILE_SYNC_ENTRY_SUB_TYPE_ISM:
$basename = $this->generateBaseFileName(0, $this->getIsmVersion());
$basename .= '.ism';
break;
case self::FILE_SYNC_ENTRY_SUB_TYPE_ISMC:
$basename = $this->generateBaseFileName(0, $this->getIsmVersion());
$basename .= '.ismc';
break;
case self::FILE_SYNC_ENTRY_SUB_TYPE_CONVERSION_LOG:
$basename = $this->generateBaseFileName(0, $this->getIsmVersion());
$basename .= '.log';
break;
}
$res = myContentStorage::getGeneralEntityPath($path, $this->getIntId(), $this->getId(), $basename);
}
return array(myContentStorage::getFSContentRootPath(), $res);
}
示例2: getBestFileFlavor
/**
will return the edit file name if exists, else the original one
*/
public static function getBestFileFlavor($file_name)
{
$edit_file_name = myContentStorage::getFileNameEdit($file_name);
if (file_exists($edit_file_name) && filesize($edit_file_name) > 0) {
return $edit_file_name;
}
return $file_name;
}