aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/repair/assetcache.php
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2016-01-07 09:14:35 +0100
committerMorris Jobke <hey@morrisjobke.de>2016-01-07 09:14:35 +0100
commit604897945b01a368893661c0455072c0b390f7e8 (patch)
treed7adcb3122ad799ad60fb8999841b4d5b024dfa4 /lib/private/repair/assetcache.php
parent470bf234c545ae5d0ad9c73834f8a596593791d6 (diff)
downloadnextcloud-server-604897945b01a368893661c0455072c0b390f7e8.tar.gz
nextcloud-server-604897945b01a368893661c0455072c0b390f7e8.zip
Move lib/repair to lib/private/repair
Diffstat (limited to 'lib/private/repair/assetcache.php')
-rw-r--r--lib/private/repair/assetcache.php45
1 files changed, 45 insertions, 0 deletions
diff --git a/lib/private/repair/assetcache.php b/lib/private/repair/assetcache.php
new file mode 100644
index 00000000000..c46aa63a3e4
--- /dev/null
+++ b/lib/private/repair/assetcache.php
@@ -0,0 +1,45 @@
+<?php
+/**
+ * @author Adam Williamson <awilliam@redhat.com>
+ * @author Morris Jobke <hey@morrisjobke.de>
+ * @author Thomas Müller <thomas.mueller@tmit.eu>
+ *
+ * @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/>
+ *
+ */
+
+namespace OC\Repair;
+
+use Doctrine\DBAL\Platforms\MySqlPlatform;
+use OC\Hooks\BasicEmitter;
+
+class AssetCache extends BasicEmitter implements \OC\RepairStep {
+
+ public function getName() {
+ return 'Clear asset cache after upgrade';
+ }
+
+ public function run() {
+ if (!\OC_Template::isAssetPipelineEnabled()) {
+ $this->emit('\OC\Repair', 'info', array('Asset pipeline disabled -> nothing to do'));
+ return;
+ }
+ $assetDir = \OC::$server->getConfig()->getSystemValue('assetdirectory', \OC::$SERVERROOT) . '/assets';
+ \OC_Helper::rmdirr($assetDir, false);
+ $this->emit('\OC\Repair', 'info', array('Asset cache cleared.'));
+ }
+}
+