diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/triggerupdate.php | 22 |
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"; +} |