summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-06-24 05:49:01 -0700
committerThomas Müller <thomas.mueller@tmit.eu>2013-06-24 05:49:01 -0700
commitbca2eb39fa1950a72e159dd6cc44598c387a927a (patch)
tree18598249bed9b6e3eaa2fee947ef86903ac43166
parent993a1f1976ccbf7e1655659840b11fa3da2797db (diff)
parent909d279e55783a5a4499e94a8959fa1745687e42 (diff)
downloadnextcloud-server-bca2eb39fa1950a72e159dd6cc44598c387a927a.tar.gz
nextcloud-server-bca2eb39fa1950a72e159dd6cc44598c387a927a.zip
Merge pull request #3818 from owncloud/update-trigger-cli
Add a CLI script for manually triggering checking a folder for updates
-rw-r--r--apps/files/triggerupdate.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/apps/files/triggerupdate.php b/apps/files/triggerupdate.php
new file mode 100644
index 00000000000..0e29edbba35
--- /dev/null
+++ b/apps/files/triggerupdate.php
@@ -0,0 +1,22 @@
+<?php
+
+require_once __DIR__ . '/../../lib/base.php';
+
+if (OC::$CLI) {
+ if (count($argv) === 2) {
+ $file = $argv[1];
+ list(, $user) = explode('/', $file);
+ OC_Util::setupFS($user);
+ $view = new \OC\Files\View('');
+ /**
+ * @var \OC\Files\Storage\Storage $storage
+ */
+ list($storage, $internalPath) = $view->resolvePath($file);
+ $watcher = $storage->getWatcher($internalPath);
+ $watcher->checkUpdate($internalPath);
+ } else {
+ echo "Usage: php triggerupdate.php /path/to/file\n";
+ }
+} else {
+ echo "This script can be run from the command line only\n";
+}