当前位置: 首页>>代码示例>>PHP>>正文


PHP Filesystem::searchByMime方法代码示例

本文整理汇总了PHP中OC\Files\Filesystem::searchByMime方法的典型用法代码示例。如果您正苦于以下问题:PHP Filesystem::searchByMime方法的具体用法?PHP Filesystem::searchByMime怎么用?PHP Filesystem::searchByMime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OC\Files\Filesystem的用法示例。


在下文中一共展示了Filesystem::searchByMime方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getMusic

 /**
  * get a list of all music files of the user
  *
  * @return array
  */
 public function getMusic()
 {
     $music = \OC\Files\Filesystem::searchByMime('audio');
     $ogg = \OC\Files\Filesystem::searchByMime('application/ogg');
     $music = array_merge($music, $ogg);
     foreach ($music as &$file) {
         $file = $file['path'];
     }
     return $music;
 }
开发者ID:CDN-Sparks,项目名称:owncloud,代码行数:15,代码来源:scanner.php

示例2: getPresentations

 public static function getPresentations()
 {
     $presentations = array();
     $list = \OC\Files\Filesystem::searchByMime('text/impress');
     foreach ($list as $l) {
         $info = pathinfo($l);
         $size = \OC\Files\Filesystem::filesize($l);
         $mtime = \OC\Files\Filesystem::filemtime($l);
         $entry = array('url' => $l, 'name' => $info['filename'], 'size' => $size, 'mtime' => $mtime);
         $presentations[] = $entry;
     }
     return $presentations;
 }
开发者ID:CDN-Sparks,项目名称:owncloud,代码行数:13,代码来源:impress.php

示例3: array

<?php

/**
 * Copyright (c) 2012 Robin Appelman <icewind@owncloud.com>
 * This file is licensed under the Affero General Public License version 3 or
 * later.
 * See the COPYING-README file.
 */
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('gallery');
$images = \OC\Files\Filesystem::searchByMime('image');
$user = \OC_User::getUser();
foreach ($images as &$image) {
    $image['path'] = $user . $image['path'];
}
$shared = array();
$sharedSources = OCP\Share::getItemsSharedWith('gallery');
$users = array();
foreach ($sharedSources as $sharedSource) {
    $owner = $sharedSource['uid_owner'];
    if (array_search($owner, $users) === false) {
        $users[] = $owner;
    }
    \OC\Files\Filesystem::initMountPoints($owner);
    $ownerView = new \OC\Files\View('/' . $owner . '/files');
    $path = $ownerView->getPath($sharedSource['item_source']);
    if ($path) {
        $shareName = basename($path);
        $shareView = new \OC\Files\View('/' . $owner . '/files' . $path);
        $sharedImages = $shareView->searchByMime('image');
        foreach ($sharedImages as $sharedImage) {
开发者ID:CDN-Sparks,项目名称:owncloud,代码行数:31,代码来源:getimages.php

示例4: searchByMime

 /**
  * Search for files by mimetype
  * @param string $mimetype
  * @return array
  * @since 6.0.0
  */
 public static function searchByMime($mimetype)
 {
     return \OC\Files\Filesystem::searchByMime($mimetype);
 }
开发者ID:kenwi,项目名称:core,代码行数:10,代码来源:files.php


注:本文中的OC\Files\Filesystem::searchByMime方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。