1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2025-01-19 08:52:22 +01:00

remove use of obsolete class OC_FileProxy

This commit is contained in:
babelouest 2015-04-26 15:09:13 -04:00
parent de7eafb8b9
commit 03776258bb

View File

@ -86,10 +86,7 @@ class ImportController extends Controller {
return $response;
}
$content = file_get_contents($tmpname);
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
if($view->file_put_contents('/imports/'.$filename, $content)) {
\OC_FileProxy::$enabled = $proxyStatus;
$progresskey = 'contacts-import-' . rand();
$response->setParams(
array(
@ -101,7 +98,6 @@ class ImportController extends Controller {
)
);
} else {
\OC_FileProxy::$enabled = $proxyStatus;
$response->bailOut(App::$l10n->t('Error uploading contacts to storage.'));
return $response;
}
@ -129,12 +125,8 @@ class ImportController extends Controller {
$view->mkdir('imports');
}
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
$content = \OC_Filesystem::file_get_contents($path . '/' . $filename);
//$content = file_get_contents('oc://' . $path . '/' . $filename);
if($view->file_put_contents('/imports/' . $filename, $content)) {
\OC_FileProxy::$enabled = $proxyStatus;
$progresskey = 'contacts-import-' . rand();
$response->setParams(
array(
@ -146,7 +138,6 @@ class ImportController extends Controller {
)
);
} else {
\OC_FileProxy::$enabled = $proxyStatus;
$response->bailOut(App::$l10n->t('Error moving file to imports folder.'));
}
return $response;
@ -189,10 +180,7 @@ class ImportController extends Controller {
return $response;
}
$view = \OCP\Files::getStorage('contacts');
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
$file = $view->file_get_contents('/imports/' . $filename);
\OC_FileProxy::$enabled = $proxyStatus;
$importManager = new ImportManager();