aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Files')
-rw-r--r--lib/private/Files/Cache/Scanner.php2
-rw-r--r--lib/private/Files/Cache/Wrapper/CacheJail.php15
-rw-r--r--lib/private/Files/ObjectStore/Swift.php2
-rw-r--r--lib/private/Files/Stream/Encryption.php2
-rw-r--r--lib/private/Files/Utils/Scanner.php5
5 files changed, 19 insertions, 7 deletions
diff --git a/lib/private/Files/Cache/Scanner.php b/lib/private/Files/Cache/Scanner.php
index 22d82a36c4d..8f5f09319dd 100644
--- a/lib/private/Files/Cache/Scanner.php
+++ b/lib/private/Files/Cache/Scanner.php
@@ -110,7 +110,7 @@ class Scanner extends BasicEmitter implements IScanner {
protected function getData($path) {
$data = $this->storage->getMetaData($path);
if (is_null($data)) {
- \OCP\Util::writeLog('OC\Files\Cache\Scanner', "!!! Path '$path' is not accessible or present !!!", \OCP\Util::DEBUG);
+ \OCP\Util::writeLog(Scanner::class, "!!! Path '$path' is not accessible or present !!!", \OCP\Util::DEBUG);
}
return $data;
}
diff --git a/lib/private/Files/Cache/Wrapper/CacheJail.php b/lib/private/Files/Cache/Wrapper/CacheJail.php
index 357851bedd5..75df45e257b 100644
--- a/lib/private/Files/Cache/Wrapper/CacheJail.php
+++ b/lib/private/Files/Cache/Wrapper/CacheJail.php
@@ -29,6 +29,7 @@
namespace OC\Files\Cache\Wrapper;
use OC\Files\Cache\Cache;
+use OC\Files\Search\SearchQuery;
use OCP\Files\Cache\ICacheEntry;
use OCP\Files\Search\ISearchQuery;
@@ -236,8 +237,14 @@ class CacheJail extends CacheWrapper {
}
public function searchQuery(ISearchQuery $query) {
- $results = $this->getCache()->searchQuery($query);
- return $this->formatSearchResults($results);
+ $simpleQuery = new SearchQuery($query->getSearchOperation(), 0, 0, $query->getOrder(), $query->getUser());
+ $results = $this->getCache()->searchQuery($simpleQuery);
+ $results = $this->formatSearchResults($results);
+
+ $limit = $query->getLimit() === 0 ? NULL : $query->getLimit();
+ $results = array_slice($results, $query->getOffset(), $limit);
+
+ return $results;
}
/**
@@ -312,6 +319,10 @@ class CacheJail extends CacheWrapper {
*/
public function getPathById($id) {
$path = $this->getCache()->getPathById($id);
+ if ($path === null) {
+ return null;
+ }
+
return $this->getJailedPath($path);
}
diff --git a/lib/private/Files/ObjectStore/Swift.php b/lib/private/Files/ObjectStore/Swift.php
index 629fb3ba7ff..70bc4ed8438 100644
--- a/lib/private/Files/ObjectStore/Swift.php
+++ b/lib/private/Files/ObjectStore/Swift.php
@@ -265,7 +265,7 @@ class Swift implements IObjectStore {
// save the object content in the context of the stream to prevent it being gc'd until the stream is closed
stream_context_set_option($stream, 'swift', 'content', $objectContent);
- RetryWrapper::wrap($stream);
+ return RetryWrapper::wrap($stream);
}
/**
diff --git a/lib/private/Files/Stream/Encryption.php b/lib/private/Files/Stream/Encryption.php
index 05107652c91..05be5a5b286 100644
--- a/lib/private/Files/Stream/Encryption.php
+++ b/lib/private/Files/Stream/Encryption.php
@@ -157,7 +157,7 @@ class Encryption extends Wrapper {
$unencryptedSize,
$headerSize,
$signed,
- $wrapper = 'OC\Files\Stream\Encryption') {
+ $wrapper = Encryption::class) {
$context = stream_context_create(array(
'ocencryption' => array(
diff --git a/lib/private/Files/Utils/Scanner.php b/lib/private/Files/Utils/Scanner.php
index 162e5759121..dd20e11fb63 100644
--- a/lib/private/Files/Utils/Scanner.php
+++ b/lib/private/Files/Utils/Scanner.php
@@ -38,6 +38,7 @@ use OCP\Files\NotFoundException;
use OCP\Files\Storage\IStorage;
use OCP\Files\StorageNotAvailableException;
use OCP\ILogger;
+use OC\Files\Storage\FailedStorage;
/**
* Class Scanner
@@ -146,7 +147,7 @@ class Scanner extends PublicEmitter {
}
// don't bother scanning failed storages (shortcut for same result)
- if ($storage->instanceOfStorage('OC\Files\Storage\FailedStorage')) {
+ if ($storage->instanceOfStorage(FailedStorage::class)) {
continue;
}
@@ -196,7 +197,7 @@ class Scanner extends PublicEmitter {
}
// don't bother scanning failed storages (shortcut for same result)
- if ($storage->instanceOfStorage('OC\Files\Storage\FailedStorage')) {
+ if ($storage->instanceOfStorage(FailedStorage::class)) {
continue;
}