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


PHP Storage::filemtime方法代码示例

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


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

示例1: testReuseExisting

 public function testReuseExisting()
 {
     $this->fillTestFolders();
     $this->scanner->scan('');
     $oldData = $this->cache->get('');
     $this->storage->unlink('folder/bar.txt');
     $this->cache->put('folder', array('mtime' => $this->storage->filemtime('folder'), 'storage_mtime' => $this->storage->filemtime('folder')));
     $this->scanner->scan('', \OC\Files\Cache\Scanner::SCAN_SHALLOW, \OC\Files\Cache\Scanner::REUSE_SIZE);
     $newData = $this->cache->get('');
     $this->assertInternalType('string', $oldData['etag']);
     $this->assertInternalType('string', $newData['etag']);
     $this->assertNotSame($oldData['etag'], $newData['etag']);
     $this->assertEquals($oldData['size'], $newData['size']);
     $oldData = $newData;
     $this->scanner->scan('', \OC\Files\Cache\Scanner::SCAN_SHALLOW, \OC\Files\Cache\Scanner::REUSE_ETAG);
     $newData = $this->cache->get('');
     $this->assertSame($oldData['etag'], $newData['etag']);
     $this->assertEquals(-1, $newData['size']);
     $this->scanner->scan('', \OC\Files\Cache\Scanner::SCAN_RECURSIVE);
     $oldData = $this->cache->get('');
     $this->assertNotEquals(-1, $oldData['size']);
     $this->scanner->scanFile('', \OC\Files\Cache\Scanner::REUSE_ETAG + \OC\Files\Cache\Scanner::REUSE_SIZE);
     $newData = $this->cache->get('');
     $this->assertSame($oldData['etag'], $newData['etag']);
     $this->assertEquals($oldData['size'], $newData['size']);
     $this->scanner->scan('', \OC\Files\Cache\Scanner::SCAN_RECURSIVE, \OC\Files\Cache\Scanner::REUSE_ETAG + \OC\Files\Cache\Scanner::REUSE_SIZE);
     $newData = $this->cache->get('');
     $this->assertSame($oldData['etag'], $newData['etag']);
     $this->assertEquals($oldData['size'], $newData['size']);
     $this->scanner->scan('', \OC\Files\Cache\Scanner::SCAN_SHALLOW, \OC\Files\Cache\Scanner::REUSE_ETAG + \OC\Files\Cache\Scanner::REUSE_SIZE);
     $newData = $this->cache->get('');
     $this->assertSame($oldData['etag'], $newData['etag']);
     $this->assertEquals($oldData['size'], $newData['size']);
 }
开发者ID:0x17de,项目名称:core,代码行数:34,代码来源:scanner.php

示例2: correctParentStorageMtime

 /**
  * update the storage_mtime of the direct parent in the cache to the mtime from the storage
  *
  * @param string $internalPath
  */
 private function correctParentStorageMtime($internalPath)
 {
     $parentId = $this->cache->getParentId($internalPath);
     $parent = dirname($internalPath);
     if ($parentId != -1) {
         $this->cache->update($parentId, array('storage_mtime' => $this->storage->filemtime($parent)));
     }
 }
开发者ID:farukuzun,项目名称:core-1,代码行数:13,代码来源:updater.php

示例3: getData

 /**
  * get all the metadata of a file or folder
  * *
  *
  * @param string $path
  * @return array with metadata of the file
  */
 public function getData($path)
 {
     if (!$this->storage->isReadable($path)) {
         //cant read, nothing we can do
         \OCP\Util::writeLog('OC\\Files\\Cache\\Scanner', "!!! Path '{$path}' is not readable !!!", \OCP\Util::DEBUG);
         return null;
     }
     $data = array();
     $data['mimetype'] = $this->storage->getMimeType($path);
     $data['mtime'] = $this->storage->filemtime($path);
     if ($data['mimetype'] == 'httpd/unix-directory') {
         $data['size'] = -1;
         //unknown
     } else {
         $data['size'] = $this->storage->filesize($path);
     }
     $data['etag'] = $this->storage->getETag($path);
     $data['storage_mtime'] = $data['mtime'];
     return $data;
 }
开发者ID:omusico,项目名称:isle-web-framework,代码行数:27,代码来源:scanner.php

示例4: getData

 /**
  * get all the metadata of a file or folder
  * *
  *
  * @param string $path
  * @return array an array of metadata of the file
  */
 public function getData($path)
 {
     $permissions = $this->storage->getPermissions($path);
     if (!$permissions & \OCP\PERMISSION_READ) {
         //cant read, nothing we can do
         \OCP\Util::writeLog('OC\\Files\\Cache\\Scanner', "!!! Path '{$path}' is not accessible or present !!!", \OCP\Util::DEBUG);
         return null;
     }
     $data = array();
     $data['mimetype'] = $this->storage->getMimeType($path);
     $data['mtime'] = $this->storage->filemtime($path);
     if ($data['mimetype'] == 'httpd/unix-directory') {
         $data['size'] = -1;
         //unknown
     } else {
         $data['size'] = $this->storage->filesize($path);
     }
     $data['etag'] = $this->storage->getETag($path);
     $data['storage_mtime'] = $data['mtime'];
     $data['permissions'] = $permissions;
     return $data;
 }
开发者ID:heldernl,项目名称:owncloud8-extended,代码行数:29,代码来源:scanner.php

示例5: filemtime

 /**
  * see http://php.net/manual/en/function.filemtime.php
  *
  * @param string $path
  * @return int
  */
 public function filemtime($path)
 {
     return $this->storage->filemtime($path);
 }
开发者ID:GitHubUser4234,项目名称:core,代码行数:10,代码来源:Wrapper.php

示例6: correctParentStorageMtime

 /**
  * update the storage_mtime of the parent
  *
  * @param \OC\Files\Storage\Storage $storage
  * @param string $internalPath
  */
 private static function correctParentStorageMtime($storage, $internalPath)
 {
     $cache = $storage->getCache();
     $parentId = $cache->getParentId($internalPath);
     $parent = dirname($internalPath);
     if ($parentId != -1) {
         $cache->update($parentId, array('storage_mtime' => $storage->filemtime($parent)));
     }
 }
开发者ID:olucao,项目名称:owncloud-core,代码行数:15,代码来源:updater.php


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