本文整理汇总了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;
}
示例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();
}
示例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);
}
示例4: filemtime
/**
* @deprecated OC_Filesystem is replaced by \OC\Files\Filesystem
*/
public static function filemtime($path)
{
return \OC\Files\Filesystem::filemtime($path);
}
示例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;
*/