Project

General

Profile

Actions

Feature #57477

closed

Introduce a stream wrapper to overlay file paths

Added by Philipp Gampe over 10 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Tests
Target version:
-
Start date:
2014-04-01
Due date:
% Done:

100%

Estimated time:
PHP Version:
5.5
Tags:
Complexity:
medium
Sprint Focus:
Actions #1

Updated by Philipp Gampe over 10 years ago

Add use statements

use org\bovigo\vfs\vfsStream;
use org\bovigo\vfs\visitor\vfsStreamStructureVisitor;
use TYPO3\CMS\Core\Tests\FileStreamWrapper;

Usage in test

        $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);

        // Initialize the wrapper with a common root path
        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();

Actions #2

Updated by Gerrit Code Review over 10 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/29011

Actions #3

Updated by Gerrit Code Review over 10 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/29011

Actions #4

Updated by Gerrit Code Review over 10 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/29011

Actions #5

Updated by Gerrit Code Review over 10 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/29011

Actions #6

Updated by Gerrit Code Review over 10 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/29011

Actions #7

Updated by Gerrit Code Review over 10 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/29011

Actions #8

Updated by Philipp Gampe over 10 years ago

symlink() and friends to do not work because PHP does not use stream wrappers for them: https://bugs.php.net/bug.php?id=42929

Actions #9

Updated by Gerrit Code Review about 10 years ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/29011

Actions #10

Updated by Gerrit Code Review about 10 years ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/29011

Actions #11

Updated by Anja Leichsenring almost 10 years ago

  • Sprint Focus set to On Location Sprint
Actions #12

Updated by Gerrit Code Review almost 10 years ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/29011

Actions #13

Updated by Philipp Gampe almost 10 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #14

Updated by Anja Leichsenring almost 9 years ago

  • Sprint Focus deleted (On Location Sprint)
Actions #15

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF