stub out more of the Horde_Vfs structure, including ideas for file Uris, the db adapt...
authorChuck Hagenbuch <chuck@horde.org>
Thu, 26 Mar 2009 20:41:07 +0000 (16:41 -0400)
committerChuck Hagenbuch <chuck@horde.org>
Thu, 26 Mar 2009 20:41:07 +0000 (16:41 -0400)
framework/Vfs/app/controllers/DownloadController.php [new file with mode: 0644]
framework/Vfs/lib/Horde/Vfs/Adapter/Db/Base.php
framework/Vfs/lib/Horde/Vfs/Adapter/Db/Chunked.php
framework/Vfs/lib/Horde/Vfs/Adapter/Db/File.php
framework/Vfs/lib/Horde/Vfs/Adapter/Db/S3.php
framework/Vfs/lib/Horde/Vfs/Base.php
framework/Vfs/lib/Horde/Vfs/Directory.php
framework/Vfs/lib/Horde/Vfs/DirectoryIterator.php
framework/Vfs/lib/Horde/Vfs/File.php

diff --git a/framework/Vfs/app/controllers/DownloadController.php b/framework/Vfs/app/controllers/DownloadController.php
new file mode 100644 (file)
index 0000000..65b7ad5
--- /dev/null
@@ -0,0 +1,6 @@
+<?php
+/**
+ */
+class Horde_Vfs_DownloadController extends Horde_Controller_Base
+{
+}
index e69de29..8d76881 100644 (file)
@@ -0,0 +1,18 @@
+<?php
+/**
+ * @category Horde
+ * @package  Horde_Vfs
+ */
+
+/**
+ * This Db base class manages the horde_vfs_metadata table for the various Db
+ * backends (Chunked, File, S3). The metadata table holds the filesystem
+ * representation in the database, but actual file contents are not stored
+ * thre. A subclass is needed to provide actual file storage.
+ *
+ * @category Horde
+ * @package  Horde_Vfs
+ */
+abstract class Horde_Vfs_Adapter_Db_Base
+{
+}
index e69de29..e83d510 100644 (file)
@@ -0,0 +1,17 @@
+<?php
+/**
+ * @category Horde
+ * @package  Horde_Vfs
+ */
+
+/**
+ * A file-backed Vfs adapter that uses a database for the filesystem tree and
+ * metadata, and stores file contents in chunks in a separate blob table. Large
+ * files can be split between many chunks; small files just take one.
+ *
+ * @category Horde
+ * @package  Horde_Vfs
+ */
+class Horde_Vfs_Adapter_Db_Chunked extends Horde_Vfs_Adapter_Db_Base
+{
+}
index e69de29..ee3846d 100644 (file)
@@ -0,0 +1,17 @@
+<?php
+/**
+ * @category Horde
+ * @package  Horde_Vfs
+ */
+
+/**
+ * A file-backed Vfs adapter that uses a database for the filesystem tree and
+ * metadata, but stores content using the operating system's filesystem
+ * (probably local, but could be NFS or another distributed fs).
+ *
+ * @category Horde
+ * @package  Horde_Vfs
+ */
+class Horde_Vfs_Adapter_Db_File extends Horde_Vfs_Adapter_Db_Base
+{
+}
index e69de29..e81ac11 100644 (file)
@@ -0,0 +1,16 @@
+<?php
+/**
+ * @category Horde
+ * @package  Horde_Vfs
+ */
+
+/**
+ * A file-backed Vfs adapter that uses a database for the filesystem tree and
+ * metadata, and stores file contents on Amazon's S3.
+ *
+ * @category Horde
+ * @package  Horde_Vfs
+ */
+class Horde_Vfs_Adapter_Db_S3 extends Horde_Vfs_Adapter_Db_Base
+{
+}
index e69de29..918d437 100644 (file)
@@ -0,0 +1,13 @@
+<?php
+/**
+ * @category Horde
+ * @package  Horde_Vfs
+ */
+
+/**
+ * @category Horde
+ * @package  Horde_Vfs
+ */
+class Horde_Vfs_Base
+{
+}
index e69de29..b4e01fe 100644 (file)
@@ -0,0 +1,21 @@
+<?php
+/**
+ * @category Horde
+ * @package  Horde_Vfs
+ */
+
+/**
+ * @category Horde
+ * @package  Horde_Vfs
+ */
+class Horde_Vfs_Directory implements IteratorAggregate
+{
+    /**
+     * @return Horde_Vfs_DirectoryIterator
+     */
+    public function getIterator()
+    {
+        return new Horde_Vfs_DirectoryIterator($this);
+    }
+
+}
index e69de29..b809712 100644 (file)
@@ -0,0 +1,13 @@
+<?php
+/**
+ * @category Horde
+ * @package  Horde_Vfs
+ */
+
+/**
+ * @category Horde
+ * @package  Horde_Vfs
+ */
+class Horde_Vfs_DirectoryIterator implements Iterator
+{
+}
index e69de29..60cffdc 100644 (file)
@@ -0,0 +1,34 @@
+<?php
+/**
+ * @category Horde
+ * @package  Horde_Vfs
+ */
+
+/**
+ * @category Horde
+ * @package  Horde_Vfs
+ */
+class Horde_Vfs_File
+{
+    /**
+     * Return a URL that a file can be accessed from. For example, an S3 URL, or
+     * a local file with vfs-direct and filesystem backends, or a passthrough
+     * script using the DownloadController.
+     *
+     * @return string
+     */
+    public function getUri()
+    {
+    }
+
+    /**
+     * Return a UUID for this file.
+     *
+     * @TODO useful? Could be used for indexing, for private URLs, for primary
+     * keys in Horde_Content, ...?
+     */
+    public function getUuid()
+    {
+    }
+
+}