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