Fix retrieving of cache and scanner in Updater class
This commit is contained in:
parent
d275725e23
commit
3ee3323b87
|
@ -30,10 +30,12 @@ class Updater {
|
||||||
* @var string $internalPath
|
* @var string $internalPath
|
||||||
*/
|
*/
|
||||||
list($storage, $internalPath) = self::resolvePath($path);
|
list($storage, $internalPath) = self::resolvePath($path);
|
||||||
$cache = new Cache($storage);
|
if ($storage) {
|
||||||
$scanner = new Scanner($storage);
|
$cache = $storage->getCache();
|
||||||
$scanner->scan($internalPath, Scanner::SCAN_SHALLOW);
|
$scanner = $storage->getScanner();
|
||||||
$cache->correctFolderSize($internalPath);
|
$scanner->scan($internalPath, Scanner::SCAN_SHALLOW);
|
||||||
|
$cache->correctFolderSize($internalPath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static public function deleteUpdate($path) {
|
static public function deleteUpdate($path) {
|
||||||
|
@ -42,9 +44,11 @@ class Updater {
|
||||||
* @var string $internalPath
|
* @var string $internalPath
|
||||||
*/
|
*/
|
||||||
list($storage, $internalPath) = self::resolvePath($path);
|
list($storage, $internalPath) = self::resolvePath($path);
|
||||||
$cache = new Cache($storage);
|
if ($storage) {
|
||||||
$cache->remove($internalPath);
|
$cache = $storage->getCache();
|
||||||
$cache->correctFolderSize($internalPath);
|
$cache->remove($internalPath);
|
||||||
|
$cache->correctFolderSize($internalPath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue