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


PHP OC_Filesystem::filemtime方法代码示例

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


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

示例1: getPresentations

 public static function getPresentations()
 {
     $presentations = array();
     $list = \OC_FileCache::searchByMime('application', 'zip');
     foreach ($list as $l) {
         $info = pathinfo($l);
         $size = \OC_Filesystem::filesize($l);
         $mtime = \OC_Filesystem::filemtime($l);
         $entry = array('url' => $l, 'name' => $info['filename'], 'size' => $size, 'mtime' => $mtime);
         $presentations[] = $entry;
     }
     return $presentations;
 }
开发者ID:netcon-source,项目名称:apps,代码行数:13,代码来源:impressionist.php

示例2: getFileInfo

 /**
  * get the filesystem info
  * @param string path
  * @return array
  *
  * returns an associative array with the following keys:
  * - size
  * - mtime
  * - ctime
  * - mimetype
  * - encrypted
  * - versioned
  */
 public static function getFileInfo($path)
 {
     if (($path == '/Shared' || substr($path, 0, 8) == '/Shared/') && OC_App::isEnabled('files_sharing')) {
         if ($path == '/Shared') {
             list($info) = OCP\Share::getItemsSharedWith('file', OC_Share_Backend_File::FORMAT_FILE_APP_ROOT);
         } else {
             $info['size'] = OC_Filesystem::filesize($path);
             $info['mtime'] = OC_Filesystem::filemtime($path);
             $info['ctime'] = OC_Filesystem::filectime($path);
             $info['mimetype'] = OC_Filesystem::getMimeType($path);
             $info['encrypted'] = false;
             $info['versioned'] = false;
         }
     } else {
         $info = OC_FileCache::get($path);
     }
     return $info;
 }
开发者ID:noci2012,项目名称:owncloud,代码行数:31,代码来源:files.php

示例3: isset

 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
 *
 * You should have received a copy of the GNU Affero General Public
 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
// Init owncloud
// Check if we are a user
OCP\JSON::checkLoggedIn();
// Set the session key for the file we are about to edit.
$dir = isset($_GET['dir']) ? $_GET['dir'] : '';
$filename = isset($_GET['file']) ? $_GET['file'] : '';
if (!empty($filename)) {
    $path = $dir . '/' . $filename;
    if (OC_Filesystem::is_writable($path)) {
        $mtime = OC_Filesystem::filemtime($path);
        $filecontents = OC_Filesystem::file_get_contents($path);
        $filecontents = iconv(mb_detect_encoding($filecontents), "UTF-8", $filecontents);
        OCP\JSON::success(array('data' => array('filecontents' => $filecontents, 'write' => 'true', 'mtime' => $mtime)));
    } else {
        $mtime = OC_Filesystem::filemtime($path);
        $filecontents = OC_Filesystem::file_get_contents($path);
        $filecontents = iconv(mb_detect_encoding($filecontents), "UTF-8", $filecontents);
        OCP\JSON::success(array('data' => array('filecontents' => $filecontents, 'write' => 'false', 'mtime' => $mtime)));
    }
} else {
    OCP\JSON::error(array('data' => array('message' => 'Invalid file path supplied.')));
}
开发者ID:netcon-source,项目名称:apps,代码行数:31,代码来源:loadfile.php

示例4: getLastModified

 /**
  * Returns the last modification time, as a unix timestamp
  *
  * @return int
  */
 public function getLastModified()
 {
     return OC_Filesystem::filemtime($this->path);
 }
开发者ID:Teino1978-Corp,项目名称:Teino1978-Corp-owncloud_.htaccess-,代码行数:9,代码来源:owncloud_lib_connector_sabre_node.php

示例5: ob_end_clean

            ob_end_clean();
            $ftype = OC_Filesystem::getMimeType($arguments['path']);
            $songId = OC_MEDIA_COLLECTION::getSongByPath($arguments['path']);
            OC_MEDIA_COLLECTION::registerPlay($songId);
            header('Content-Type:' . $ftype);
            // calc an offset of 24 hours
            $offset = 3600 * 24;
            // calc the string in GMT not localtime and add the offset
            $expire = "Expires: " . gmdate("D, d M Y H:i:s", time() + $offset) . " GMT";
            //output the HTTP header
            header($expire);
            header('Cache-Control: max-age=3600, must-revalidate');
            header('Pragma: public');
            header('Accept-Ranges: bytes');
            header('Content-Length: ' . OC_Filesystem::filesize($arguments['path']));
            $gmt_mtime = gmdate('D, d M Y H:i:s', OC_Filesystem::filemtime($arguments['path'])) . ' GMT';
            header("Last-Modified: " . $gmt_mtime);
            OC_Filesystem::readfile($arguments['path']);
            exit;
        case 'find_music':
            OC_JSON::encodedPrint(findMusic());
            exit;
    }
}
function findMusic($path = '')
{
    $music = array();
    $dh = OC_Filesystem::opendir($path);
    if ($dh) {
        while ($filename = readdir($dh)) {
            if ($filename[0] != '.') {
开发者ID:Teino1978-Corp,项目名称:Teino1978-Corp-owncloud_.htaccess-,代码行数:31,代码来源:owncloud_apps_media_ajax_api.php

示例6: header

                    $song['album'] = OC_MEDIA_COLLECTION::getAlbumName($song['song_album']);
                    OCP\JSON::encodedPrint($song);
                }
            }
            break;
        case 'play':
            @ob_end_clean();
            $ftype = OC_Filesystem::getMimeType($arguments['path']);
            if (substr($ftype, 0, 5) != 'audio' and $ftype != 'application/ogg') {
                echo 'Not an audio file';
                exit;
            }
            $songId = OC_MEDIA_COLLECTION::getSongByPath($arguments['path']);
            OC_MEDIA_COLLECTION::registerPlay($songId);
            header('Content-Type:' . $ftype);
            OCP\Response::enableCaching(3600 * 24);
            // 24 hour
            header('Accept-Ranges: bytes');
            header('Content-Length: ' . OC_Filesystem::filesize($arguments['path']));
            $mtime = OC_Filesystem::filemtime($arguments['path']);
            OCP\Response::setLastModifiedHeader($mtime);
            OC_Filesystem::readfile($arguments['path']);
            exit;
        case 'find_music':
            $music = OC_FileCache::searchByMime('audio');
            $ogg = OC_FileCache::searchByMime('application', 'ogg');
            $music = array_merge($music, $ogg);
            OCP\JSON::encodedPrint($music);
            exit;
    }
}
开发者ID:blablubli,项目名称:owncloudapps,代码行数:31,代码来源:api.php


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