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


PHP View::searchByMime方法代碼示例

本文整理匯總了PHP中OC\Files\View::searchByMime方法的典型用法代碼示例。如果您正苦於以下問題:PHP View::searchByMime方法的具體用法?PHP View::searchByMime怎麽用?PHP View::searchByMime使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在OC\Files\View的用法示例。


在下文中一共展示了View::searchByMime方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: create

 public function create($albumPath, $square = false)
 {
     $albumView = new View($this->view->getRoot() . $albumPath);
     $images = $albumView->searchByMime('image', 10);
     $count = min(count($images), 10);
     $thumbnail = imagecreatetruecolor($count * 200, 200);
     for ($i = 0; $i < $count; $i++) {
         $thumb = new Thumbnail($albumPath . $images[$i]['path'], $this->user, true);
         $image = $thumb->get();
         if ($image && $image->valid()) {
             imagecopy($thumbnail, $image->resource(), $i * 200, 0, 0, 0, 200, 200);
             $image->destroy();
         }
     }
     imagepng($thumbnail, $this->path);
     imagedestroy($thumbnail);
 }
開發者ID:WYSAC,項目名稱:oregon-owncloud,代碼行數:17,代碼來源:albumthumbnail.php

示例2: refresh

 public function refresh()
 {
     $view = new \OC\Files\View('');
     //! need root ?
     $gpx_files = $view->searchByMime('application/gpx');
     $fileids = array();
     foreach ($gpx_files as $fileinfo) {
         $fileid = $fileinfo->getId();
         $fileids[$fileid] = false;
     }
     $sql = "select distinct fileid" . " from *PREFIX*gpx_tracks" . " WHERE user_id = ?";
     $prep = $this->db->prepare($sql);
     $prep->bindValue(1, $this->userId);
     $prep->execute($sql);
     $filesondb = $prep->fetchAll(\PDO::FETCH_ASSOC);
     //return $filesondb;
     $lost = array();
     foreach ($filesondb as $t) {
         $id = $t['fileid'];
         if (isset($fileids[$id])) {
             $fileids[$id] = true;
         } else {
             $lost[] = $id;
             //on the db but not in filecache
         }
     }
     $done = array();
     foreach ($fileids as $fileid => $status) {
         if (!$status) {
             $this->putAllTracks($fileid);
             $done[] = $fileid;
         }
     }
     return $done;
     //! TODO remove lost files records
 }
開發者ID:sken2,項目名稱:oc_gpstracks,代碼行數:36,代碼來源:gpsxml.php

示例3: searchByMime

 /**
  * @param string $query
  */
 public static function searchByMime($query)
 {
     return self::$defaultInstance->searchByMime($query);
 }
開發者ID:stweil,項目名稱:owncloud-core,代碼行數:7,代碼來源:Filesystem.php


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