triggerupdate.php 565 B

1234567891011121314151617181920212223
  1. <?php
  2. require_once __DIR__ . '/../../lib/base.php';
  3. if (OC::$CLI) {
  4. if (count($argv) === 2) {
  5. $file = $argv[1];
  6. list(, $user) = explode('/', $file);
  7. OC_Util::setupFS($user);
  8. $view = new \OC\Files\View('');
  9. /**
  10. * @var \OC\Files\Storage\Storage $storage
  11. */
  12. list($storage, $internalPath) = $view->resolvePath($file);
  13. $watcher = $storage->getWatcher($internalPath);
  14. $watcher->checkUpdate($internalPath);
  15. } else {
  16. echo "Usage: php triggerupdate.php /path/to/file\n";
  17. }
  18. } else {
  19. echo "This script can be run from the command line only\n";
  20. }