本文整理汇总了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');
}
示例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');
}
示例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'));
}
示例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'));
}
示例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')];
}
示例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);
}
示例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)));
}
}
示例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);
}
示例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));
}
}
示例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();
}
示例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'));
}
示例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;
}
示例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);
}
示例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();
}
示例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);
}