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


PHP Filesystem::filemtime方法代码示例

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


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

示例1: 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

示例2: testOwnerWritesToSingleFileShare

 public function testOwnerWritesToSingleFileShare()
 {
     $this->loginAsUser(self::TEST_FILES_SHARING_API_USER1);
     Filesystem::file_put_contents('/foo.txt', 'longer_bar');
     $t = (int) Filesystem::filemtime('/foo.txt') - 1;
     Filesystem::touch('/foo.txt', $t);
     $this->assertEtagsNotChanged([self::TEST_FILES_SHARING_API_USER4, self::TEST_FILES_SHARING_API_USER3]);
     $this->assertEtagsChanged([self::TEST_FILES_SHARING_API_USER1, self::TEST_FILES_SHARING_API_USER2]);
     $this->assertAllUnchanged();
 }
开发者ID:rchicoli,项目名称:owncloud-core,代码行数:10,代码来源:EtagPropagationTest.php

示例3: array

        \OC\Files\Filesystem::mkdir($dir);
        if (!\OC\Files\Filesystem::touch($dir . '/' . $file)) {
            OCP\JSON::error(array("data" => array("message" => "Error when creating new file!")));
            OCP\Util::writeLog('files_svgedit', "Failed to create file: " . $path, OC_Log::ERROR);
            exit;
        }
    }
    // file should be existing now
    $writable = \OC\Files\Filesystem::isUpdatable($path);
    if ($writable) {
        if ($b64encoded) {
            $b64prefix = 'data:' . $b64type . ';base64,';
            if (strpos($filecontents, $b64prefix) === 0) {
                $filecontents = base64_decode(substr($filecontents, strlen($b64prefix)));
            }
        }
        \OC\Files\Filesystem::file_put_contents($path, $filecontents);
        // Clear statcache
        clearstatcache();
        // Get new mtime
        $newmtime = \OC\Files\Filesystem::filemtime($path);
        OCP\JSON::success(array('data' => array('mtime' => $newmtime)));
    } else {
        // Not writable!
        OCP\JSON::error(array('data' => array('message' => 'Insufficient permissions')));
        OCP\Util::writeLog('files_svgedit', "User does not have permission to write to file: " . $path, OC_Log::ERROR);
    }
} else {
    OCP\JSON::error(array('data' => array('message' => 'File path or mtime not supplied')));
    OCP\Util::writeLog('files_svgedit', "Invalid path supplied:" . $path, OC_Log::ERROR);
}
开发者ID:DOM-Digital-Online-Media,项目名称:apps,代码行数:31,代码来源:save.php

示例4: filemtime

 /**
  * @deprecated OC_Filesystem is replaced by \OC\Files\Filesystem
  */
 public static function filemtime($path)
 {
     return \OC\Files\Filesystem::filemtime($path);
 }
开发者ID:omusico,项目名称:isle-web-framework,代码行数:7,代码来源:filesystem.php

示例5: header

            }
            break;
        case 'play':
            $ftype = \OC\Files\Filesystem::getMimeType($arguments['path']);
            if (substr($ftype, 0, 5) != 'audio' and $ftype != 'application/ogg') {
                echo 'Not an audio file';
                exit;
            }
            $songId = $collection->getSongByPath($arguments['path']);
            $collection->registerPlay($songId);
            header('Content-Type:' . $ftype);
            \OCP\Response::enableCaching(3600 * 24);
            // 24 hour
            header('Accept-Ranges: bytes');
            header('Content-Length: ' . \OC\Files\Filesystem::filesize($arguments['path']));
            $mtime = \OC\Files\Filesystem::filemtime($arguments['path']);
            \OCP\Response::setLastModifiedHeader($mtime);
            \OC\Files\Filesystem::readfile($arguments['path']);
            exit;
        case 'find_music':
            $scanner = new Scanner($collection);
            $music = $scanner->getMusic();
            \OCP\JSON::encodedPrint($music);
            exit;
    }
}
class ScanWatcher
{
    /**
     * @var \OC_EventSource $eventSource;
     */
开发者ID:CDN-Sparks,项目名称:owncloud,代码行数:31,代码来源:api.php


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