本文整理汇总了PHP中SJB_HelperFunctions::getFileSizeAndSizeToken方法的典型用法代码示例。如果您正苦于以下问题:PHP SJB_HelperFunctions::getFileSizeAndSizeToken方法的具体用法?PHP SJB_HelperFunctions::getFileSizeAndSizeToken怎么用?PHP SJB_HelperFunctions::getFileSizeAndSizeToken使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SJB_HelperFunctions
的用法示例。
在下文中一共展示了SJB_HelperFunctions::getFileSizeAndSizeToken方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: validationManager
private function validationManager($fieldInfo, $tp, $uploadedFieldId, $complex = null)
{
// will use tmp_uploads_storage in $_SESSION to storage file info
$uniqueStorageId = SJB_Session::getSessionId();
$this->fileUniqueId = $uniqueStorageId . "_" . $uploadedFieldId . "_tmp";
// delete uniquie value
SJB_UploadFileManager::deleteUploadedFileByID($this->fileUniqueId);
$this->property = new SJB_ObjectProperty($fieldInfo);
$this->property->setValue('');
if ($complex) {
$this->property->setComplexParent($complex['parentField']);
$this->property->setComplexEnum($complex['complexStep']);
$fileNamePath = "{$complex['parentField']}/name/{$complex['subFieldId']}/{$complex['complexStep']}";
$fileSizePath = "{$complex['parentField']}/size/{$complex['subFieldId']}/{$complex['complexStep']}";
} else {
$fileNamePath = $uploadedFieldId . '/name';
$fileSizePath = $uploadedFieldId . '/size';
}
$fileName = SJB_Array::getPath($_FILES, $fileNamePath);
if (!$fileName) {
$validation = 'UPLOAD_ERR_INI_SIZE';
} else {
$uploadedFilesize = SJB_Array::getPath($_FILES, $fileSizePath);
$filesizeInfo = SJB_HelperFunctions::getFileSizeAndSizeToken($uploadedFilesize);
$tp->assign(array('filesize' => $filesizeInfo['filesize'], 'size_token' => $filesizeInfo['size_token']));
$validation = $this->property->isValid();
}
$this->propertyValue = $this->property->getValue();
if ($validation !== true) {
$this->errors[$validation] = 1;
if (!$complex) {
$tp->assign(array('id' => $uploadedFieldId, 'value' => array('file_url' => SJB_Array::get($this->propertyValue, 'file_url'), 'file_name' => SJB_Array::get($this->propertyValue, 'file_name'), 'saved_file_name' => SJB_Array::get($this->propertyValue, 'saved_file_name'), 'file_id' => $this->fileUniqueId)));
}
}
$tp->assign("uploadMaxFilesize", SJB_UploadFileManager::getIniUploadMaxFilesize());
return $validation === true;
}