summaryrefslogtreecommitdiffstats
path: root/apps/files_versions/lib/hooks.php
diff options
context:
space:
mode:
authorSam Tuke <samtuke@owncloud.com>2012-07-03 17:42:51 +0100
committerSam Tuke <samtuke@owncloud.com>2012-07-03 17:42:51 +0100
commita775deaf22ee803ae2ff0dbe1068229d9c819232 (patch)
treef7a7f5ee4d57935710903ab649f53ee948108fad /apps/files_versions/lib/hooks.php
parentca2b1f78630257ff4a2beadb5e25d628e5195bb0 (diff)
downloadnextcloud-server-a775deaf22ee803ae2ff0dbe1068229d9c819232.tar.gz
nextcloud-server-a775deaf22ee803ae2ff0dbe1068229d9c819232.zip
Moved hooks and versions.php into new lib directory
Part-ported filesystem operations to OC_FilesystemView Refactored Storage class to depend on an OC_FsV object and have fewer static classes
Diffstat (limited to 'apps/files_versions/lib/hooks.php')
-rw-r--r--apps/files_versions/lib/hooks.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/apps/files_versions/lib/hooks.php b/apps/files_versions/lib/hooks.php
new file mode 100644
index 00000000000..8a746705329
--- /dev/null
+++ b/apps/files_versions/lib/hooks.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Copyright (c) 2012 Sam Tuke <samtuke@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+/**
+ * This class contains all hooks.
+ */
+
+namespace OCA_Versions;
+
+class Hooks {
+
+ /**
+ * listen to write event.
+ */
+ public static function write_hook( $params ) {
+
+ if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
+
+ $versions = new Storage( new \OC_FilesystemView('') );
+
+ $path = $params[\OC_Filesystem::signal_param_path];
+
+ if($path<>'') $versions->store( $path );
+
+ }
+ }
+
+}
+
+?>