Feature #57477
closedIntroduce a stream wrapper to overlay file paths
100%
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();
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
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
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
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
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
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
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
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
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
Updated by Anja Leichsenring almost 10 years ago
- Sprint Focus set to On Location Sprint
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
Updated by Philipp Gampe almost 10 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset feddcb7043762f17dcbc14e006d95f2e1e02169a.
Updated by Anja Leichsenring almost 9 years ago
- Sprint Focus deleted (
On Location Sprint)