summaryrefslogtreecommitdiffstats
path: root/apps/files_versions/appinfo
diff options
context:
space:
mode:
authorVictor Dubiniuk <victor.dubiniuk@gmail.com>2015-08-31 23:52:00 +0300
committerVictor Dubiniuk <victor.dubiniuk@gmail.com>2015-09-15 21:12:39 +0300
commit0cefbd76b9369135075fda8c210dfa9ff88a264c (patch)
tree19146eb14532078899567c12bfa78649c6da909e /apps/files_versions/appinfo
parent230029e5090b3deecb941e75bbc34a6bcb98c374 (diff)
downloadnextcloud-server-0cefbd76b9369135075fda8c210dfa9ff88a264c.tar.gz
nextcloud-server-0cefbd76b9369135075fda8c210dfa9ff88a264c.zip
Add expiration for versions older than max
Diffstat (limited to 'apps/files_versions/appinfo')
-rw-r--r--apps/files_versions/appinfo/app.php8
-rw-r--r--apps/files_versions/appinfo/install.php23
-rw-r--r--apps/files_versions/appinfo/update.php3
3 files changed, 33 insertions, 1 deletions
diff --git a/apps/files_versions/appinfo/app.php b/apps/files_versions/appinfo/app.php
index 967f2e73a34..218d5351152 100644
--- a/apps/files_versions/appinfo/app.php
+++ b/apps/files_versions/appinfo/app.php
@@ -19,6 +19,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
-OCP\Util::addStyle('files_versions', 'versions');
+
+namespace OCA\Files_Versions\AppInfo;
+
+$app = new Application();
+$container = $app->getContainer();
+
+\OCP\Util::addStyle('files_versions', 'versions');
\OCA\Files_Versions\Hooks::connectHooks();
diff --git a/apps/files_versions/appinfo/install.php b/apps/files_versions/appinfo/install.php
new file mode 100644
index 00000000000..d72ba2f56e5
--- /dev/null
+++ b/apps/files_versions/appinfo/install.php
@@ -0,0 +1,23 @@
+<?php
+/**
+ * @author Victor Dubiniuk <dubiniuk@owncloud.com>
+ *
+ * @copyright Copyright (c) 2015, ownCloud, Inc.
+ * @license AGPL-3.0
+ *
+ * This code is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License, version 3,
+ * along with this program. If not, see <http://www.gnu.org/licenses/>
+ *
+ */
+
+// Cron job for deleting expired trash items
+\OC::$server->getJobList()->add('OCA\Files_Versions\BackgroundJob\ExpireVersions');
diff --git a/apps/files_versions/appinfo/update.php b/apps/files_versions/appinfo/update.php
index 524f9bd153f..687e5d3b5d4 100644
--- a/apps/files_versions/appinfo/update.php
+++ b/apps/files_versions/appinfo/update.php
@@ -24,3 +24,6 @@ $installedVersion=OCP\Config::getAppValue('files_versions', 'installed_version')
if (version_compare($installedVersion, '1.0.4', '<')) {
\OC_DB::dropTable("files_versions");
}
+
+// Cron job for deleting expired trash items
+\OC::$server->getJobList()->add('OCA\Files_Versions\BackgroundJob\ExpireVersions');