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


PHP Filesystem::rename方法代码示例

本文整理汇总了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);
 }
开发者ID:TMBaay,项目名称:MEDTrip---Healthcareabroad,代码行数:7,代码来源:MigrateInstitutionImagesCommand.php

示例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;
 }
开发者ID:bravo3,项目名称:image-manager,代码行数:21,代码来源:ImageManager.php

示例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');
 }
开发者ID:course-hero,项目名称:gaufrette-extras,代码行数:17,代码来源:FunctionalTestCase.php

示例4: iRename

 /**
  * @When I rename :source to :dest
  */
 public function iRename($source, $dest)
 {
     $this->filesystem->rename($source, $dest);
 }
开发者ID:akovalyov,项目名称:gaufrette-integration-tests,代码行数:7,代码来源:FeatureContext.php


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