本文整理汇总了PHP中UploadHandler::get_file_object方法的典型用法代码示例。如果您正苦于以下问题:PHP UploadHandler::get_file_object方法的具体用法?PHP UploadHandler::get_file_object怎么用?PHP UploadHandler::get_file_object使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UploadHandler
的用法示例。
在下文中一共展示了UploadHandler::get_file_object方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_file_object
/**
* Add info on the user who uploaded the file and the date it was uploaded, and create thumb if it doesn't exist
*/
protected function get_file_object($file_name)
{
// Create the thumb if it doesn't exist
$thumb = $this->options['upload_dir'] . 'thumb/' . $file_name;
if (!file_exists(jQueryUpload::thumbFilename($thumb))) {
$this->create_scaled_image($file_name, $this->options['image_versions']['thumbnail']);
}
// Call the parent method to create the file object
$file = parent::get_file_object($file_name);
// Add the meta data to the object
if (is_object($file)) {
$meta = $this->options['upload_dir'] . 'meta/' . $file_name;
$file->info = $file->desc = "";
// If the meta data file exists, extract and render the content
if (is_file($meta)) {
$data = unserialize(file_get_contents($meta));
$file->info = self::renderData($data);
$file->desc = array_key_exists(2, $data) ? $data[2] : '';
} elseif (is_link($this->options['upload_dir'] . $file_name)) {
$title = Title::newFromText($file_name, NS_FILE);
if (is_object($title) && $title->exists()) {
list($uid, $ts, $file->desc) = self::getUploadedFileInfo($title);
$file->info = self::renderData(array($uid, wfTimestamp(TS_UNIX, $ts)));
}
}
}
return $file;
}
示例2: get_file_object
protected function get_file_object($file_name)
{
if (!($file = parent::get_file_object($file_name))) {
$file = new \stdClass();
$file->name = $file_name;
$file->size = 0;
$file->url = $this->get_download_url($file->name);
$this->set_additional_file_properties($file);
}
return $file;
}
示例3: RunnerCipherer
}
$rs = db_query($queryObj->gSQLWhere($strWhereClause), $conn);
if ($isDBFile) {
if ($rs && ($data = db_fetch_array($rs))) {
$value = db_stripslashesbinary($data[$field]);
}
} else {
$cipherer = new RunnerCipherer($strTableName, $pSet);
$row = $cipherer->DecryptFetchedArray($rs);
if (!is_null($row)) {
$filesArray = my_json_decode($row[$field]);
if (!is_array($filesArray) || count($filesArray) == 0) {
if ($row[$field] == "") {
$filesArray = array();
} else {
$uploadedFile = $upload_handler->get_file_object($row[$field]);
if (is_null($uploadedFile)) {
$filesArray = array();
} else {
$filesArray = array(my_json_decode(my_json_encode($uploadedFile)));
}
}
}
foreach ($filesArray as $uploadedFile) {
if ($uploadedFile["usrName"] == $fileName) {
$sessionFile = $uploadedFile;
break;
}
}
}
}