summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorFrank Karlitschek <frank@owncloud.org>2012-05-02 00:20:45 +0200
committerFrank Karlitschek <frank@owncloud.org>2012-05-02 00:20:45 +0200
commit93b63cf3755d3f1295c976c308b81c6340883abb (patch)
tree8e8a7413ea75723b7d21e18661a10842d1970bf1 /apps
parente48f511606a1ef64aa39099055dd6ae437f45d03 (diff)
downloadnextcloud-server-93b63cf3755d3f1295c976c308b81c6340883abb.tar.gz
nextcloud-server-93b63cf3755d3f1295c976c308b81c6340883abb.zip
ported the rest of the OC_Helper calls
Diffstat (limited to 'apps')
-rwxr-xr-xapps/bookmarks/appinfo/app.php2
-rwxr-xr-xapps/calendar/appinfo/app.php2
-rwxr-xr-xapps/calendar/templates/calendar.php2
-rwxr-xr-x[-rw-r--r--]apps/contacts/ajax/importaddressbook.php6
-rwxr-xr-xapps/contacts/ajax/loadcard.php6
-rwxr-xr-xapps/contacts/appinfo/app.php2
-rwxr-xr-xapps/contacts/index.php6
-rwxr-xr-xapps/contacts/photo.php2
-rwxr-xr-xapps/contacts/thumbnail.php2
-rwxr-xr-xapps/external/appinfo/app.php2
-rwxr-xr-xapps/files/admin.php16
-rwxr-xr-x[-rw-r--r--]apps/files/ajax/upload.php2
-rwxr-xr-xapps/files/appinfo/app.php2
-rwxr-xr-xapps/files/index.php6
-rwxr-xr-x[-rw-r--r--]apps/files_archive/lib/storage.php2
-rwxr-xr-x[-rw-r--r--]apps/files_archive/lib/tar.php12
-rwxr-xr-xapps/files_archive/lib/zip.php2
-rwxr-xr-x[-rw-r--r--]apps/files_archive/tests/archive.php8
-rwxr-xr-x[-rw-r--r--]apps/files_archive/tests/storage.php2
-rwxr-xr-x[-rw-r--r--]apps/files_archive/tests/tar.php2
-rwxr-xr-x[-rw-r--r--]apps/files_archive/tests/zip.php2
-rwxr-xr-xapps/files_encryption/lib/proxy.php4
-rwxr-xr-x[-rw-r--r--]apps/files_encryption/tests/encryption.php4
-rwxr-xr-x[-rw-r--r--]apps/files_encryption/tests/stream.php4
-rwxr-xr-x[-rw-r--r--]apps/files_external/lib/ftp.php2
-rwxr-xr-x[-rw-r--r--]apps/files_external/lib/google.php2
-rwxr-xr-x[-rw-r--r--]apps/files_external/lib/swift.php8
-rwxr-xr-x[-rw-r--r--]apps/files_external/lib/webdav.php2
-rwxr-xr-x[-rw-r--r--]apps/files_external/tests/ftp.php2
-rwxr-xr-xapps/gallery/appinfo/app.php2
-rwxr-xr-xapps/media/appinfo/app.php2
-rwxr-xr-x[-rw-r--r--]apps/user_ldap/user_ldap.php2
32 files changed, 61 insertions, 61 deletions
diff --git a/apps/bookmarks/appinfo/app.php b/apps/bookmarks/appinfo/app.php
index 449969d8e5f..246a0d0ecd7 100755
--- a/apps/bookmarks/appinfo/app.php
+++ b/apps/bookmarks/appinfo/app.php
@@ -13,7 +13,7 @@ OC::$CLASSPATH['OC_Search_Provider_Bookmarks'] = 'apps/bookmarks/lib/search.php'
OC_App::register( array( 'order' => 70, 'id' => 'bookmark', 'name' => 'Bookmarks' ));
$l = new OC_l10n('bookmarks');
-OC_App::addNavigationEntry( array( 'id' => 'bookmarks_index', 'order' => 70, 'href' => OCP\Util::linkTo( 'bookmarks', 'index.php' ), 'icon' => OC_Helper::imagePath( 'bookmarks', 'bookmarks.png' ), 'name' => $l->t('Bookmarks')));
+OC_App::addNavigationEntry( array( 'id' => 'bookmarks_index', 'order' => 70, 'href' => OCP\Util::linkTo( 'bookmarks', 'index.php' ), 'icon' => OCP\Util::imagePath( 'bookmarks', 'bookmarks.png' ), 'name' => $l->t('Bookmarks')));
OC_App::registerPersonal('bookmarks', 'settings');
OCP\Util::addscript('bookmarks','bookmarksearch');
diff --git a/apps/calendar/appinfo/app.php b/apps/calendar/appinfo/app.php
index 9a60aaeeb95..cf1325fad7a 100755
--- a/apps/calendar/appinfo/app.php
+++ b/apps/calendar/appinfo/app.php
@@ -19,7 +19,7 @@ OC_App::addNavigationEntry( array(
'id' => 'calendar_index',
'order' => 10,
'href' => OCP\Util::linkTo( 'calendar', 'index.php' ),
- 'icon' => OC_Helper::imagePath( 'calendar', 'icon.svg' ),
+ 'icon' => OCP\Util::imagePath( 'calendar', 'icon.svg' ),
'name' => $l->t('Calendar')));
OC_App::registerPersonal('calendar', 'settings');
OC_Search::registerProvider('OC_Search_Provider_Calendar');
diff --git a/apps/calendar/templates/calendar.php b/apps/calendar/templates/calendar.php
index f8bd91640e5..4285dc0f833 100755
--- a/apps/calendar/templates/calendar.php
+++ b/apps/calendar/templates/calendar.php
@@ -40,7 +40,7 @@
<input type="button" value="<?php echo $l->t('Week');?>" id="oneweekview_radio"/>
<input type="button" value="<?php echo $l->t('Month');?>" id="onemonthview_radio"/>
<input type="button" value="<?php echo $l->t('List');?>" id="listview_radio"/>&nbsp;&nbsp;
- <img id="loading" src="<?php echo OC_Helper::imagePath('core', 'loading.gif'); ?>" />
+ <img id="loading" src="<?php echo OCP\Util::imagePath('core', 'loading.gif'); ?>" />
</div>
</form>
<form>
diff --git a/apps/contacts/ajax/importaddressbook.php b/apps/contacts/ajax/importaddressbook.php
index 5776c801a76..e54d22b9caf 100644..100755
--- a/apps/contacts/ajax/importaddressbook.php
+++ b/apps/contacts/ajax/importaddressbook.php
@@ -9,8 +9,8 @@
require_once('../../../lib/base.php');
OC_JSON::checkLoggedIn();
OC_Util::checkAppEnabled('contacts');
-$upload_max_filesize = OC_Helper::computerFileSize(ini_get('upload_max_filesize'));
-$post_max_size = OC_Helper::computerFileSize(ini_get('post_max_size'));
+$upload_max_filesize = OCP\Util::computerFileSize(ini_get('upload_max_filesize'));
+$post_max_size = OCP\Util::computerFileSize(ini_get('post_max_size'));
$maxUploadFilesize = min($upload_max_filesize, $post_max_size);
$freeSpace=OC_Filesystem::free_space('/');
@@ -19,6 +19,6 @@ $maxUploadFilesize = min($maxUploadFilesize ,$freeSpace);
$tmpl = new OC_Template('contacts', 'part.importaddressbook');
$tmpl->assign('uploadMaxFilesize', $maxUploadFilesize);
-$tmpl->assign('uploadMaxHumanFilesize', OC_Helper::humanFileSize($maxUploadFilesize));
+$tmpl->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize));
$tmpl->printpage();
?>
diff --git a/apps/contacts/ajax/loadcard.php b/apps/contacts/ajax/loadcard.php
index a2660130a25..90ba3f66097 100755
--- a/apps/contacts/ajax/loadcard.php
+++ b/apps/contacts/ajax/loadcard.php
@@ -38,8 +38,8 @@ function debug($msg) {
OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('contacts');
-$upload_max_filesize = OC_Helper::computerFileSize(ini_get('upload_max_filesize'));
-$post_max_size = OC_Helper::computerFileSize(ini_get('post_max_size'));
+$upload_max_filesize = OCP\Util::computerFileSize(ini_get('upload_max_filesize'));
+$post_max_size = OCP\Util::computerFileSize(ini_get('post_max_size'));
$maxUploadFilesize = min($upload_max_filesize, $post_max_size);
$freeSpace=OC_Filesystem::free_space('/');
@@ -51,7 +51,7 @@ $email_types = OC_Contacts_App::getTypesOfProperty('EMAIL');
$tmpl = new OC_Template('contacts','part.contact');
$tmpl->assign('uploadMaxFilesize', $maxUploadFilesize);
-$tmpl->assign('uploadMaxHumanFilesize', OC_Helper::humanFileSize($maxUploadFilesize));
+$tmpl->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize));
$tmpl->assign('adr_types',$adr_types);
$tmpl->assign('phone_types',$phone_types);
$tmpl->assign('email_types',$email_types);
diff --git a/apps/contacts/appinfo/app.php b/apps/contacts/appinfo/app.php
index 2c4da2fd6cd..87c36959743 100755
--- a/apps/contacts/appinfo/app.php
+++ b/apps/contacts/appinfo/app.php
@@ -18,7 +18,7 @@ OC_App::addNavigationEntry( array(
'id' => 'contacts_index',
'order' => 10,
'href' => OCP\Util::linkTo( 'contacts', 'index.php' ),
- 'icon' => OC_Helper::imagePath( 'settings', 'users.svg' ),
+ 'icon' => OCP\Util::imagePath( 'settings', 'users.svg' ),
'name' => OC_L10N::get('contact')->t('Contacts') ));
diff --git a/apps/contacts/index.php b/apps/contacts/index.php
index 8f2a561b312..c018fca764a 100755
--- a/apps/contacts/index.php
+++ b/apps/contacts/index.php
@@ -37,8 +37,8 @@ $phone_types = OC_Contacts_App::getTypesOfProperty('TEL');
$email_types = OC_Contacts_App::getTypesOfProperty('EMAIL');
$categories = OC_Contacts_App::getCategories();
-$upload_max_filesize = OC_Helper::computerFileSize(ini_get('upload_max_filesize'));
-$post_max_size = OC_Helper::computerFileSize(ini_get('post_max_size'));
+$upload_max_filesize = OCP\Util::computerFileSize(ini_get('upload_max_filesize'));
+$post_max_size = OCP\Util::computerFileSize(ini_get('post_max_size'));
$maxUploadFilesize = min($upload_max_filesize, $post_max_size);
$freeSpace=OC_Filesystem::free_space('/');
@@ -59,7 +59,7 @@ OCP\Util::addStyle('contacts','contacts');
$tmpl = new OC_Template( "contacts", "index", "user" );
$tmpl->assign('uploadMaxFilesize', $maxUploadFilesize);
-$tmpl->assign('uploadMaxHumanFilesize', OC_Helper::humanFileSize($maxUploadFilesize));
+$tmpl->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize));
$tmpl->assign('property_types', $property_types);
$tmpl->assign('phone_types', $phone_types);
$tmpl->assign('email_types', $email_types);
diff --git a/apps/contacts/photo.php b/apps/contacts/photo.php
index 12d7f370710..a545afc434b 100755
--- a/apps/contacts/photo.php
+++ b/apps/contacts/photo.php
@@ -16,7 +16,7 @@ OC_Util::checkAppEnabled('contacts');
function getStandardImage(){
OC_Response::setExpiresHeader('P10D');
OC_Response::enableCaching();
- OC_Response::redirect(OC_Helper::imagePath('contacts', 'person_large.png'));
+ OC_Response::redirect(OCP\Util::imagePath('contacts', 'person_large.png'));
}
$id = isset($_GET['id']) ? $_GET['id'] : null;
diff --git a/apps/contacts/thumbnail.php b/apps/contacts/thumbnail.php
index ab5d160135e..239ec7f4d47 100755
--- a/apps/contacts/thumbnail.php
+++ b/apps/contacts/thumbnail.php
@@ -29,7 +29,7 @@ OC_Util::checkAppEnabled('contacts');
function getStandardImage(){
OC_Response::setExpiresHeader('P10D');
OC_Response::enableCaching();
- OC_Response::redirect(OC_Helper::imagePath('contacts', 'person.png'));
+ OC_Response::redirect(OCP\Util::imagePath('contacts', 'person.png'));
}
if(!function_exists('imagecreatefromjpeg')) {
diff --git a/apps/external/appinfo/app.php b/apps/external/appinfo/app.php
index b69cc3b2d6b..66116ac4c6e 100755
--- a/apps/external/appinfo/app.php
+++ b/apps/external/appinfo/app.php
@@ -31,5 +31,5 @@ OC_App::register(array('order' => 70, 'id' => 'external', 'name' => 'External'))
$sites = OC_External::getSites();
for ($i = 0; $i < sizeof($sites); $i++) {
OC_App::addNavigationEntry(
- array('id' => 'external_index' . ($i + 1), 'order' => 80 + $i, 'href' => OCP\Util::linkTo('external', 'index.php') . '?id=' . ($i + 1), 'icon' => OC_Helper::imagePath('external', 'external.png'), 'name' => $sites[$i][0]));
+ array('id' => 'external_index' . ($i + 1), 'order' => 80 + $i, 'href' => OCP\Util::linkTo('external', 'index.php') . '?id=' . ($i + 1), 'icon' => OCP\Util::imagePath('external', 'external.png'), 'name' => $sites[$i][0]));
}
diff --git a/apps/files/admin.php b/apps/files/admin.php
index ae7ea0436a0..120e245fd42 100755
--- a/apps/files/admin.php
+++ b/apps/files/admin.php
@@ -29,24 +29,24 @@ OCP\User::checkAdminUser();
$htaccessWorking=(getenv('htaccessWorking')=='true');
-$upload_max_filesize = OC_Helper::computerFileSize(ini_get('upload_max_filesize'));
-$post_max_size = OC_Helper::computerFileSize(ini_get('post_max_size'));
-$maxUploadFilesize = OC_Helper::humanFileSize(min($upload_max_filesize, $post_max_size));
+$upload_max_filesize = OCP\Util::computerFileSize(ini_get('upload_max_filesize'));
+$post_max_size = OCP\Util::computerFileSize(ini_get('post_max_size'));
+$maxUploadFilesize = OCP\Util::humanFileSize(min($upload_max_filesize, $post_max_size));
if($_POST) {
if(isset($_POST['maxUploadSize'])){
- if(($setMaxSize = OC_Files::setUploadLimit(OC_Helper::computerFileSize($_POST['maxUploadSize']))) !== false) {
- $maxUploadFilesize = OC_Helper::humanFileSize($setMaxSize);
+ if(($setMaxSize = OC_Files::setUploadLimit(OCP\Util::computerFileSize($_POST['maxUploadSize']))) !== false) {
+ $maxUploadFilesize = OCP\Util::humanFileSize($setMaxSize);
}
}
if(isset($_POST['maxZipInputSize'])) {
$maxZipInputSize=$_POST['maxZipInputSize'];
- OC_Config::setValue('maxZipInputSize', OC_Helper::computerFileSize($maxZipInputSize));
+ OC_Config::setValue('maxZipInputSize', OCP\Util::computerFileSize($maxZipInputSize));
}
if(isset($_POST['submitFilesAdminSettings'])) {
OC_Config::setValue('allowZipDownload', isset($_POST['allowZipDownload']));
}
}
-$maxZipInputSize = OC_Helper::humanFileSize(OC_Config::getValue('maxZipInputSize', OC_Helper::computerFileSize('800 MB')));
+$maxZipInputSize = OCP\Util::humanFileSize(OC_Config::getValue('maxZipInputSize', OCP\Util::computerFileSize('800 MB')));
$allowZipDownload = intval(OC_Config::getValue('allowZipDownload', true));
OC_App::setActiveNavigationEntry( "files_administration" );
@@ -54,7 +54,7 @@ OC_App::setActiveNavigationEntry( "files_administration" );
$tmpl = new OC_Template( 'files', 'admin' );
$tmpl->assign( 'htaccessWorking', $htaccessWorking );
$tmpl->assign( 'uploadMaxFilesize', $maxUploadFilesize);
-$tmpl->assign( 'maxPossibleUploadSize', OC_Helper::humanFileSize(PHP_INT_MAX));
+$tmpl->assign( 'maxPossibleUploadSize', OCP\Util::humanFileSize(PHP_INT_MAX));
$tmpl->assign( 'allowZipDownload', $allowZipDownload);
$tmpl->assign( 'maxZipInputSize', $maxZipInputSize);
return $tmpl->fetchPage(); \ No newline at end of file
diff --git a/apps/files/ajax/upload.php b/apps/files/ajax/upload.php
index 3ac8ef59560..c50f6233a46 100644..100755
--- a/apps/files/ajax/upload.php
+++ b/apps/files/ajax/upload.php
@@ -46,7 +46,7 @@ $result=array();
if(strpos($dir,'..') === false){
$fileCount=count($files['name']);
for($i=0;$i<$fileCount;$i++){
- $target = OC_Helper::buildNotExistingFileName(stripslashes($dir), $files['name'][$i]);
+ $target = OCP\Util::buildNotExistingFileName(stripslashes($dir), $files['name'][$i]);
if(is_uploaded_file($files['tmp_name'][$i]) and OC_Filesystem::fromTmpFile($files['tmp_name'][$i],$target)){
$meta=OC_FileCache::getCached($target);
$result[]=array( "status" => "success", 'mime'=>$meta['mimetype'],'size'=>$meta['size'],'name'=>basename($target));
diff --git a/apps/files/appinfo/app.php b/apps/files/appinfo/app.php
index 40523521d9c..0e82713fe5c 100755
--- a/apps/files/appinfo/app.php
+++ b/apps/files/appinfo/app.php
@@ -5,6 +5,6 @@ $l=OC_L10N::get('files');
OC_App::register( array( "order" => 2, "id" => "files", "name" => "Files" ));
-OC_App::addNavigationEntry( array( "id" => "files_index", "order" => 0, "href" => OCP\Util::linkTo( "files", "index.php" ), "icon" => OC_Helper::imagePath( "core", "places/home.svg" ), "name" => $l->t("Files") ));
+OC_App::addNavigationEntry( array( "id" => "files_index", "order" => 0, "href" => OCP\Util::linkTo( "files", "index.php" ), "icon" => OCP\Util::imagePath( "core", "places/home.svg" ), "name" => $l->t("Files") ));
OC_Search::registerProvider('OC_Search_Provider_File');
diff --git a/apps/files/index.php b/apps/files/index.php
index 9634a725866..3f97317fc5f 100755
--- a/apps/files/index.php
+++ b/apps/files/index.php
@@ -80,8 +80,8 @@ $breadcrumbNav = new OC_Template( "files", "part.breadcrumb", "" );
$breadcrumbNav->assign( "breadcrumb", $breadcrumb );
$breadcrumbNav->assign( "baseURL", OCP\Util::linkTo("files", "index.php")."?dir=");
-$upload_max_filesize = OC_Helper::computerFileSize(ini_get('upload_max_filesize'));
-$post_max_size = OC_Helper::computerFileSize(ini_get('post_max_size'));
+$upload_max_filesize = OCP\Util::computerFileSize(ini_get('upload_max_filesize'));
+$post_max_size = OCP\Util::computerFileSize(ini_get('post_max_size'));
$maxUploadFilesize = min($upload_max_filesize, $post_max_size);
$freeSpace=OC_Filesystem::free_space('/');
@@ -95,7 +95,7 @@ $tmpl->assign( 'dir', $dir);
$tmpl->assign( 'readonly', !OC_Filesystem::is_writable($dir));
$tmpl->assign( "files", $files );
$tmpl->assign( 'uploadMaxFilesize', $maxUploadFilesize);
-$tmpl->assign( 'uploadMaxHumanFilesize', OC_Helper::humanFileSize($maxUploadFilesize));
+$tmpl->assign( 'uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize));
$tmpl->assign( 'allowZipDownload', intval(OC_Config::getValue('allowZipDownload', true)));
$tmpl->printPage();
diff --git a/apps/files_archive/lib/storage.php b/apps/files_archive/lib/storage.php
index 700d9633042..7a4ae339621 100644..100755
--- a/apps/files_archive/lib/storage.php
+++ b/apps/files_archive/lib/storage.php
@@ -104,7 +104,7 @@ class OC_Filestorage_Archive extends OC_Filestorage_Common{
}
public function touch($path, $mtime=null){
if(is_null($mtime)){
- $tmpFile=OC_Helper::tmpFile();
+ $tmpFile=OCP\Util::tmpFile();
$this->archive->extractFile($path,$tmpFile);
$this->archive->addfile($path,$tmpFile);
}else{
diff --git a/apps/files_archive/lib/tar.php b/apps/files_archive/lib/tar.php
index 1eed11a762d..3a07a28906c 100644..100755
--- a/apps/files_archive/lib/tar.php
+++ b/apps/files_archive/lib/tar.php
@@ -93,7 +93,7 @@ class OC_Archive_TAR extends OC_Archive{
*/
function rename($source,$dest){
//no proper way to delete, rename entire archive, rename file and remake archive
- $tmp=OC_Helper::tmpFolder();
+ $tmp=OCP\Util::tmpFolder();
$this->tar->extract($tmp);
rename($tmp.$source,$tmp.$dest);
$this->tar=null;
@@ -177,7 +177,7 @@ class OC_Archive_TAR extends OC_Archive{
* @return bool
*/
function extractFile($path,$dest){
- $tmp=OC_Helper::tmpFolder();
+ $tmp=OCP\Util::tmpFolder();
if(!$this->fileExists($path)){
return false;
}
@@ -185,7 +185,7 @@ class OC_Archive_TAR extends OC_Archive{
if($success){
rename($tmp.$path,$dest);
}
- OC_Helper::rmdirr($tmp);
+ OCP\Util::rmdirr($tmp);
return $success;
}
/**
@@ -216,9 +216,9 @@ class OC_Archive_TAR extends OC_Archive{
return false;
}
//no proper way to delete, extract entire archive, delete file and remake archive
- $tmp=OC_Helper::tmpFolder();
+ $tmp=OCP\Util::tmpFolder();
$this->tar->extract($tmp);
- OC_Helper::rmdirr($tmp.$path);
+ OCP\Util::rmdirr($tmp.$path);
$this->tar=null;
unlink($this->path);
$this->reopen();
@@ -237,7 +237,7 @@ class OC_Archive_TAR extends OC_Archive{
}else{
$ext='';
}
- $tmpFile=OC_Helper::tmpFile($ext);
+ $tmpFile=OCP\Util::tmpFile($ext);
if($this->fileExists($path)){
$this->extractFile($path,$tmpFile);
}elseif($mode=='r' or $mode=='rb'){
diff --git a/apps/files_archive/lib/zip.php b/apps/files_archive/lib/zip.php
index dd94859f089..16f722a734e 100755
--- a/apps/files_archive/lib/zip.php
+++ b/apps/files_archive/lib/zip.php
@@ -169,7 +169,7 @@ class OC_Archive_ZIP extends OC_Archive{
}else{
$ext='';
}
- $tmpFile=OC_Helper::tmpFile($ext);
+ $tmpFile=OCP\Util::tmpFile($ext);
OC_CloseStreamWrapper::$callBacks[$tmpFile]=array($this,'writeBack');
if($this->fileExists($path)){
$this->extractFile($path,$tmpFile);
diff --git a/apps/files_archive/tests/archive.php b/apps/files_archive/tests/archive.php
index 9e99466a521..512afe9e915 100644..100755
--- a/apps/files_archive/tests/archive.php
+++ b/apps/files_archive/tests/archive.php
@@ -55,7 +55,7 @@ abstract class Test_Archive extends UnitTestCase {
$textFile=$dir.'/lorem.txt';
$this->assertEqual(file_get_contents($textFile),$this->instance->getFile('lorem.txt'));
- $tmpFile=OC_Helper::tmpFile('.txt');
+ $tmpFile=OCP\Util::tmpFile('.txt');
$this->instance->extractFile('lorem.txt',$tmpFile);
$this->assertEqual(file_get_contents($textFile),file_get_contents($tmpFile));
}
@@ -89,7 +89,7 @@ abstract class Test_Archive extends UnitTestCase {
$this->instance=$this->getNew();
$fh=$this->instance->getStream('lorem.txt','w');
$source=fopen($dir.'/lorem.txt','r');
- OC_Helper::streamCopy($source,$fh);
+ OCP\Util::streamCopy($source,$fh);
fclose($source);
fclose($fh);
$this->assertTrue($this->instance->fileExists('lorem.txt'));
@@ -109,13 +109,13 @@ abstract class Test_Archive extends UnitTestCase {
public function testExtract(){
$dir=OC::$SERVERROOT.'/apps/files_archive/tests/data';
$this->instance=$this->getExisting();
- $tmpDir=OC_Helper::tmpFolder();
+ $tmpDir=OCP\Util::tmpFolder();
$this->instance->extract($tmpDir);
$this->assertEqual(true,file_exists($tmpDir.'lorem.txt'));
$this->assertEqual(true,file_exists($tmpDir.'dir/lorem.txt'));
$this->assertEqual(true,file_exists($tmpDir.'logo-wide.png'));
$this->assertEqual(file_get_contents($dir.'/lorem.txt'),file_get_contents($tmpDir.'lorem.txt'));
- OC_Helper::rmdirr($tmpDir);
+ OCP\Util::rmdirr($tmpDir);
}
public function testMoveRemove(){
$dir=OC::$SERVERROOT.'/apps/files_archive/tests/data';
diff --git a/apps/files_archive/tests/storage.php b/apps/files_archive/tests/storage.php
index 4d0a83356bd..52d6a4296e9 100644..100755
--- a/apps/files_archive/tests/storage.php
+++ b/apps/files_archive/tests/storage.php
@@ -13,7 +13,7 @@ class Test_Filestorage_Archive_Zip extends Test_FileStorage {
private $tmpFile;
public function setUp(){
- $this->tmpFile=OC_Helper::tmpFile('.zip');
+ $this->tmpFile=OCP\Util::tmpFile('.zip');
$this->instance=new OC_Filestorage_Archive(array('archive'=>$this->tmpFile));
}
diff --git a/apps/files_archive/tests/tar.php b/apps/files_archive/tests/tar.php
index aa46455e659..c543c226bef 100644..100755
--- a/apps/files_archive/tests/tar.php
+++ b/apps/files_archive/tests/tar.php
@@ -16,7 +16,7 @@ if(is_dir(OC::$SERVERROOT.'/apps/files_archive/tests/data')){
}
protected function getNew(){
- return new OC_Archive_TAR(OC_Helper::tmpFile('.tar.gz'));
+ return new OC_Archive_TAR(OCP\Util::tmpFile('.tar.gz'));
}
}
}else{
diff --git a/apps/files_archive/tests/zip.php b/apps/files_archive/tests/zip.php
index 18a2997c1a5..b22ea3b79e9 100644..100755
--- a/apps/files_archive/tests/zip.php
+++ b/apps/files_archive/tests/zip.php
@@ -16,7 +16,7 @@ if(is_dir(OC::$SERVERROOT.'/apps/files_archive/tests/data')){
}
protected function getNew(){
- return new OC_Archive_ZIP(OC_Helper::tmpFile('.zip'));
+ return new OC_Archive_ZIP(OCP\Util::tmpFile('.zip'));
}
}
}else{
diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php
index 11a6a84e667..cbe88adb5e4 100755
--- a/apps/files_encryption/lib/proxy.php
+++ b/apps/files_encryption/lib/proxy.php
@@ -92,7 +92,7 @@ class OC_FileProxy_Encryption extends OC_FileProxy{
//first encrypt the target file so we don't end up with a half encrypted file
OCP\Util::writeLog('files_encryption','Decrypting '.$path.' before writing',OCP\Util::DEBUG);
$tmp=fopen('php://temp');
- OC_Helper::streamCopy($result,$tmp);
+ OCP\Util::streamCopy($result,$tmp);
fclose($result);
OC_Filesystem::file_put_contents($path,$tmp);
fclose($tmp);
@@ -104,7 +104,7 @@ class OC_FileProxy_Encryption extends OC_FileProxy{
public function postGetMimeType($path,$mime){
if(self::isEncrypted($path)){
- $mime=OC_Helper::getMimeType('crypt://'.$path,'w');
+ $mime=OCP\Util::getMimeType('crypt://'.$path,'w');
}
return $mime;
}
diff --git a/apps/files_encryption/tests/encryption.php b/apps/files_encryption/tests/encryption.php
index 13093256717..24b3bbcaf40 100644..100755
--- a/apps/files_encryption/tests/encryption.php
+++ b/apps/files_encryption/tests/encryption.php
@@ -27,14 +27,14 @@ class Test_Encryption extends UnitTestCase {
$this->assertNotEqual($encrypted,$source);
$this->assertEqual($decrypted,$source);
- $tmpFileEncrypted=OC_Helper::tmpFile();
+ $tmpFileEncrypted=OCP\Util::tmpFile();
OC_Crypt::encryptfile($file,$tmpFileEncrypted,$key);
$encrypted=file_get_contents($tmpFileEncrypted);
$decrypted=OC_Crypt::blockDecrypt($encrypted,$key);
$this->assertNotEqual($encrypted,$source);
$this->assertEqual($decrypted,$source);
- $tmpFileDecrypted=OC_Helper::tmpFile();
+ $tmpFileDecrypted=OCP\Util::tmpFile();
OC_Crypt::decryptfile($tmpFileEncrypted,$tmpFileDecrypted,$key);
$decrypted=file_get_contents($tmpFileDecrypted);
$this->assertEqual($decrypted,$source);
diff --git a/apps/files_encryption/tests/stream.php b/apps/files_encryption/tests/stream.php
index 578b091a36c..225e82c99e8 100644..100755
--- a/apps/files_encryption/tests/stream.php
+++ b/apps/files_encryption/tests/stream.php
@@ -22,7 +22,7 @@ class Test_CryptStream extends UnitTestCase {
$file=OC::$SERVERROOT.'/3rdparty/MDB2.php';
$source=fopen($file,'r');
$target=$this->getStream('test2','w');
- OC_Helper::streamCopy($source,$target);
+ OCP\Util::streamCopy($source,$target);
fclose($target);
fclose($source);
@@ -44,7 +44,7 @@ class Test_CryptStream extends UnitTestCase {
$id=uniqid();
}
if(!isset($this->tmpFiles[$id])){
- $file=OC_Helper::tmpFile();
+ $file=OCP\Util::tmpFile();
$this->tmpFiles[$id]=$file;
}else{
$file=$this->tmpFiles[$id];
diff --git a/apps/files_external/lib/ftp.php b/apps/files_external/lib/ftp.php
index 802446b4fd8..1618a22ba8a 100644..100755
--- a/apps/files_external/lib/ftp.php
+++ b/apps/files_external/lib/ftp.php
@@ -108,7 +108,7 @@ class OC_FileStorage_FTP extends OC_Filestorage_Common{
}else{
$ext='';
}
- $tmpFile=OC_Helper::tmpFile($ext);
+ $tmpFile=OCP\Util::tmpFile($ext);
OC_CloseStreamWrapper::$callBacks[$tmpFile]=array($this,'writeBack');
if($this->file_exists($path)){
$this->getFile($path,$tmpFile);
diff --git a/apps/files_external/lib/google.php b/apps/files_external/lib/google.php
index 0d6db1987f8..24a9d6c3d52 100644..100755
--- a/apps/files_external/lib/google.php
+++ b/apps/files_external/lib/google.php
@@ -84,7 +84,7 @@ class OC_Filestorage_Google extends OC_Filestorage_Common {
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
}
if ($isDownload) {
- $tmpFile = OC_Helper::tmpFile();
+ $tmpFile = OCP\Util::tmpFile();
$fp = fopen($tmpFile, 'w');
curl_setopt($curl, CURLOPT_FILE, $fp);
curl_exec($curl);
diff --git a/apps/files_external/lib/swift.php b/apps/files_external/lib/swift.php
index a987d17d799..aaba79d9b7b 100644..100755
--- a/apps/files_external/lib/swift.php
+++ b/apps/files_external/lib/swift.php
@@ -164,7 +164,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
* @return array
*/
private function getSubContainers($container){
- $tmpFile=OC_Helper::tmpFile();
+ $tmpFile=OCP\Util::tmpFile();
$obj=$this->getSubContainerFile($container);
try{
$obj->save_to_filename($tmpFile);
@@ -190,7 +190,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
if(!$name){
return false;
}
- $tmpFile=OC_Helper::tmpFile();
+ $tmpFile=OCP\Util::tmpFile();
$obj=$this->getSubContainerFile($container);
try{
$obj->save_to_filename($tmpFile);
@@ -225,7 +225,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
if(!$name){
return false;
}
- $tmpFile=OC_Helper::tmpFile();
+ $tmpFile=OCP\Util::tmpFile();
$obj=$this->getSubContainerFile($container);
try{
$obj->save_to_filename($tmpFile);
@@ -501,7 +501,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
private function getTmpFile($path){
$obj=$this->getObject($path);
if(!is_null($obj)){
- $tmpFile=OC_Helper::tmpFile();
+ $tmpFile=OCP\Util::tmpFile();
$obj->save_to_filename($tmpFile);
return $tmpFile;
}else{
diff --git a/apps/files_external/lib/webdav.php b/apps/files_external/lib/webdav.php
index 7a2da5c8ec0..75e5f80d217 100644..100755
--- a/apps/files_external/lib/webdav.php
+++ b/apps/files_external/lib/webdav.php
@@ -150,7 +150,7 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
}else{
$ext='';
}
- $tmpFile=OC_Helper::tmpFile($ext);
+ $tmpFile=OCP\Util::tmpFile($ext);
OC_CloseStreamWrapper::$callBacks[$tmpFile]=array($this,'writeBack');
if($this->file_exists($path)){
$this->getFile($path,$tmpFile);
diff --git a/apps/files_external/tests/ftp.php b/apps/files_external/tests/ftp.php
index e30fb9a1c38..d2d3622fa78 100644..100755
--- a/apps/files_external/tests/ftp.php
+++ b/apps/files_external/tests/ftp.php
@@ -23,7 +23,7 @@ if(!is_array($config) or !isset($config['ftp']) or !$config['ftp']['run']){
}
public function tearDown(){
- OC_Helper::rmdirr($this->instance->constructUrl(''));
+ OCP\Util::rmdirr($this->instance->constructUrl(''));
}
}
}
diff --git a/apps/gallery/appinfo/app.php b/apps/gallery/appinfo/app.php
index 8f657576224..ad4723c1425 100755
--- a/apps/gallery/appinfo/app.php
+++ b/apps/gallery/appinfo/app.php
@@ -38,7 +38,7 @@ OC_App::addNavigationEntry( array(
'id' => 'gallery_index',
'order' => 20,
'href' => OCP\Util::linkTo('gallery', 'index.php'),
- 'icon' => OC_Helper::imagePath('core', 'places/picture.svg'),
+ 'icon' => OCP\Util::imagePath('core', 'places/picture.svg'),
'name' => $l->t('Pictures')));
class OC_GallerySearchProvider extends OC_Search_Provider{
diff --git a/apps/media/appinfo/app.php b/apps/media/appinfo/app.php
index 11aeac2b5b4..5e7a411f677 100755
--- a/apps/media/appinfo/app.php
+++ b/apps/media/appinfo/app.php
@@ -29,6 +29,6 @@ OC_APP::registerPersonal('media','settings');
OC_App::register( array( 'order' => 3, 'id' => 'media', 'name' => 'Media' ));
-OC_App::addNavigationEntry(array('id' => 'media_index', 'order' => 2, 'href' => OCP\Util::linkTo('media', 'index.php'), 'icon' => OC_Helper::imagePath('core', 'places/music.svg'), 'name' => $l->t('Music')));
+OC_App::addNavigationEntry(array('id' => 'media_index', 'order' => 2, 'href' => OCP\Util::linkTo('media', 'index.php'), 'icon' => OCP\Util::imagePath('core', 'places/music.svg'), 'name' => $l->t('Music')));
OC_Search::registerProvider('OC_MediaSearchProvider');
diff --git a/apps/user_ldap/user_ldap.php b/apps/user_ldap/user_ldap.php
index 1e8dc6aacce..1e454ab682f 100644..100755
--- a/apps/user_ldap/user_ldap.php
+++ b/apps/user_ldap/user_ldap.php
@@ -87,7 +87,7 @@ class OC_USER_LDAP extends OC_User_Backend {
$quota = false;
}
$quota = $quota != -1 ? $quota : $this->ldap_quota_def;
- OC_Preferences::setValue($uid, 'files', 'quota', OC_Helper::computerFileSize($quota));
+ OC_Preferences::setValue($uid, 'files', 'quota', OCP\Util::computerFileSize($quota));
}
private function setEmail( $uid ) {