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


PHP Files::searchByMime方法代碼示例

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


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

示例1: searchDocuments

 protected static function searchDocuments()
 {
     $documents = array();
     foreach (self::getSupportedMimetypes() as $mime) {
         $documents = array_merge($documents, \OCP\Files::searchByMime($mime));
     }
     return $documents;
 }
開發者ID:ozcan,項目名稱:richdocuments,代碼行數:8,代碼來源:storage.php

示例2: getDocuments

 public static function getDocuments()
 {
     $list = array_filter(\OCP\Files::searchByMime('application/vnd.oasis.opendocument.text'), function ($item) {
         //filter Deleted
         if (strpos($item['path'], '_trashbin') === 0) {
             return false;
         }
         return true;
     });
     return $list;
 }
開發者ID:omusico,項目名稱:isle-web-framework,代碼行數:11,代碼來源:storage.php

示例3: getPresentations

 public static function getPresentations()
 {
     $presentations = array();
     $list = \OCP\Files::searchByMime('text/impress');
     foreach ($list as $l) {
         $size = \OC\Files\Filesystem::filesize($l["path"]);
         if ($size > 0) {
             $info = pathinfo($l["path"]);
             $mtime = \OC\Files\Filesystem::filemtime($l["path"]);
             $entry = array('url' => $l["path"], 'name' => $info['filename'], 'size' => $size, 'mtime' => $mtime);
             $presentations[] = $entry;
         }
     }
     return $presentations;
 }
開發者ID:DOM-Digital-Online-Media,項目名稱:apps,代碼行數:15,代碼來源:impress.php

示例4: array

        // The token defines the target directory (security reasons)
        $path = \OC\Files\Filesystem::getPath($linkItem['file_source']);
        $view = new \OC\Files\View(\OC\Files\Filesystem::getView()->getAbsolutePath($path));
        $images = $view->searchByMime('image');
        $result = array();
        foreach ($images as $image) {
            $result[] = $token . $image['path'];
        }
        OCP\JSON::setContentTypeHeader();
        echo json_encode(array('images' => $result, 'users' => array(), 'displayNames' => array()));
        exit;
    }
}
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('gallery');
$images = \OCP\Files::searchByMime('image');
$user = \OCP\User::getUser();
$users = array();
$result = array();
foreach ($images as &$image) {
    // we show shared images another way
    if ($image->getStorage() instanceof \OC\Files\Storage\Shared) {
        $owner = $image['uid_owner'];
        $users[$owner] = $owner;
    } else {
        $owner = $user;
    }
    $path = $image['path'];
    if (strpos($path, DIRECTORY_SEPARATOR . ".")) {
        continue;
    }
開發者ID:WYSAC,項目名稱:oregon-owncloud,代碼行數:31,代碼來源:getimages.php


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