當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。