Fixed incompatibilities with filecache rewrite merge
This commit is contained in:
parent
31e723a907
commit
2183f77527
|
@ -170,10 +170,10 @@ class Crypt {
|
||||||
*/
|
*/
|
||||||
public static function isEncryptedMeta( $path ) {
|
public static function isEncryptedMeta( $path ) {
|
||||||
|
|
||||||
// TODO: Use DI to get OC_FileCache_Cached out of here
|
// TODO: Use DI to get \OC\Files\Filesystem out of here
|
||||||
|
|
||||||
// Fetch all file metadata from DB
|
// Fetch all file metadata from DB
|
||||||
$metadata = \OC_FileCache_Cached::get( $path, '' );
|
$metadata = \OC\Files\Filesystem::getFileInfo( $path, '' );
|
||||||
|
|
||||||
// Return encryption status
|
// Return encryption status
|
||||||
return isset( $metadata['encrypted'] ) and ( bool )$metadata['encrypted'];
|
return isset( $metadata['encrypted'] ) and ( bool )$metadata['encrypted'];
|
||||||
|
@ -187,7 +187,7 @@ class Crypt {
|
||||||
public static function isLegacyEncryptedContent( $content ) {
|
public static function isLegacyEncryptedContent( $content ) {
|
||||||
|
|
||||||
// Fetch all file metadata from DB
|
// Fetch all file metadata from DB
|
||||||
$metadata = \OC_FileCache_Cached::get( $content, '' );
|
$metadata = \OC\Files\Filesystem::getFileInfo( $content, '' );
|
||||||
|
|
||||||
// If a file is flagged with encryption in DB, but isn't a
|
// If a file is flagged with encryption in DB, but isn't a
|
||||||
// valid content + IV combination, it's probably using the
|
// valid content + IV combination, it's probably using the
|
||||||
|
|
|
@ -129,7 +129,7 @@ class Proxy extends \OC_FileProxy {
|
||||||
Keymanager::setFileKey( $view, $filePath, $userId, $encrypted['key'] );
|
Keymanager::setFileKey( $view, $filePath, $userId, $encrypted['key'] );
|
||||||
|
|
||||||
// Update the file cache with file info
|
// Update the file cache with file info
|
||||||
\OC_FileCache::put( $path, array( 'encrypted'=>true, 'size' => $size ), '' );
|
\OC\Files\Filesystem::putFileInfo( $path, array( 'encrypted'=>true, 'size' => $size ), '' );
|
||||||
|
|
||||||
// Re-enable proxy - our work is done
|
// Re-enable proxy - our work is done
|
||||||
\OC_FileProxy::$enabled = true;
|
\OC_FileProxy::$enabled = true;
|
||||||
|
@ -162,7 +162,7 @@ class Proxy extends \OC_FileProxy {
|
||||||
|
|
||||||
$filePath = '/' . implode( '/', $filePath );
|
$filePath = '/' . implode( '/', $filePath );
|
||||||
|
|
||||||
//$cached = \OC_FileCache_Cached::get( $path, '' );
|
//$cached = \OC\Files\Filesystem::getFileInfo( $path, '' );
|
||||||
|
|
||||||
$view = new \OC_FilesystemView( '' );
|
$view = new \OC_FilesystemView( '' );
|
||||||
|
|
||||||
|
@ -363,7 +363,7 @@ class Proxy extends \OC_FileProxy {
|
||||||
|
|
||||||
if ( Crypt::isCatfile( $path ) ) {
|
if ( Crypt::isCatfile( $path ) ) {
|
||||||
|
|
||||||
$cached = \OC_FileCache_Cached::get( $path, '' );
|
$cached = \OC\Files\Filesystem::getFileInfo( $path, '' );
|
||||||
|
|
||||||
$data['size'] = $cached['size'];
|
$data['size'] = $cached['size'];
|
||||||
|
|
||||||
|
@ -376,7 +376,7 @@ class Proxy extends \OC_FileProxy {
|
||||||
|
|
||||||
if ( Crypt::isCatfile( $path ) ) {
|
if ( Crypt::isCatfile( $path ) ) {
|
||||||
|
|
||||||
$cached = \OC_FileCache_Cached::get( $path, '' );
|
$cached = \OC\Files\Filesystem::getFileInfo( $path, '' );
|
||||||
|
|
||||||
return $cached['size'];
|
return $cached['size'];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue