當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UploadHandler::get_file_object方法代碼示例

本文整理匯總了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;
 }
開發者ID:saper,項目名稱:organic-extensions,代碼行數:31,代碼來源:MWUploadHandler.php

示例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;
 }
開發者ID:web-feet,項目名稱:coasterframework,代碼行數:11,代碼來源:GalleryUploadHandler.php

示例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;
             }
         }
     }
 }
開發者ID:aagusti,項目名稱:padl-tng,代碼行數:31,代碼來源:mfhandler.php


注:本文中的UploadHandler::get_file_object方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。