Merge pull request #22998 from owncloud/delay-loading-the-scanner

Delay check till scanner is used
This commit is contained in:
Thomas Müller 2016-03-15 12:16:02 +01:00
commit d4a8d5d2ea
2 changed files with 5 additions and 5 deletions

View File

@ -36,6 +36,10 @@ class Scanner extends \OC\Files\Cache\Scanner {
/** {@inheritDoc} */
public function scan($path, $recursive = self::SCAN_RECURSIVE, $reuse = -1, $lock = true) {
if(!$this->storage->remoteIsOwnCloud()) {
return parent::scan($path, $recursive, $recursive, $lock);
}
$this->scanAll();
}
@ -90,7 +94,6 @@ class Scanner extends \OC\Files\Cache\Scanner {
}
if ($data['status'] === 'success') {
$this->addResult($data['data'], '');
} elseif ($data['status'] === 'unsupported') {
} else {
throw new \Exception(
'Error while scanning remote share: "' .

View File

@ -136,9 +136,6 @@ class Storage extends DAV implements ISharedStorage {
if (!$storage) {
$storage = $this;
}
if(!$this->remoteIsOwnCloud()) {
return parent::getScanner($path, $storage);
}
if (!isset($this->scanner)) {
$this->scanner = new Scanner($storage);
}
@ -266,7 +263,7 @@ class Storage extends DAV implements ISharedStorage {
*
* @return bool
*/
private function remoteIsOwnCloud() {
public function remoteIsOwnCloud() {
if(defined('PHPUNIT_RUN') || !$this->testRemoteUrl($this->getRemote() . '/status.php')) {
return false;
}