summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/db.php9
-rw-r--r--lib/filestorage/local.php1
-rw-r--r--lib/installer.php16
-rw-r--r--lib/preferences.php1
4 files changed, 12 insertions, 15 deletions
diff --git a/lib/db.php b/lib/db.php
index ef6d1dcc8b7..fa3995be125 100644
--- a/lib/db.php
+++ b/lib/db.php
@@ -161,9 +161,8 @@ class OC_DB {
// Die if we could not connect
if( PEAR::isError( self::$MDB2 )){
echo( '<b>can not connect to database, using '.$type.'. ('.self::$MDB2->getUserInfo().')</center>');
- $error = self::$MDB2->getMessage();
- error_log( $error);
- error_log( self::$MDB2->getUserInfo());
+ OC_Log::write('core',self::$MDB2->getUserInfo(),OC_Log::FATAL);
+ OC_Log::write('core',self::$MDB2->getMessage(),OC_Log::FATAL);
die( $error );
}
@@ -195,7 +194,7 @@ class OC_DB {
if( PEAR::isError($result)) {
$entry = 'DB Error: "'.$result->getMessage().'"<br />';
$entry .= 'Offending command was: '.$query.'<br />';
- error_log( $entry );
+ OC_Log::write('core',$entry,OC_Log::FATAL);
die( $entry );
}
}else{
@@ -204,7 +203,7 @@ class OC_DB {
}catch(PDOException $e){
$entry = 'DB Error: "'.$e->getMessage().'"<br />';
$entry .= 'Offending command was: '.$query.'<br />';
- error_log( $entry );
+ OC_Log::write('core',$entry,OC_Log::FATAL);
die( $entry );
}
$result=new PDOStatementWrapper($result);
diff --git a/lib/filestorage/local.php b/lib/filestorage/local.php
index 180b056f344..8e0907f8d3b 100644
--- a/lib/filestorage/local.php
+++ b/lib/filestorage/local.php
@@ -195,7 +195,6 @@ class OC_Filestorage_Local extends OC_Filestorage{
}
private function delTree($dir) {
- if(defined("DEBUG") && DEBUG) {error_log('del'.$dir);}
$dirRelative=$dir;
$dir=$this->datadir.$dir;
if (!file_exists($dir)) return true;
diff --git a/lib/installer.php b/lib/installer.php
index 0febb2cab46..242ca97934f 100644
--- a/lib/installer.php
+++ b/lib/installer.php
@@ -56,7 +56,7 @@ class OC_Installer{
*/
public static function installApp( $data = array()){
if(!isset($data['source'])){
- if(defined("DEBUG") && DEBUG) {error_log("No source specified when installing app");}
+ OC_Log::write('core','No source specified when installing app',OC_Log::ERROR);
return false;
}
@@ -64,13 +64,13 @@ class OC_Installer{
if($data['source']=='http'){
$path=tempnam(sys_get_temp_dir(),'oc_installer_');
if(!isset($data['href'])){
- if(defined("DEBUG") && DEBUG) {error_log("No href specified when installing app from http");}
+ OC_Log::write('core','No href specified when installing app from http',OC_Log::ERROR);
return false;
}
copy($data['href'],$path);
}else{
if(!isset($data['path'])){
- if(defined("DEBUG") && DEBUG) {error_log("No path specified when installing app from local file");}
+ OC_Log::write('core','No path specified when installing app from local file',OC_Log::ERROR);
return false;
}
$path=$data['path'];
@@ -85,7 +85,7 @@ class OC_Installer{
$zip->extractTo($extractDir);
$zip->close();
} else {
- if(defined("DEBUG") && DEBUG) {error_log("Failed to open archive when installing app");}
+ OC_Log::write('core','Failed to open archive when installing app',OC_Log::ERROR);
OC_Helper::rmdirr($extractDir);
if($data['source']=='http'){
unlink($path);
@@ -95,7 +95,7 @@ class OC_Installer{
//load the info.xml file of the app
if(!is_file($extractDir.'/appinfo/info.xml')){
- if(defined("DEBUG") && DEBUG) {error_log("App does not provide an info.xml file");}
+ OC_Log::write('core','App does not provide an info.xml file',OC_Log::ERROR);
OC_Helper::rmdirr($extractDir);
if($data['source']=='http'){
unlink($path);
@@ -107,7 +107,7 @@ class OC_Installer{
//check if an app with the same id is already installed
if(self::isInstalled( $info['id'] )){
- if(defined("DEBUG") && DEBUG) {error_log("App already installed");}
+ OC_Log::write('core','App already installed',OC_Log::WARN);
OC_Helper::rmdirr($extractDir);
if($data['source']=='http'){
unlink($path);
@@ -117,7 +117,7 @@ class OC_Installer{
//check if the destination directory already exists
if(is_dir($basedir)){
- if(defined("DEBUG") && DEBUG) {error_log("App's directory already exists");}
+ OC_Log::write('core','App directory already exists',OC_Log::WARN);
OC_Helper::rmdirr($extractDir);
if($data['source']=='http'){
unlink($path);
@@ -131,7 +131,7 @@ class OC_Installer{
//copy the app to the correct place
if(!mkdir($basedir)){
- if(defined("DEBUG") && DEBUG) {error_log('Can\'t create app folder ('.$basedir.')');}
+ OC_Log::write('core','Can\'t create app folder ('.$basedir.')',OC_Log::ERROR);
OC_Helper::rmdirr($extractDir);
if($data['source']=='http'){
unlink($path);
diff --git a/lib/preferences.php b/lib/preferences.php
index 6d8aa17afd5..75201f455ba 100644
--- a/lib/preferences.php
+++ b/lib/preferences.php
@@ -140,7 +140,6 @@ class OC_Preferences{
// Check if the key does exist
$query = OC_DB::prepare( 'SELECT configvalue FROM *PREFIX*preferences WHERE userid = ? AND appid = ? AND configkey = ?' );
$values=$query->execute(array($user,$app,$key))->fetchAll();
- if(defined("DEBUG") && DEBUG) {error_log(print_r($values,true));}
$exists=(count($values)>0);
if( !$exists ){