Skip to content

Commit

Permalink
[mms] Add null VFS driver.
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Feb 7, 2014
1 parent c40a6c0 commit 3936ad2
Show file tree
Hide file tree
Showing 2 changed files with 116 additions and 2 deletions.
110 changes: 110 additions & 0 deletions framework/Vfs/lib/Horde/Vfs/Null.php
@@ -0,0 +1,110 @@
<?php
/**
* Copyright 2014 Horde LLC (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (LGPL). If you
* did not receive this file, see http://www.horde.org/licenses/lgpl21.
*
* @category Horde
* @copyright 2014 Horde LLC
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
* @package Vfs
*/

/**
* Null implementation of the VFS API.
*
* Copyright 2014 Horde LLC (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (LGPL). If you
* did not receive this file, see http://www.horde.org/licenses/lgpl21.
*
* @author Michael Slusarz <slusarz@horde.org>
* @category Horde
* @copyright 2014 Horde LLC
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
* @package Vfs
* @since 2.1.3
*/
class Horde_Vfs_Null extends Horde_Vfs_Base
{
/**
*/
public function size($path, $name)
{
return 0;
}

/**
*/
public function read($path, $name)
{
return '';
}

/**
*/
public function readFile($path, $name)
{
throw new Horde_Vfs_Exception('Unable to create temporary file.');
}

/**
*/
public function readByteRange($path, $name, &$offset, $length, &$remaining)
{
$remaining = 0;
return '';
}

/**
*/
public function write($path, $name, $tmpFile, $autocreate = false)
{
}

/**
*/
public function writeData($path, $name, $data, $autocreate = false)
{
}

/**
*/
public function deleteFile($path, $name)
{
}

/**
*/
public function rename($oldpath, $oldname, $newpath, $newname)
{
}

/**
*/
public function createFolder($path, $name)
{
}

/**
*/
public function deleteFolder($path, $name, $recursive = false)
{
}

/**
*/
protected function _listFolder($path, $filter = null, $dotfiles = true,
$dironly = false)
{
return array();
}

/**
*/
public function changePermissions($path, $name, $permission)
{
}

}
8 changes: 6 additions & 2 deletions framework/Vfs/package.xml
Expand Up @@ -27,7 +27,7 @@ Reading, writing and listing of files are all supported.</description>
<email>jan@horde.org</email>
<active>yes</active>
</lead>
<date>2014-01-22</date>
<date>2014-02-07</date>
<version>
<release>2.1.3</release>
<api>2.0.0</api>
Expand All @@ -38,6 +38,7 @@ Reading, writing and listing of files are all supported.</description>
</stability>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
* [mms] Add null VFS driver.
* [jan] Support Oracle with SQL driver.
</notes>
<contents>
Expand Down Expand Up @@ -67,6 +68,7 @@ Reading, writing and listing of files are all supported.</description>
<file name="Kolab.php" role="php" />
<file name="Mongo.php" role="php" />
<file name="Musql.php" role="php" />
<file name="Null.php" role="php" />
<file name="Smb.php" role="php" />
<file name="Sql.php" role="php" />
<file name="SqlFile.php" role="php" />
Expand Down Expand Up @@ -499,6 +501,7 @@ Reading, writing and listing of files are all supported.</description>
<install as="Horde/Vfs/Kolab.php" name="lib/Horde/Vfs/Kolab.php" />
<install as="Horde/Vfs/Mongo.php" name="lib/Horde/Vfs/Mongo.php" />
<install as="Horde/Vfs/Musql.php" name="lib/Horde/Vfs/Musql.php" />
<install as="Horde/Vfs/Null.php" name="lib/Horde/Vfs/Null.php" />
<install as="Horde/Vfs/Smb.php" name="lib/Horde/Vfs/Smb.php" />
<install as="Horde/Vfs/Sql.php" name="lib/Horde/Vfs/Sql.php" />
<install as="Horde/Vfs/SqlFile.php" name="lib/Horde/Vfs/SqlFile.php" />
Expand Down Expand Up @@ -1192,9 +1195,10 @@ Added a class for providing garbage collection; removed all Horde dependancies.
<stability>
<release>stable</release>
<api>stable</api></stability>
<date>2014-01-22</date>
<date>2014-02-07</date>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
* [mms] Add null VFS driver.
* [jan] Support Oracle with SQL driver.
</notes>
</release>
Expand Down

0 comments on commit 3936ad2

Please sign in to comment.