Skip to content
Snippets Groups Projects
Commit 1b42b492 authored by Thomas Müller's avatar Thomas Müller
Browse files

kill OC_FileProxy :boom:

parent dbdd754c
No related branches found
No related tags found
No related merge requests found
...@@ -375,10 +375,6 @@ class KeyManager { ...@@ -375,10 +375,6 @@ class KeyManager {
$keyPair = $this->crypt->createKeyPair(); $keyPair = $this->crypt->createKeyPair();
// Disable encryption proxy to prevent recursive calls
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
// Save public key // Save public key
$this->setPublicKey($user, $keyPair['publicKey']); $this->setPublicKey($user, $keyPair['publicKey']);
...@@ -395,8 +391,6 @@ class KeyManager { ...@@ -395,8 +391,6 @@ class KeyManager {
} else { } else {
$this->log->error('Encryption Could not update users encryption password'); $this->log->error('Encryption Could not update users encryption password');
} }
\OC_FileProxy::$enabled = $proxyStatus;
} }
} }
} }
......
...@@ -183,8 +183,6 @@ class Trashbin { ...@@ -183,8 +183,6 @@ class Trashbin {
$userTrashSize = self::getTrashbinSize($user); $userTrashSize = self::getTrashbinSize($user);
// disable proxy to prevent recursive calls // disable proxy to prevent recursive calls
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
$trashPath = '/files_trashbin/files/' . $filename . '.d' . $timestamp; $trashPath = '/files_trashbin/files/' . $filename . '.d' . $timestamp;
try { try {
$sizeOfAddedFiles = $view->filesize('/files/' . $file_path); $sizeOfAddedFiles = $view->filesize('/files/' . $file_path);
...@@ -199,7 +197,6 @@ class Trashbin { ...@@ -199,7 +197,6 @@ class Trashbin {
} }
\OC_Log::write('files_trashbin', 'Couldn\'t move ' . $file_path . ' to the trash bin', \OC_log::ERROR); \OC_Log::write('files_trashbin', 'Couldn\'t move ' . $file_path . ' to the trash bin', \OC_log::ERROR);
} }
\OC_FileProxy::$enabled = $proxyStatus;
if ($view->file_exists('/files/' . $file_path)) { // failed to delete the original file, abort if ($view->file_exists('/files/' . $file_path)) { // failed to delete the original file, abort
$view->unlink($trashPath); $view->unlink($trashPath);
...@@ -251,10 +248,6 @@ class Trashbin { ...@@ -251,10 +248,6 @@ class Trashbin {
$size = 0; $size = 0;
if (\OCP\App::isEnabled('files_versions')) { if (\OCP\App::isEnabled('files_versions')) {
// disable proxy to prevent recursive calls
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
$user = \OCP\User::getUser(); $user = \OCP\User::getUser();
$rootView = new \OC\Files\View('/'); $rootView = new \OC\Files\View('/');
...@@ -279,9 +272,6 @@ class Trashbin { ...@@ -279,9 +272,6 @@ class Trashbin {
$rootView->rename($owner . '/files_versions' . $v['path'] . '.v' . $v['version'], $user . '/files_trashbin/versions/' . $filename . '.v' . $v['version'] . '.d' . $timestamp); $rootView->rename($owner . '/files_versions' . $v['path'] . '.v' . $v['version'], $user . '/files_trashbin/versions/' . $filename . '.v' . $v['version'] . '.d' . $timestamp);
} }
} }
// enable proxy
\OC_FileProxy::$enabled = $proxyStatus;
} }
return $size; return $size;
...@@ -369,10 +359,6 @@ class Trashbin { ...@@ -369,10 +359,6 @@ class Trashbin {
$target = \OC\Files\Filesystem::normalizePath('files/' . $location . '/' . $uniqueFilename); $target = \OC\Files\Filesystem::normalizePath('files/' . $location . '/' . $uniqueFilename);
$mtime = $view->filemtime($source); $mtime = $view->filemtime($source);
// disable proxy to prevent recursive calls
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
// restore file // restore file
$restoreResult = $view->rename($source, $target); $restoreResult = $view->rename($source, $target);
...@@ -393,15 +379,9 @@ class Trashbin { ...@@ -393,15 +379,9 @@ class Trashbin {
$query->execute(array($user, $filename, $timestamp)); $query->execute(array($user, $filename, $timestamp));
} }
// enable proxy
\OC_FileProxy::$enabled = $proxyStatus;
return true; return true;
} }
// enable proxy
\OC_FileProxy::$enabled = $proxyStatus;
return false; return false;
} }
...@@ -419,9 +399,6 @@ class Trashbin { ...@@ -419,9 +399,6 @@ class Trashbin {
private static function restoreVersions(\OC\Files\View $view, $file, $filename, $uniqueFilename, $location, $timestamp) { private static function restoreVersions(\OC\Files\View $view, $file, $filename, $uniqueFilename, $location, $timestamp) {
if (\OCP\App::isEnabled('files_versions')) { if (\OCP\App::isEnabled('files_versions')) {
// disable proxy to prevent recursive calls
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
$user = \OCP\User::getUser(); $user = \OCP\User::getUser();
$rootView = new \OC\Files\View('/'); $rootView = new \OC\Files\View('/');
...@@ -432,7 +409,6 @@ class Trashbin { ...@@ -432,7 +409,6 @@ class Trashbin {
// file has been deleted in between // file has been deleted in between
if (empty($ownerPath)) { if (empty($ownerPath)) {
\OC_FileProxy::$enabled = $proxyStatus;
return false; return false;
} }
...@@ -453,9 +429,6 @@ class Trashbin { ...@@ -453,9 +429,6 @@ class Trashbin {
} }
} }
} }
// enable proxy
\OC_FileProxy::$enabled = $proxyStatus;
} }
} }
......
...@@ -160,18 +160,11 @@ class Storage { ...@@ -160,18 +160,11 @@ class Storage {
self::scheduleExpire($filename, $versionsSize, $neededSpace); self::scheduleExpire($filename, $versionsSize, $neededSpace);
// disable proxy to prevent multiple fopen calls
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
// store a new version of a file // store a new version of a file
$mtime = $users_view->filemtime('files/' . $filename); $mtime = $users_view->filemtime('files/' . $filename);
$users_view->copy('files/' . $filename, 'files_versions/' . $filename . '.v' . $mtime); $users_view->copy('files/' . $filename, 'files_versions/' . $filename . '.v' . $mtime);
// call getFileInfo to enforce a file cache entry for the new version // call getFileInfo to enforce a file cache entry for the new version
$users_view->getFileInfo('files_versions/' . $filename . '.v' . $mtime); $users_view->getFileInfo('files_versions/' . $filename . '.v' . $mtime);
// reset proxy state
\OC_FileProxy::$enabled = $proxyStatus;
} }
} }
...@@ -283,15 +276,8 @@ class Storage { ...@@ -283,15 +276,8 @@ class Storage {
$version = 'files_versions'.$filename.'.v'.$users_view->filemtime('files'.$filename); $version = 'files_versions'.$filename.'.v'.$users_view->filemtime('files'.$filename);
if ( !$users_view->file_exists($version)) { if ( !$users_view->file_exists($version)) {
// disable proxy to prevent multiple fopen calls
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
$users_view->copy('files'.$filename, 'files_versions'.$filename.'.v'.$users_view->filemtime('files'.$filename)); $users_view->copy('files'.$filename, 'files_versions'.$filename.'.v'.$users_view->filemtime('files'.$filename));
// reset proxy state
\OC_FileProxy::$enabled = $proxyStatus;
$versionCreated = true; $versionCreated = true;
} }
......
...@@ -67,13 +67,10 @@ class File { ...@@ -67,13 +67,10 @@ class File {
*/ */
public function get($key) { public function get($key) {
$result = null; $result = null;
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
if ($this->hasKey($key)) { if ($this->hasKey($key)) {
$storage = $this->getStorage(); $storage = $this->getStorage();
$result = $storage->file_get_contents($key); $result = $storage->file_get_contents($key);
} }
\OC_FileProxy::$enabled = $proxyStatus;
return $result; return $result;
} }
...@@ -85,13 +82,10 @@ class File { ...@@ -85,13 +82,10 @@ class File {
*/ */
public function size($key) { public function size($key) {
$result = 0; $result = 0;
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
if ($this->hasKey($key)) { if ($this->hasKey($key)) {
$storage = $this->getStorage(); $storage = $this->getStorage();
$result = $storage->filesize($key); $result = $storage->filesize($key);
} }
\OC_FileProxy::$enabled = $proxyStatus;
return $result; return $result;
} }
...@@ -101,7 +95,6 @@ class File { ...@@ -101,7 +95,6 @@ class File {
public function set($key, $value, $ttl = 0) { public function set($key, $value, $ttl = 0) {
$storage = $this->getStorage(); $storage = $this->getStorage();
$result = false; $result = false;
$proxyStatus = \OC_FileProxy::$enabled;
// unique id to avoid chunk collision, just in case // unique id to avoid chunk collision, just in case
$uniqueId = \OC::$server->getSecureRandom()->getLowStrengthGenerator()->generate( $uniqueId = \OC::$server->getSecureRandom()->getLowStrengthGenerator()->generate(
16, 16,
...@@ -111,7 +104,6 @@ class File { ...@@ -111,7 +104,6 @@ class File {
// use part file to prevent hasKey() to find the key // use part file to prevent hasKey() to find the key
// while it is being written // while it is being written
$keyPart = $key . '.' . $uniqueId . '.part'; $keyPart = $key . '.' . $uniqueId . '.part';
\OC_FileProxy::$enabled = false;
if ($storage and $storage->file_put_contents($keyPart, $value)) { if ($storage and $storage->file_put_contents($keyPart, $value)) {
if ($ttl === 0) { if ($ttl === 0) {
$ttl = 86400; // 60*60*24 $ttl = 86400; // 60*60*24
...@@ -119,7 +111,6 @@ class File { ...@@ -119,7 +111,6 @@ class File {
$result = $storage->touch($keyPart, time() + $ttl); $result = $storage->touch($keyPart, time() + $ttl);
$result &= $storage->rename($keyPart, $key); $result &= $storage->rename($keyPart, $key);
} }
\OC_FileProxy::$enabled = $proxyStatus;
return $result; return $result;
} }
......
...@@ -189,8 +189,7 @@ class OC_FileChunking { ...@@ -189,8 +189,7 @@ class OC_FileChunking {
$absolutePath = \OC\Files\Filesystem::normalizePath(\OC\Files\Filesystem::getView()->getAbsolutePath($path)); $absolutePath = \OC\Files\Filesystem::normalizePath(\OC\Files\Filesystem::getView()->getAbsolutePath($path));
$data = ''; $data = '';
// use file_put_contents as method because that best matches what this function does // use file_put_contents as method because that best matches what this function does
if (OC_FileProxy::runPreProxies('file_put_contents', $absolutePath, $data) if (\OC\Files\Filesystem::isValidPath($path)) {
&& \OC\Files\Filesystem::isValidPath($path)) {
$path = \OC\Files\Filesystem::getView()->getRelativePath($absolutePath); $path = \OC\Files\Filesystem::getView()->getRelativePath($absolutePath);
$exists = \OC\Files\Filesystem::file_exists($path); $exists = \OC\Files\Filesystem::file_exists($path);
$run = true; $run = true;
...@@ -231,7 +230,6 @@ class OC_FileChunking { ...@@ -231,7 +230,6 @@ class OC_FileChunking {
\OC\Files\Filesystem::signal_post_write, \OC\Files\Filesystem::signal_post_write,
array( \OC\Files\Filesystem::signal_param_path => $path) array( \OC\Files\Filesystem::signal_param_path => $path)
); );
OC_FileProxy::runPostProxies('file_put_contents', $absolutePath, $count);
return $count > 0; return $count > 0;
}else{ }else{
return false; return false;
......
<?php
/**
* @author Bart Visscher <bartv@thisnet.nl>
* @author Felix Moeller <mail@felixmoeller.de>
* @author Jörn Friedrich Dreyer <jfd@butonic.de>
* @author Morris Jobke <hey@morrisjobke.de>
* @author Robin Appelman <icewind@owncloud.com>
* @author Robin McCorkell <rmccorkell@karoshi.org.uk>
* @author Scrutinizer Auto-Fixer <auto-fixer@scrutinizer-ci.com>
* @author Thomas Müller <thomas.mueller@tmit.eu>
* @author Vincent Petry <pvince81@owncloud.com>
*
* @copyright Copyright (c) 2015, ownCloud, Inc.
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License, version 3,
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
/**
* Class for manipulating filesystem requests
*
* Manipulation happens by using 2 kind of proxy operations, pre and post proxies
* that manipulate the filesystem call and the result of the call respectively
*
* A pre-proxy recieves the filepath as arugments (or 2 filespaths in case of
* operations like copy or move) and return a boolean
* If a pre-proxy returns false the file operation will be canceled
* All filesystem operations have a pre-proxy
*
* A post-proxy recieves 2 arguments, the filepath and the result of the operation.
* The return value of the post-proxy will be used as the new result of the operation
* The operations that have a post-proxy are:
* file_get_contents, is_file, is_dir, file_exists, stat, is_readable,
* is_writable, filemtime, filectime, file_get_contents,
* getMimeType, hash, fopen, free_space and search
*/
class OC_FileProxy{
private static $proxies=array();
public static $enabled=true;
/**
* fallback function when a proxy operation is not implemented
* @param string $function the name of the proxy operation
* @param mixed $arguments
*
* this implements a dummy proxy for all operations
*/
public function __call($function, $arguments) {
if(substr($function, 0, 3)=='pre') {
return true;
}else{
return $arguments[1];
}
}
/**
* register a proxy to be used
* @param OC_FileProxy $proxy
*/
public static function register($proxy) {
self::$proxies[]=$proxy;
}
/**
* @param string $operation
*/
public static function getProxies($operation = null) {
if ($operation === null) {
// return all
return self::$proxies;
}
$proxies=array();
foreach(self::$proxies as $proxy) {
if(method_exists($proxy, $operation)) {
$proxies[]=$proxy;
}
}
return $proxies;
}
/**
* @param string $operation
* @param string|boolean $filepath
*/
public static function runPreProxies($operation,&$filepath,&$filepath2=null) {
if(!self::$enabled) {
return true;
}
$operation='pre'.$operation;
$proxies=self::getProxies($operation);
foreach($proxies as $proxy) {
if(!is_null($filepath2)) {
if($proxy->$operation($filepath, $filepath2)===false) {
return false;
}
}else{
if($proxy->$operation($filepath)===false) {
return false;
}
}
}
return true;
}
/**
* @param string $operation
* @param string|boolean $path
*
* @return string
*/
public static function runPostProxies($operation, $path, $result) {
if(!self::$enabled) {
return $result;
}
$operation='post'.$operation;
$proxies=self::getProxies($operation);
foreach($proxies as $proxy) {
$result=$proxy->$operation($path, $result);
}
return $result;
}
public static function clearProxies() {
self::$proxies=array();
}
}
...@@ -515,8 +515,7 @@ class View { ...@@ -515,8 +515,7 @@ class View {
public function file_put_contents($path, $data) { public function file_put_contents($path, $data) {
if (is_resource($data)) { //not having to deal with streams in file_put_contents makes life easier if (is_resource($data)) { //not having to deal with streams in file_put_contents makes life easier
$absolutePath = Filesystem::normalizePath($this->getAbsolutePath($path)); $absolutePath = Filesystem::normalizePath($this->getAbsolutePath($path));
if (\OC_FileProxy::runPreProxies('file_put_contents', $absolutePath, $data) if (Filesystem::isValidPath($path)
and Filesystem::isValidPath($path)
and !Filesystem::isFileBlacklisted($path) and !Filesystem::isFileBlacklisted($path)
) { ) {
$path = $this->getRelativePath($absolutePath); $path = $this->getRelativePath($absolutePath);
...@@ -537,7 +536,6 @@ class View { ...@@ -537,7 +536,6 @@ class View {
if ($this->shouldEmitHooks($path) && $result !== false) { if ($this->shouldEmitHooks($path) && $result !== false) {
$this->emit_file_hooks_post($exists, $path); $this->emit_file_hooks_post($exists, $path);
} }
\OC_FileProxy::runPostProxies('file_put_contents', $absolutePath, $count);
return $result; return $result;
} else { } else {
return false; return false;
...@@ -591,8 +589,7 @@ class View { ...@@ -591,8 +589,7 @@ class View {
$absolutePath1 = Filesystem::normalizePath($this->getAbsolutePath($path1)); $absolutePath1 = Filesystem::normalizePath($this->getAbsolutePath($path1));
$absolutePath2 = Filesystem::normalizePath($this->getAbsolutePath($path2)); $absolutePath2 = Filesystem::normalizePath($this->getAbsolutePath($path2));
if ( if (
\OC_FileProxy::runPreProxies('rename', $absolutePath1, $absolutePath2) Filesystem::isValidPath($path2)
and Filesystem::isValidPath($path2)
and Filesystem::isValidPath($path1) and Filesystem::isValidPath($path1)
and !Filesystem::isFileBlacklisted($path2) and !Filesystem::isFileBlacklisted($path2)
) { ) {
...@@ -635,14 +632,12 @@ class View { ...@@ -635,14 +632,12 @@ class View {
$sourceMountPoint = $mount->getMountPoint(); $sourceMountPoint = $mount->getMountPoint();
$result = $mount->moveMount($absolutePath2); $result = $mount->moveMount($absolutePath2);
$manager->moveMount($sourceMountPoint, $mount->getMountPoint()); $manager->moveMount($sourceMountPoint, $mount->getMountPoint());
\OC_FileProxy::runPostProxies('rename', $absolutePath1, $absolutePath2);
} else { } else {
$result = false; $result = false;
} }
} elseif ($mp1 == $mp2) { } elseif ($mp1 == $mp2) {
if ($storage1) { if ($storage1) {
$result = $storage1->rename($internalPath1, $internalPath2); $result = $storage1->rename($internalPath1, $internalPath2);
\OC_FileProxy::runPostProxies('rename', $absolutePath1, $absolutePath2);
} else { } else {
$result = false; $result = false;
} }
...@@ -718,8 +713,7 @@ class View { ...@@ -718,8 +713,7 @@ class View {
$absolutePath1 = Filesystem::normalizePath($this->getAbsolutePath($path1)); $absolutePath1 = Filesystem::normalizePath($this->getAbsolutePath($path1));
$absolutePath2 = Filesystem::normalizePath($this->getAbsolutePath($path2)); $absolutePath2 = Filesystem::normalizePath($this->getAbsolutePath($path2));
if ( if (
\OC_FileProxy::runPreProxies('copy', $absolutePath1, $absolutePath2) Filesystem::isValidPath($path2)
and Filesystem::isValidPath($path2)
and Filesystem::isValidPath($path1) and Filesystem::isValidPath($path1)
and !Filesystem::isFileBlacklisted($path2) and !Filesystem::isFileBlacklisted($path2)
) { ) {
...@@ -927,7 +921,7 @@ class View { ...@@ -927,7 +921,7 @@ class View {
public function hash($type, $path, $raw = false) { public function hash($type, $path, $raw = false) {
$postFix = (substr($path, -1, 1) === '/') ? '/' : ''; $postFix = (substr($path, -1, 1) === '/') ? '/' : '';
$absolutePath = Filesystem::normalizePath($this->getAbsolutePath($path)); $absolutePath = Filesystem::normalizePath($this->getAbsolutePath($path));
if (\OC_FileProxy::runPreProxies('hash', $absolutePath) && Filesystem::isValidPath($path)) { if (Filesystem::isValidPath($path)) {
$path = $this->getRelativePath($absolutePath); $path = $this->getRelativePath($absolutePath);
if ($path == null) { if ($path == null) {
return false; return false;
...@@ -942,7 +936,6 @@ class View { ...@@ -942,7 +936,6 @@ class View {
list($storage, $internalPath) = Filesystem::resolvePath($absolutePath . $postFix); list($storage, $internalPath) = Filesystem::resolvePath($absolutePath . $postFix);
if ($storage) { if ($storage) {
$result = $storage->hash($type, $internalPath, $raw); $result = $storage->hash($type, $internalPath, $raw);
$result = \OC_FileProxy::runPostProxies('hash', $absolutePath, $result);
return $result; return $result;
} }
} }
...@@ -975,8 +968,7 @@ class View { ...@@ -975,8 +968,7 @@ class View {
private function basicOperation($operation, $path, $hooks = array(), $extraParam = null) { private function basicOperation($operation, $path, $hooks = array(), $extraParam = null) {
$postFix = (substr($path, -1, 1) === '/') ? '/' : ''; $postFix = (substr($path, -1, 1) === '/') ? '/' : '';
$absolutePath = Filesystem::normalizePath($this->getAbsolutePath($path)); $absolutePath = Filesystem::normalizePath($this->getAbsolutePath($path));
if (\OC_FileProxy::runPreProxies($operation, $absolutePath, $extraParam) if (Filesystem::isValidPath($path)
and Filesystem::isValidPath($path)
and !Filesystem::isFileBlacklisted($path) and !Filesystem::isFileBlacklisted($path)
) { ) {
$path = $this->getRelativePath($absolutePath); $path = $this->getRelativePath($absolutePath);
...@@ -993,8 +985,6 @@ class View { ...@@ -993,8 +985,6 @@ class View {
$result = $storage->$operation($internalPath); $result = $storage->$operation($internalPath);
} }
$result = \OC_FileProxy::runPostProxies($operation, $this->getAbsolutePath($path), $result);
if (in_array('delete', $hooks) and $result) { if (in_array('delete', $hooks) and $result) {
$this->updater->remove($path); $this->updater->remove($path);
} }
...@@ -1168,8 +1158,6 @@ class View { ...@@ -1168,8 +1158,6 @@ class View {
$data['permissions'] |= \OCP\Constants::PERMISSION_DELETE; $data['permissions'] |= \OCP\Constants::PERMISSION_DELETE;
} }
$data = \OC_FileProxy::runPostProxies('getFileInfo', $path, $data);
return new FileInfo($path, $storage, $internalPath, $data, $mount); return new FileInfo($path, $storage, $internalPath, $data, $mount);
} }
......
...@@ -496,19 +496,7 @@ class Server extends SimpleContainer implements IServerContainer { ...@@ -496,19 +496,7 @@ class Server extends SimpleContainer implements IServerContainer {
$dir = '/files'; $dir = '/files';
if (!$folder->nodeExists($dir)) { if (!$folder->nodeExists($dir)) {
$folder = $folder->newFolder($dir); $folder = $folder->newFolder($dir);
if (\OCP\App::isEnabled('files_encryption')) {
// disable encryption proxy to prevent recursive calls
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
}
\OC_Util::copySkeleton($user, $folder); \OC_Util::copySkeleton($user, $folder);
if (\OCP\App::isEnabled('files_encryption')) {
// re-enable proxy - our work is done
\OC_FileProxy::$enabled = $proxyStatus;
}
} else { } else {
$folder = $folder->get($dir); $folder = $folder->get($dir);
} }
......
...@@ -25,4 +25,3 @@ if (!class_exists('PHPUnit_Framework_TestCase')) { ...@@ -25,4 +25,3 @@ if (!class_exists('PHPUnit_Framework_TestCase')) {
OC_Hook::clear(); OC_Hook::clear();
OC_Log::$enabled = false; OC_Log::$enabled = false;
OC_FileProxy::clearProxies();
...@@ -38,7 +38,6 @@ class FileCache extends \Test_Cache { ...@@ -38,7 +38,6 @@ class FileCache extends \Test_Cache {
parent::setUp(); parent::setUp();
//clear all proxies and hooks so we can do clean testing //clear all proxies and hooks so we can do clean testing
\OC_FileProxy::clearProxies();
\OC_Hook::clear('OC_Filesystem'); \OC_Hook::clear('OC_Filesystem');
//set up temporary storage //set up temporary storage
......
...@@ -34,7 +34,6 @@ class UserCache extends \Test_Cache { ...@@ -34,7 +34,6 @@ class UserCache extends \Test_Cache {
parent::setUp(); parent::setUp();
//clear all proxies and hooks so we can do clean testing //clear all proxies and hooks so we can do clean testing
\OC_FileProxy::clearProxies();
\OC_Hook::clear('OC_Filesystem'); \OC_Hook::clear('OC_Filesystem');
//set up temporary storage //set up temporary storage
......
...@@ -71,7 +71,6 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase { ...@@ -71,7 +71,6 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase {
self::tearDownAfterClassCleanFileCache(); self::tearDownAfterClassCleanFileCache();
self::tearDownAfterClassCleanStrayDataFiles($dataDir); self::tearDownAfterClassCleanStrayDataFiles($dataDir);
self::tearDownAfterClassCleanStrayHooks(); self::tearDownAfterClassCleanStrayHooks();
self::tearDownAfterClassCleanProxies();
parent::tearDownAfterClass(); parent::tearDownAfterClass();
} }
...@@ -164,16 +163,6 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase { ...@@ -164,16 +163,6 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase {
\OC_Hook::clear(); \OC_Hook::clear();
} }
/**
* Clean up the list of file proxies
*
* Also reenables file proxies, in case a test disabled them
*/
static protected function tearDownAfterClassCleanProxies() {
\OC_FileProxy::$enabled = true;
\OC_FileProxy::clearProxies();
}
/** /**
* Login and setup FS as a given user, * Login and setup FS as a given user,
* sets the given user as the current user. * sets the given user as the current user.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment