本文整理汇总了PHP中vfsStream::path方法的典型用法代码示例。如果您正苦于以下问题:PHP vfsStream::path方法的具体用法?PHP vfsStream::path怎么用?PHP vfsStream::path使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vfsStream
的用法示例。
在下文中一共展示了vfsStream::path方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pathRemovesDoubleSlashes
/**
* double slashes should be replaced by single slash
*
* @author Gabriel Birke
* @test
*/
public function pathRemovesDoubleSlashes()
{
// Regular path
$this->assertEquals('my/path', vfsStream::path('vfs://my/path'));
// Path with double slashes
$this->assertEquals('my/path', vfsStream::path('vfs://my//path'));
}
示例2: url_stat
/**
* returns status of url
*
* @param string $path path of url to return status for
* @param int $flags flags set by the stream API
* @return array
*/
public function url_stat($path, $flags)
{
$content = $this->getContent($this->resolvePath(vfsStream::path($path)));
if (null === $content) {
if (($flags & STREAM_URL_STAT_QUIET) != STREAM_URL_STAT_QUIET) {
trigger_error(' No such file or directory: ' . $path, E_USER_WARNING);
}
return false;
}
$fileStat = array('dev' => 0, 'ino' => 0, 'mode' => $content->getType() | $content->getPermissions(), 'nlink' => 0, 'uid' => $content->getUser(), 'gid' => $content->getGroup(), 'rdev' => 0, 'size' => $content->size(), 'atime' => $content->fileatime(), 'mtime' => $content->filemtime(), 'ctime' => $content->filectime(), 'blksize' => -1, 'blocks' => -1);
return array_merge(array_values($fileStat), $fileStat);
}
示例3: pathIsUpdatedAfterMove
/**
* @test
* @group issue_34
* @since 1.2.0
*/
public function pathIsUpdatedAfterMove()
{
// move foo/bar/baz1 to foo/baz3
$baz3URL = vfsStream::url('foo/baz3');
$this->assertTrue(rename($this->baz1URL, $baz3URL));
$this->assertEquals(vfsStream::path($baz3URL), $this->baz1->path());
}