summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2013-06-23 17:49:38 +0200
committerRobin Appelman <icewind@owncloud.com>2013-06-23 17:49:38 +0200
commit909d279e55783a5a4499e94a8959fa1745687e42 (patch)
treebbb3649dfd4d613788158daebd614b603d8b458b /apps
parentaaecfa18edf7c690f06d0ce460bd3a7a98269845 (diff)
downloadnextcloud-server-909d279e55783a5a4499e94a8959fa1745687e42.tar.gz
nextcloud-server-909d279e55783a5a4499e94a8959fa1745687e42.zip
Add a CLI script for manually triggering checking a folder for updates
Diffstat (limited to 'apps')
-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";
+}