You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mikey179 edited this page Jul 21, 2011
·
6 revisions
Create complex directory structures
Since version 0.10.0 one can create complex directory structures quite easily: $root = vfsStream::create($structure); Assumed $structure contains an array like this:
array('Core' = array('AbstractFactory' => array('test.php' => 'some text content',
'other.php' => 'Some more text content',
'Invalid.csv' => 'Something else',
),
'AnEmptyFolder' => array(),
'badlocation.php' => 'some bad content',
)
)
Arrays will become directories with their key as directory name, and strings becomes files with their key as file name and their value as file content.
If you need to modify other file or directory properties (especially permissions) please resort to the default API, this method is meant to create large structures more easily.