當前位置: 首頁>>代碼示例>>PHP>>正文


PHP vfsStream::copyFromFileSystem方法代碼示例

本文整理匯總了PHP中vfsStream::copyFromFileSystem方法的典型用法代碼示例。如果您正苦於以下問題:PHP vfsStream::copyFromFileSystem方法的具體用法?PHP vfsStream::copyFromFileSystem怎麽用?PHP vfsStream::copyFromFileSystem使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在vfsStream的用法示例。


在下文中一共展示了vfsStream::copyFromFileSystem方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: copyFromPreservesFilePermissions

 /**
  * @test
  * @group  issue_4
  * @group  issue_29
  * @since  0.11.2
  */
 public function copyFromPreservesFilePermissions()
 {
     if (DIRECTORY_SEPARATOR !== '/') {
         $this->markTestSkipped('Only applicable on Linux style systems.');
     }
     $copyDir = $this->getFileSystemCopyDir();
     $root = vfsStream::setup();
     $this->assertEquals($root, vfsStream::copyFromFileSystem($copyDir, null));
     $this->assertEquals(fileperms($copyDir . '/withSubfolders') - vfsStreamContent::TYPE_DIR, $root->getChild('withSubfolders')->getPermissions());
     $this->assertEquals(fileperms($copyDir . '/withSubfolders/aFile.txt') - vfsStreamContent::TYPE_FILE, $root->getChild('withSubfolders/aFile.txt')->getPermissions());
 }
開發者ID:1000k,項目名稱:whattoplaynext,代碼行數:17,代碼來源:vfsStreamTestCase.php

示例2: copyFromFileSystemMocksLargeFiles

 /**
  * To test this the max file size is reduced to something reproduceable.
  *
  * @test
  * @group  issue_91
  * @since  1.5.0
  */
 public function copyFromFileSystemMocksLargeFiles()
 {
     if (DIRECTORY_SEPARATOR !== '/') {
         $this->markTestSkipped('Only applicable on Linux style systems.');
     }
     $copyDir = $this->getFileSystemCopyDir();
     $root = vfsStream::setup();
     vfsStream::copyFromFileSystem($copyDir, $root, 3);
     $this->assertEquals('      ', $root->getChild('withSubfolders/subfolder1/file1.txt')->getContent());
 }
開發者ID:kdambekalns,項目名稱:vfsStream,代碼行數:17,代碼來源:vfsStreamTestCase.php


注:本文中的vfsStream::copyFromFileSystem方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。