View Source

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



1.0 - 03 Jul 2011: Initial Draft.

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.


* This component *will* implement CRUD operations for directories.
* This component *will* implement CRUD operations for files.

* Zend_Date
* Zend_Db

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.

* 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

* \Zend\Vfs\Directory
* \Zend\Vfs\DirectoryNotFoundException
* \Zend\Vfs\File
* \Zend\Vfs\FileNotFoundException
* \Zend\Vfs\Vfs
* \Zend\Vfs\Adapter\AbstractAdapter
* \Zend\Vfs\Adapter\FileSystem


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



The code for this proposal can be found at []