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


PHP vfsStream::copyFromFileSystem方法代码示例

本文整理汇总了PHP中org\bovigo\vfs\vfsStream::copyFromFileSystem方法的典型用法代码示例。如果您正苦于以下问题:PHP vfsStream::copyFromFileSystem方法的具体用法?PHP vfsStream::copyFromFileSystem怎么用?PHP vfsStream::copyFromFileSystem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org\bovigo\vfs\vfsStream的用法示例。


在下文中一共展示了vfsStream::copyFromFileSystem方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setUp

 /**
  * Set up for each test
  */
 public function setUp()
 {
     // setup
     $this->root = vfsStream::setup('assets');
     // Copy directory structure from file system
     vfsStream::copyFromFileSystem(__DIR__ . '/assets');
 }
开发者ID:nckg,项目名称:imageme,代码行数:10,代码来源:TestCase.php

示例2: getImageFolder

 function getImageFolder()
 {
     $this->vfsRoot = vfsStream::setup('root');
     mkdir(vfsStream::url('root') . '/images');
     vfsStream::copyFromFileSystem(__DIR__ . '/Fixtures/source', $this->vfsRoot->getChild('images'));
     return vfsStream::url('root');
 }
开发者ID:asins,项目名称:imagecache,代码行数:7,代码来源:autoload.php

示例3: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->root = vfsStream::setup('root', null, array('DependencyInjection'));
     vfsStream::copyFromFileSystem(__DIR__ . '/../../../../Resources/skeleton', $this->root);
     $this->extensionGenerator = new ExtensionGenerator(vfsStream::url('root/app-theme'));
 }
开发者ID:iicc,项目名称:RedKiteCmsBundle,代码行数:7,代码来源:ExtensionGeneratorTest.php

示例4: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->root = vfsStream::setup('root', null, array('template', 'Slots' => array(), 'app' => array('Resources' => array('views' => array('MyThemeBundle' => array())))));
     vfsStream::copyFromFileSystem(__DIR__ . '/../../../../Resources/skeleton', $this->root);
     $this->templateGenerator = new TemplateGenerator(vfsStream::url('root/app-theme'));
 }
开发者ID:iicc,项目名称:RedKiteCmsBundle,代码行数:7,代码来源:TemplateGeneratorTest.php

示例5: setUp

 public function setUp()
 {
     vfsStreamWrapper::register();
     $root = new vfsStreamDirectory('root');
     vfsStreamWrapper::setRoot($root);
     vfsStream::copyFromFileSystem(__DIR__ . '/../package');
     $this->config = ['version' => '1.0.4', 'configFile' => vfsStream::url('root/app/code/community/Slovenian/LocalePackSl/etc/config.xml'), 'packageFile' => vfsStream::url('root/package.xml')];
 }
开发者ID:symfony-si,项目名称:magento1-sl-si,代码行数:8,代码来源:PackageTest.php

示例6: testPermissionDeniedWhenSaveComposerFile

 /**
  * @dataProvider invalidFilesWithoutPermissionProvider
  */
 public function testPermissionDeniedWhenSaveComposerFile($expected, $baseStructure, $projectRoot, $fromDir)
 {
     $this->setExpectedExceptionRegExp('Release\\IO\\Exception\\IOException', $expected);
     vfsStream::copyFromFileSystem($baseStructure);
     $fullPath = sprintf('%s/%s/%s', $this->root->getName(), $projectRoot, $fromDir);
     $composerIO = new ComposerIO(vfsStream::url($fullPath));
     $composerIO->save($expected);
 }
开发者ID:luiscoms,项目名称:release,代码行数:11,代码来源:ComposerIOTest.php

示例7: setUp

 public function setUp()
 {
     if (!self::$secureupload_obj) {
         self::$fs = vfsStream::setup('temporary', null, array('uploads' => array()));
         vfsStream::copyFromFileSystem(dirname(__FILE__) . '/__test_files');
         $secure_upload_config = new SecureUPloadConfig(array('upload_folder' => vfsStream::url('temporary/uploads') . '/'));
         self::$secureupload_obj = new SecureUPload($secure_upload_config);
         $_FILES = array('single_upload' => array('name' => 'logo.png', 'type' => 'image/png', 'tmp_name' => vfsStream::url('temporary/logo.png'), 'error' => 0, 'size' => 4535), 'multiple_upload' => array('name' => array('logo.png', 'logo-second.png'), 'type' => array('image/png', 'image/png'), 'tmp_name' => array(vfsStream::url('temporary/logo.png'), vfsStream::url('temporary/logo-second.png')), 'error' => array(0, 0), 'size' => array(4535, 4535)));
     }
 }
开发者ID:alirdn,项目名称:secureupload,代码行数:10,代码来源:SecureUPloadTest.php

示例8: importDefaultTheme

 protected function importDefaultTheme()
 {
     $baseThemeDir = __DIR__ . '/../../../../../../../../../src/RedKiteLabs/BootbusinessThemeBundle/Resources/views/Theme';
     if (!is_dir($baseThemeDir)) {
         $baseThemeDir = __DIR__ . '/../../../../../vendor/redkite-labs/bootbusiness-theme-bundle/RedKiteLabs/BootbusinessThemeBundle/Resources/views/Theme';
         if (!is_dir($baseThemeDir)) {
             $this->markTestSkipped('BusinessWebsiteThemeBundle is not available.');
         }
     }
     vfsStream::copyFromFileSystem($baseThemeDir, $this->root);
 }
开发者ID:iicc,项目名称:RedKiteCmsBundle,代码行数:11,代码来源:GeneratorBase.php

示例9: setUp

 public function setUp()
 {
     if (!self::$fs) {
         self::$fs = vfsStream::setup('temporary');
         vfsStream::copyFromFileSystem(dirname(dirname(__FILE__)) . '/__test_files');
         self::$upload_validator_obj = new UploadValidator();
         self::$upload_not_uploaded_by_http_post = new Upload(array('name' => 'foo.bar', 'type' => 'foo/bar', 'tmp_name' => vfsStream::url('temporary/foo.bar'), 'error' => 0, 'size' => 0));
         self::$upload_forbidden_extension = new Upload(array('name' => 'forbidden.php', 'type' => 'text/php', 'tmp_name' => vfsStream::url('temporary/forbidden.php'), 'error' => 0, 'size' => 0));
         self::$upload_logo_object = new Upload(array('name' => 'logo.png', 'type' => 'image/png', 'tmp_name' => vfsStream::url('temporary/logo.png'), 'error' => 0, 'size' => 4535));
         self::$upload_mime_type_object = new Upload(array('name' => 'mime-type.jpg', 'type' => 'image/jpeg', 'tmp_name' => vfsStream::url('temporary/mime-type.jpg'), 'error' => 0, 'size' => 4));
     }
 }
开发者ID:alirdn,项目名称:secureupload,代码行数:12,代码来源:UploadValidatorTest.php

示例10: setUp

 protected function setUp()
 {
     // Setup a virtual file system under thelia:// stream
     $this->stream = vfsStream::setup("thelia", 0777);
     // Copy the module fixtures
     vfsStream::copyFromFileSystem(__DIR__ . DS . str_replace("/", DS, static::TEST_MODULE_PATH), $this->stream);
     // Initialize the kernel
     $this->kernel = new Thelia("test", true);
     $this->kernel->boot();
     // Then create event
     $this->event = new ModuleGenerateEvent("TheliaStudioTestModule");
     $this->buildEvent();
 }
开发者ID:Alban-io,项目名称:TheliaStudio,代码行数:13,代码来源:GeneratorTestCase.php

示例11: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->root = vfsStream::setup('root', null, array('slots', 'Slots' => array(), 'app' => array('Resources' => array('views' => array('MyThemeBundle' => array())))));
     $skeletonDir = __DIR__ . '/../../../../Resources/skeleton';
     if (!is_dir($skeletonDir)) {
         $skeletonDir = __DIR__ . '/Resources/skeleton';
         if (!is_dir($skeletonDir)) {
             $this->markTestSkipped('skeleton dir is not available.');
         }
     }
     vfsStream::copyFromFileSystem($skeletonDir, $this->root);
     $this->slotsGenerator = new SlotsGenerator(vfsStream::url('root/app-theme'));
 }
开发者ID:iicc,项目名称:RedKiteCmsBundle,代码行数:14,代码来源:SlotsGeneratorTest.php

示例12: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->fileSystem = new Filesystem();
     $this->root = vfsStream::setup('root', null, array('src', 'bundle' => array()));
     $sensioDir = __DIR__ . '/../../../../../../../../../vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle';
     if (!is_dir($sensioDir)) {
         $sensioDir = __DIR__ . '/../../../../../vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle';
         if (!is_dir($sensioDir)) {
             $this->markTestSkipped('Sension Generator bundle is not available.');
         }
     }
     vfsStream::copyFromFileSystem($sensioDir, $this->root->getChild('bundle'));
     //print_r(vfsStream::inspect(new \org\bovigo\vfs\visitor\vfsStreamStructureVisitor())->getStructure());exit;
 }
开发者ID:iicc,项目名称:RedKiteCmsBundle,代码行数:15,代码来源:AppGeneratorBase.php

示例13: prepareVfs

 private function prepareVfs()
 {
     //virtual file system for tests
     vfsStreamWrapper::register();
     $root = vfsStreamWrapper::setRoot(new vfsStreamDirectory("data"));
     //        $structure = [
     //            'dir1' => [
     //                'file1' => 'some text content',
     //            ],
     //            'dir2' => [
     //                'file2' => 'some text content',
     //            ],
     //        ];
     //
     //        vfsStream::create($structure, $root);
     vfsStream::copyFromFileSystem($this->testDataPath, $root);
 }
开发者ID:seyfer,项目名称:ZendMover,代码行数:17,代码来源:MoverTest.php

示例14: pathsAreOverlaidAndFinalDirectoryStructureCanBeQueried

 /**
  * @test
  */
 public function pathsAreOverlaidAndFinalDirectoryStructureCanBeQueried()
 {
     $root = vfsStream::setup('root');
     $subfolder = vfsStream::newDirectory('fileadmin');
     $root->addChild($subfolder);
     // Load fixture files and folders from disk
     vfsStream::copyFromFileSystem(__DIR__ . '/TypoScript/Fixtures', $subfolder, 1024 * 1024);
     FileStreamWrapper::init(PATH_site);
     FileStreamWrapper::registerOverlayPath('fileadmin', 'vfs://root/fileadmin', FALSE);
     // Use file functions as normal
     mkdir(PATH_site . 'fileadmin/test/');
     $file = PATH_site . 'fileadmin/test/Foo.bar';
     file_put_contents($file, 'Baz');
     $content = file_get_contents($file);
     $this->assertSame('Baz', $content);
     $expectedFileSystem = array('root' => array('fileadmin' => array('ext_typoscript_setup.txt' => 'test.Core.TypoScript = 1', 'test' => array('Foo.bar' => 'Baz'))));
     $this->assertEquals($expectedFileSystem, vfsStream::inspect(new vfsStreamStructureVisitor())->getStructure());
     FileStreamWrapper::destroy();
 }
开发者ID:plan2net,项目名称:TYPO3.CMS,代码行数:22,代码来源:FileStreamWrapperTest.php

示例15: setUp

 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     $this->dir = vfsStream::setup();
     vfsStream::copyFromFileSystem(__DIR__ . '/../fixtures/images', $this->dir);
     $dir = $this->dir;
     $image = $this->getMock('\\Imagine\\Image\\ImageInterface');
     $image->expects($this->any())->method('save')->will($this->returnCallback(function ($destFile) use($dir) {
         $temp = vfsStream::newFile(basename($destFile));
         $dir->addChild($temp);
         return TRUE;
     }));
     $imagine = $this->getMock('\\Imagine\\Image\\ImagineInterface');
     $imagine->expects($this->any())->method('open')->will($this->returnValue($image));
     $this->media = $this->getMock('\\Oryzone\\MediaStorage\\Model\\MediaInterface');
     $this->media->expects($this->any())->method('getContext')->will($this->returnValue('default'));
     $this->media->expects($this->any())->method('getName')->will($this->returnValue('sample'));
     $this->variant = $this->getMock('\\Oryzone\\MediaStorage\\Variant\\VariantInterface');
     $this->variant->expects($this->any())->method('getName')->will($this->returnValue('default'));
     $this->variant->expects($this->any())->method('getOptions')->will($this->returnValue(array('width' => 50, 'height' => 30, 'resize' => 'stretch')));
     $this->variant->expects($this->any())->method('getMetaValue')->will($this->returnValueMap(array(array('width', NULL, 50), array('height', NULL, 30))));
     $this->provider = new ImageProvider(vfsStream::url($this->dir->getName()) . '/', $imagine);
 }
开发者ID:jmcclell,项目名称:OryzoneMediaStorage,代码行数:26,代码来源:ImageProviderTest.php


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