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