本文整理匯總了PHP中eZHTTPFile::store方法的典型用法代碼示例。如果您正苦於以下問題:PHP eZHTTPFile::store方法的具體用法?PHP eZHTTPFile::store怎麽用?PHP eZHTTPFile::store使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類eZHTTPFile
的用法示例。
在下文中一共展示了eZHTTPFile::store方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: initializeFromHTTPFile
/**
* Initializes the content object attribute with the uploaded HTTP file
*
* @param eZHTTPFile $httpFile
* @param string $imageAltText Optional image ALT text
*
* @return TODO: FIXME
*/
function initializeFromHTTPFile($httpFile, $imageAltText = false)
{
$this->increaseImageSerialNumber();
$mimeData = eZMimeType::findByFileContents($httpFile->attribute('filename'));
if (!$mimeData['is_valid']) {
$mimeData = eZMimeType::findByName($httpFile->attribute('mime_type'));
if (!$mimeData['is_valid']) {
$mimeData = eZMimeType::findByURL($httpFile->attribute('original_filename'));
}
}
$attr = false;
$this->removeAliases($attr);
$this->setOriginalAttributeDataValues($this->ContentObjectAttributeData['id'], $this->ContentObjectAttributeData['version'], $this->ContentObjectAttributeData['language_code']);
$contentVersion = eZContentObjectVersion::fetchVersion($this->ContentObjectAttributeData['version'], $this->ContentObjectAttributeData['contentobject_id']);
$objectName = $this->imageName($this->ContentObjectAttributeData, $contentVersion);
$objectPathString = $this->imagePath($this->ContentObjectAttributeData, $contentVersion, true);
eZMimeType::changeBaseName($mimeData, $objectName);
eZMimeType::changeDirectoryPath($mimeData, $objectPathString);
$httpFile->store(false, false, $mimeData);
$originalFilename = $httpFile->attribute('original_filename');
return $this->initialize($mimeData, $originalFilename, $imageAltText);
}