View Source

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[{zone-template-instance:ZFPROP:Proposal Zone Template}
{zone-data:component-name}
Zend_Vfs
{zone-data}

{zone-data:proposer-list}
[~walter.tamboer]
{zone-data}

{zone-data:liaison}
{zone-data}

{zone-data:revision}
1.0 - 03 Jul 2011: Initial Draft.
{zone-data}

{zone-data:overview}
Zend_Vfs is the representation of a Virtual File System. It is virtual because it simulates a normal file system by using one of the many available adapters. An adapter is the communication layer between the Virtual File System and the storage device. The storage device can be the file system itself, a database, etc.
{zone-data}

{zone-data:references}
* http://en.wikipedia.org/wiki/Virtual_file_system
{zone-data}

{zone-data:requirements}
* This component *will* implement CRUD operations for directories.
* This component *will* implement CRUD operations for files.
{zone-data}

{zone-data:dependencies}
* SPL
* Zend_Date
* Zend_Db
{zone-data}

{zone-data:operation}
Some ideas for adapters are the following:
* FileSystem; This adapter will act on the underlying file system.
* Database; This adapter will store the files and directories in a database. This will probably work with Zend_Db
* FTP; This adapter can communicate with an FTP server.
{zone-data}

{zone-data:milestones}
* Milestone 1: Setup the proposal and consider feedback.
* Milestone 2: Write and finish component source code.
* Milestone 3: Write unit tests
* Milestone 4: Write documentation
{zone-data}

{zone-data:class-list}
* \Zend\Vfs\Directory
* \Zend\Vfs\DirectoryNotFoundException
* \Zend\Vfs\File
* \Zend\Vfs\FileNotFoundException
* \Zend\Vfs\Vfs
* \Zend\Vfs\Adapter\AbstractAdapter
* \Zend\Vfs\Adapter\FileSystem
{zone-data}

{zone-data:use-cases}
||UC-01||
{code}
<?php

// Create the virtual file system:
$vfs = new \Zend\Vfs\Vfs( array(
'adapter' => 'FileSystem',
'rootDirectory' => '/my/root/directory' // This setting is only needed because we're using a FileSystem adapter.
) );

// Create a directory in the root directory:
$directory = $vfs->createDirectory( 'Hello' );

// Now create a subdirectory:
$directory = $vfs->createDirectory( 'World', $directory );

{code}
{zone-data}

{zone-data:skeletons}

The code for this proposal can be found at [https://github.com/WalterTamboer/zf2/tree/master/library/Zend/Vfs]

{zone-data}

{zone-template-instance}]]></ac:plain-text-body></ac:macro>