当前位置: 首页>>代码示例>>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;未经允许,请勿转载。