本文整理汇总了PHP中Gaufrette\Filesystem::rename方法的典型用法代码示例。如果您正苦于以下问题:PHP Filesystem::rename方法的具体用法?PHP Filesystem::rename怎么用?PHP Filesystem::rename使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gaufrette\Filesystem
的用法示例。
在下文中一共展示了Filesystem::rename方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doMove
private function doMove(Institution $institution, Media $media, $sizes)
{
// point file system to new path
$this->fileSystem->rename($institution->getId() . '/' . $media->getName(), $media->getName());
// do resize
$this->institutionMediaService->resize($media, $sizes);
}
示例2: rename
/**
* Rename a file
*
* TODO: Potentially fix https://github.com/KnpLabs/Gaufrette/issues/374 here.
*
* @param string $source_key
* @param string $target_key
*
* @return $this
*/
public function rename($source_key, $target_key)
{
$this->filesystem->rename($source_key, $target_key);
$metadata = null;
if ($this->tagExists($source_key)) {
$metadata = $this->getMetadata($source_key);
$this->untag($source_key);
}
$this->tag($target_key, $metadata);
return $this;
}
示例3: shouldRenameFile
/**
* @test
* @group functional
*/
public function shouldRenameFile()
{
$this->filesystem->write('foo', 'Some content');
$this->filesystem->rename('foo', 'boo');
$this->assertFalse($this->filesystem->has('foo'));
$this->assertEquals('Some content', $this->filesystem->read('boo'));
$this->filesystem->delete('boo');
$this->filesystem->write('foo', 'Some content');
$this->filesystem->rename('foo', 'somedir/sub/boo');
$this->assertFalse($this->filesystem->has('somedir/sub/foo'));
$this->assertEquals('Some content', $this->filesystem->read('somedir/sub/boo'));
$this->filesystem->delete('somedir/sub/boo');
}
示例4: iRename
/**
* @When I rename :source to :dest
*/
public function iRename($source, $dest)
{
$this->filesystem->rename($source, $dest);
}