本文整理匯總了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());
}