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