]> git.agnieray.net Git - galette.git/commitdiff
Replace PEAR::Log constants with KLogger ones
authorJohan Cwiklinski <johan@x-tnd.be>
Mon, 7 May 2012 22:17:06 +0000 (00:17 +0200)
committerJohan Cwiklinski <johan@x-tnd.be>
Tue, 8 May 2012 00:54:40 +0000 (02:54 +0200)
58 files changed:
galette/ajax_attendance_sheet_details.php
galette/ajax_group.php
galette/ajax_group_members.php
galette/ajax_groups.php
galette/ajax_mailing_preview.php
galette/ajax_members.php
galette/ajax_photo.php
galette/ajax_plugins_initdb.php
galette/ajax_recipients.php
galette/ajax_unique_group.php
galette/ajouter_adherent.php
galette/attendance_sheet.php
galette/carte_adherent.php
galette/config_fields.php
galette/configurer_fiches.php
galette/editer_champ.php
galette/etiquettes_adherents.php
galette/gestion_groupes.php
galette/get_export.php
galette/includes/dynamic_fields.inc.php
galette/includes/functions.inc.php
galette/includes/galette.inc.php
galette/includes/i18n.inc.php
galette/install/index.php
galette/lib/Galette/Core/Db.php
galette/lib/Galette/Core/Error.php
galette/lib/Galette/Core/GaletteMail.php
galette/lib/Galette/Core/History.php
galette/lib/Galette/Core/I18n.php
galette/lib/Galette/Core/Login.php
galette/lib/Galette/Core/Logo.php
galette/lib/Galette/Core/Mailing.php
galette/lib/Galette/Core/MailingHistory.php
galette/lib/Galette/Core/Pagination.php
galette/lib/Galette/Core/Password.php
galette/lib/Galette/Core/Picture.php
galette/lib/Galette/Core/Preferences.php
galette/lib/Galette/Entity/Adherent.php
galette/lib/Galette/Entity/Contribution.php
galette/lib/Galette/Entity/ContributionsTypes.php
galette/lib/Galette/Entity/FieldsCategories.php
galette/lib/Galette/Entity/FieldsConfig.php
galette/lib/Galette/Entity/Group.php
galette/lib/Galette/Entity/Politeness.php
galette/lib/Galette/Entity/Required.php
galette/lib/Galette/Entity/Status.php
galette/lib/Galette/Entity/Texts.php
galette/lib/Galette/Entity/Transaction.php
galette/lib/Galette/Filters/MembersList.php
galette/lib/Galette/IO/Csv.php
galette/lib/Galette/IO/News.php
galette/lib/Galette/Repository/Contributions.php
galette/lib/Galette/Repository/Groups.php
galette/lib/Galette/Repository/Members.php
galette/lib/Galette/Repository/Transactions.php
galette/mailing_adherents.php
galette/preferences.php
galette/traduire_libelles.php

index 1873421ab78bdd1ecc6feb01a734a6b32cda374a..f25ff222a44683e422180461e972bb4995fc16e4 100644 (file)
@@ -44,7 +44,7 @@ require_once 'includes/galette.inc.php';
 if ( !$login->isLogged() || !$login->isAdmin() && !$login->isStaff() ) {
     $log->log(
         'Trying to display ajax_attendance_sheet_details.php without appropriate permissions',
-        PEAR_LOG_INFO
+        KLogger::INFO
     );
     die();
 }
index ec533c95736ff857f5aeeff5691a2916488c8c2a..4c17c24b5d7e7f304c802fa55412ada30b799e69 100644 (file)
@@ -44,7 +44,7 @@ $id = get_numeric_form_value(Galette\Entity\Group::PK, '');
 if ( !$id ) {
     $log->log(
         'Trying to display ajax_group.php without groups specified',
-        PEAR_LOG_INFO
+        KLogger::INFO
     );
     die();
 }
@@ -54,7 +54,7 @@ if ( !$login->isLogged() || !$login->isAdmin() && !$login->isStaff()
 ) {
     $log->log(
         'Trying to display ajax_group.php without appropriate permissions',
-        PEAR_LOG_INFO
+        KLogger::INFO
     );
     die();
 }
@@ -89,7 +89,7 @@ if ( !isset($_POST['reorder']) ) {
     } else {
         $log->log(
             'Trying to reorder without target specified',
-            PEAR_LOG_INFO
+            KLogger::INFO
         );
         echo json_encode(array('success' => false));
         die();
index d072aa8222acdc21aa3d1c489d9d187cc876e2fd..02f9c40f85b8f14dc7f035a893fceef8716f97e6 100644 (file)
@@ -41,7 +41,7 @@ $mode = $_POST['person_mode'];
 if ( !$ids || !$mode ) {
     $log->log(
         'Trying to display ajax_group_members.php without persons or mode specified',
-        PEAR_LOG_INFO
+        KLogger::INFO
     );
     die();
 }
@@ -49,7 +49,7 @@ if ( !$ids || !$mode ) {
 if ( !$login->isLogged() || !$login->isAdmin() && !$login->isStaff() ) {
     $log->log(
         'Trying to display ajax_group_members.php without appropriate permissions',
-        PEAR_LOG_INFO
+        KLogger::INFO
     );
     die();
 }
index f9bb99407f00671a3a171e7b58d9fb75d0a8dd61..664974c190c852ff41976649eb91d2d15b897f8a 100644 (file)
@@ -46,7 +46,7 @@ if ( !$login->isLogged() || !$login->isAdmin() && !$login->isStaff()
 ) {
     $log->log(
         'Trying to display ajax_groups.php without appropriate permissions',
-        PEAR_LOG_INFO
+        KLogger::INFO
     );
     die();
 }
index 0bdc4630c45bfe12eca5c5349d265442e0c10b48..cd4042f80cfdc4469d76c0d13a1302042fc421cf 100644 (file)
@@ -42,7 +42,7 @@ require_once 'includes/galette.inc.php';
 if ( !$login->isLogged() || !$login->isAdmin() && !$login->isStaff() ) {
     $log->log(
         'Trying to display ajax_mailing_preview.php without appropriate permissions',
-        PEAR_LOG_INFO
+        KLogger::INFO
     );
     die();
 }
index 59a9373822dffa805c3d63d0a1469e55632deb8b..619ac68c82f75fcf37d6d2f7205d9e620b95036b 100644 (file)
@@ -45,7 +45,7 @@ require_once 'includes/galette.inc.php';
 if ( !$login->isLogged() || !$login->isAdmin() && !$login->isStaff() ) {
     $log->log(
         'Trying to display ajax_members.php without appropriate permissions',
-        PEAR_LOG_INFO
+        KLogger::INFO
     );
     die();
 }
@@ -98,7 +98,7 @@ if ( !isset($_POST['from']) ) {
         if ( !isset($_POST['gid']) ) {
             $log->log(
                 'Trying to list group members with no group id provided',
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             throw new Exception('A group id is required.');
             exit(0);
@@ -113,7 +113,7 @@ if ( !isset($_POST['from']) ) {
             } else {
                 $log->log(
                     'Trying to list group members with unknown mode',
-                    PEAR_LOG_ERR
+                    KLogger::ERR
                 );
                 throw new Exception('Unknown mode.');
                 exit(0);
index ef19502936fb8728814b4e42489333b394e248b6..5140801be726c2426aa82b0aa71cf0b058aaae20 100644 (file)
@@ -42,7 +42,7 @@ require_once 'includes/galette.inc.php';
 if ( !$login->isLogged() || !$login->isAdmin() && !$login->isStaff() ) {
     $log->log(
         'Trying to display ajax_members.php without appropriate permissions',
-        PEAR_LOG_INFO
+        KLogger::INFO
     );
     die();
 }
index ff7e4a0b3a043322deea037a8599749a5f44e42f..9f087f0e2dd8b5d39e1cb3007705dbbb9df7f50b 100644 (file)
@@ -42,14 +42,14 @@ require_once 'includes/galette.inc.php';
 if ( GALETTE_MODE === 'DEMO' ) {
     $log->log(
         'Trying to access ajax_plugins_initdb.php in DEMO mode.',
-        PEAR_LOG_WARNING
+        KLogger::WARN
     );
     die();
 }
 if ( !$login->isLogged() || !$login->isAdmin() ) {
     $log->log(
         'Trying to display ajax_members.php without appropriate permissions',
-        PEAR_LOG_INFO
+        KLogger::INFO
     );
     die();
 }
@@ -71,7 +71,7 @@ if ( $plugid !== null ) {
 if ( $plugin === null ) {
     $log->log(
         'Unable to load plugin `' . $plugid . '`!',
-        PEAR_LOG_EMERG
+        KLogger::EMERG
     );
     die();
 }
@@ -221,7 +221,7 @@ case 'u3':
                 $log->log(
                     'Error executing query | ' . $e->getMessage() .
                     ' | Query was: ' . $query,
-                    PEAR_LOG_WARNING
+                    KLogger::WARN
                 );
                 if ( (strcasecmp(trim($w1), 'drop') != 0)
                     && (strcasecmp(trim($w1), 'rename') != 0)
index 5eec6f3fba3cc44a4d46f8285df07e41c0f5c174..f609507f322e73d6da7f5b01b6dcb345fb969d05 100644 (file)
@@ -38,7 +38,7 @@ require_once 'includes/galette.inc.php';
 if ( !$login->isLogged() || !$login->isAdmin() && !$login->isStaff() ) {
     $log->log(
         'Trying to display ajax_recipients.php without appropriate permissions',
-        PEAR_LOG_INFO
+        KLogger::INFO
     );
     die();
 }
index da5b748a6324c1a0a4b567aec63b65d62152e4bc..885e55040c4070dd75ddf5f1524e8b7a3c2a33fd 100644 (file)
@@ -44,7 +44,7 @@ $name = $_POST['gname'];
 if ( !$name ) {
     $log->log(
         'Trying to check if group name is unique without name specified',
-        PEAR_LOG_INFO
+        KLogger::INFO
     );
     die();
 }
@@ -52,7 +52,7 @@ if ( !$name ) {
 if ( !$login->isLogged() || !$login->isAdmin() && !$login->isStaff() ) {
     $log->log(
         'Trying to display ajax_group.php without appropriate permissions',
-        PEAR_LOG_INFO
+        KLogger::INFO
     );
     die();
 }
index ea5ad62d4b80983f211065131d6b1512b6ecd6fd..6dec02bff4d62a686f2905f50c306fc7fb063e16 100644 (file)
@@ -222,20 +222,20 @@ if ( isset($_POST[array_shift($real_requireds)]) ) {
                         $log->log(
                             'Member .' . $member->sname . ' has been added to groups ' .
                             print_r($_POST['groups_adh'], true),
-                            PEAR_LOG_INFO
+                            KLogger::INFO
                         );
                     } else {
                         $log->log(
                             'Member .' . $member->sname . ' has been detached of ' .
                             'his groups.',
-                            PEAR_LOG_INFO
+                            KLogger::INFO
                         );
                     }
                 } else {
                     $log->log(
                         'Member .' . $member->sname . ' has not been added to groups ' .
                         print_r($_POST['groups_adh'], true),
-                        PEAR_LOG_ERR
+                        KLogger::ERR
                     );
                     $error_detected[] = _T("An error occured adding member to its groups.");
                 }
@@ -265,7 +265,7 @@ if ( isset($_POST[array_shift($real_requireds)]) ) {
             } else if ($_FILES['photo']['error'] !== UPLOAD_ERR_NO_FILE) {
                 $log->log(
                     $member->picture->getPhpErrorMessage($_FILES['photo']['error']),
-                    PEAR_LOG_WARNING
+                    KLogger::WARN
                 );
                 $error_detected[] = $member->picture->getPhpErrorMessage(
                     $_FILES['photo']['error']
index bd64a6dac2ff21741f1c10d80bd652fc93621752..87b3239448b8be1d6dfc2ec790c0206f8e85d5d7 100644 (file)
@@ -61,7 +61,7 @@ if ( isset($session['filters']['members']) ) {
 }
 
 if ( count($filters->selected) == 0 ) {
-    $log->log('No member selected to generate attendance sheet', PEAR_LOG_INFO);
+    $log->log('No member selected to generate attendance sheet', KLogger::INFO);
     header('location:gestion_adherents.php');
     die();
 }
index 3192b90ab3ba4f09f31ef5a463948959566c8863..cea149c06d4d9c948bb58149a968b3317d03ee43 100644 (file)
@@ -69,7 +69,7 @@ if ( isset($_GET[Galette\Entity\Adherent::PK])
     $unique = $_GET[Galette\Entity\Adherent::PK];
 } else {
     if ( count($filters->selected) == 0 ) {
-        $log->log('No member selected to generate members cards', PEAR_LOG_INFO);
+        $log->log('No member selected to generate members cards', KLogger::INFO);
         if ( $login->isAdmin() || $login->isStaff() ) {
             header('location:gestion_adherents.php');
         } else {
@@ -90,7 +90,7 @@ if ( isset($unique) && $unique ) {
 $members = Galette\Repository\Members::getArrayList($mailing_adh, array('nom_adh', 'prenom_adh'));
 
 if ( !is_array($members) || count($members) < 1 ) {
-    $log->log('An error has occured, unable to get members list.', PEAR_LOG_ERR);
+    $log->log('An error has occured, unable to get members list.', KLogger::ERR);
     die();
 }
 
index 10d3473ed9130ee9aab6b08881459cbe590bfbcf..6d3ae159ca39620272915a7339cbf698b851b396 100644 (file)
@@ -63,7 +63,7 @@ case 'members':
 default:
     $log->log(
         'Trying to configure fields on unknown table (' . $current . ')',
-        PEAR_LOG_WARNING
+        KLogger::WARN
     );
     break;
 }
index 9f5eda32231fc67f019da09bfa688f40c37da21b..76c1b4ecaa9546d45f97dd9462e36404f7094325 100644 (file)
@@ -129,7 +129,7 @@ if ( $form_name == '' ) {
                     $log->log(
                         'An error occured adding new dynamic field. | ' .
                         $e->getMessage(),
-                        PEAR_LOG_ERR
+                        KLogger::ERR
                     );
                 }
             }
@@ -226,7 +226,7 @@ if ( $form_name == '' ) {
                 $log->log(
                     'Unable to change field ' . $field_id . ' rank | ' .
                     $e->getMessage(),
-                    PEAR_LOG_ERR
+                    KLogger::ERR
                 );
             }
         }
index 3159b073599187abd365749588f5741079126a8b..017ae8b1c3c4bbef77e5fa04e06ac1daff2d9f50 100644 (file)
@@ -80,7 +80,7 @@ try {
     $log->log(
         'Unable to retrieve field `' . $field_id . '` informations | ' .
         $e->getMessage(),
-        PEAR_LOG_ERR
+        KLogger::ERR
     );
     $error_detected[] = _T("Unable to retrieve field informations.");
 }
@@ -117,7 +117,7 @@ if ( isset($_POST['valid']) ) {
             /** FIXME */
             $log->log(
                 'An error occured checking field duplicity' . $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
         }
 
@@ -157,7 +157,7 @@ if ( isset($_POST['valid']) ) {
                 /** FIXME */
                 $log->log(
                     'An error occured storing field | ' . $e->getMessage(),
-                    PEAR_LOG_ERR
+                    KLogger::ERR
                 );
                 $error_detected[] = _T("An error occured storing the field.");
             }
@@ -193,7 +193,7 @@ if ( isset($_POST['valid']) ) {
                 $log->log(
                     'Unable to manage fields values table ' .
                     $contents_table . ' | ' . $e->getMessage(),
-                    PEAR_LOG_ERR
+                    KLogger::ERR
                 );
                 $error_detected[] = _T("An error occured storing managing fields values table");
             }
@@ -220,7 +220,7 @@ if ( isset($_POST['valid']) ) {
                     $zdb->db->rollBack();
                     $log->log(
                         'Unable to store field ' . $field_id . ' values',
-                        PEAR_LOG_ERR
+                        KLogger::ERR
                     );
                 }
             }
@@ -258,7 +258,7 @@ if ( isset($_POST['valid']) ) {
         $log->log(
             'Unable to retrieve fields types for field ' . $field_id . ' | ' .
             $e->getMessage(),
-            PEAR_LOG_ERR
+            KLogger::ERR
         );
     }
 }
index 10ebc620cea9ff550bc376585bf27885e604ecec..95d3d77ab2479fd6855fea8b1769dbfc67266fc5 100644 (file)
@@ -66,7 +66,7 @@ if ( isset($_GET['from']) && $_GET['from'] === 'mailing' ) {
     $members = $mailing->unreachables;
 } else {
     if ( count($filters->selected) == 0 ) {
-        $log->log('No member selected to generate labels', PEAR_LOG_INFO);
+        $log->log('No member selected to generate labels', KLogger::INFO);
         header('location:gestion_adherents.php');
         die();
     }
index c07c10e1423b408075e1165be5b5dc81d99ebb4a..e8f67743639337706d1b862f24b186b120c623e0 100644 (file)
@@ -58,7 +58,7 @@ if ( $id !== null ) {
     } else {
         $log->log(
             'Trying to display group ' . $id . ' without appropriate permissions',
-            PEAR_LOG_INFO
+            KLogger::INFO
         );
         die();
     }
index 3a6202171f2b7509adf2aea4bfd1c8c718b50d1a..8cffce3d63eaabf7bc02a2622afa2dd4a2af3b82 100644 (file)
@@ -41,7 +41,7 @@ require_once 'includes/galette.inc.php';
 if ( !isset($_GET['file']) ) {
     $log->log(
         'No requested file',
-        PEAR_LOG_INFO
+        KLogger::INFO
     );
     header("HTTP/1.1 500 Internal Server Error");
     die();
@@ -64,7 +64,7 @@ if ( $login->isAdmin() || $login->isStaff() ) {
         $log->log(
             'A request has been made to get an exported file named `' .
             $filename .'` that does not exists.',
-            PEAR_LOG_WARNING
+            KLogger::WARN
         );
         header('HTTP/1.0 404 Not Found');        
     }
@@ -72,7 +72,7 @@ if ( $login->isAdmin() || $login->isStaff() ) {
     $log->log(
         'A non authorized person asked to retrieve exported file named `' .
         $filename . '`. Access ha not been granted.',
-        PEAR_LOG_WARNING
+        KLogger::WARN
     );
     header('HTTP/1.0 403 Forbidden');
 }
index 368fe2e5db5feec04166a2ca86fc8007f6d48739..8eab61796149fe268565187562b27c7f83aa0fec 100644 (file)
@@ -36,6 +36,8 @@
  * @since     Available since 0.63
  */
 
+use Galette\Common\KLogger as KLogger;
+
 /** TODO: functions names are *not* PEAR Coding Standards compliant.
 Anyways, this file needs a rewrite as an object, we won't spend
 too much time on it. */
@@ -147,11 +149,11 @@ function get_fixed_values($field_id)
         /** TODO */
         $log->log(
             'get_fixed_values | ' . $e->getMessage(),
-            PEAR_LOG_WARNING
+            KLogger::WARN
         );
         $log->log(
             'Query was: ' . $val_select->__toString() . ' ' . $e->__toString(),
-            PEAR_LOG_ERR
+            KLogger::ERR
         );
     }
 }
@@ -235,7 +237,7 @@ function set_dynamic_field(
             '; item_id:' . $item_id . '; field_id: ' . $field_id .
             '; val_index: ' . $val_index . '; field_val:' . $field_val .
             ' | Error was: ' . $e->getMessage(),
-            PEAR_LOG_ERR
+            KLogger::ERR
         );
         return false;
     }
@@ -315,11 +317,11 @@ function get_dynamic_fields($form_name, $item_id, $quote)
         /** TODO */
         $log->log(
             'get_dynamic_fields | ' . $e->getMessage(),
-            PEAR_LOG_WARNING
+            KLogger::WARN
         );
         $log->log(
             'Query was: ' . $select->__toString() . ' ' . $e->__toString(),
-            PEAR_LOG_ERR
+            KLogger::ERR
         );
     }
 }
@@ -424,11 +426,11 @@ function prepare_dynamic_fields_for_display(
         /** TODO */
         $log->log(
             'get_dynamic_fields | ' . $e->getMessage(),
-            PEAR_LOG_WARNING
+            KLogger::WARN
         );
         $log->log(
             'Query was: ' . $select->__toString() . ' ' . $e->__toString(),
-            PEAR_LOG_ERR
+            KLogger::ERR
         );
     }
 }
index ecfd1cc99499af349d4de93bfeff309402b588a5..7ef63464977f6037a4254183b2af213963d70255 100644 (file)
@@ -36,6 +36,8 @@
  * @link      http://galette.tuxfamily.org
  */
 
+use Galette\Common\KLogger as KLogger;
+
 function PasswordImageName($c)
 {
   return 'pw_' . md5($c) . '.png';
@@ -255,7 +257,7 @@ function get_numeric_form_value($name, $defval)
         $log->log(
             '[get_numeric_form_value] not a numeric value! (value was: `' .
             $val . '`)',
-            PEAR_LOG_INFO
+            KLogger::INFO
         );
         $val = $defval;
     }
index 43fac8318150c44a08cf34d8a1be9d9f27b09094..712b67ae6de8e4ba84beda475f38bfa740956ae0 100644 (file)
@@ -131,7 +131,7 @@ if ( version_compare(PHP_VERSION, '5.3.0', '<') ) {
     $log->log(
         'Galette is NOT compliant with your current PHP version. ' .
         'Galette requires PHP 5.3 minimum, current version is ' . phpversion(),
-        PEAR_LOG_EMERG
+        KLogger::EMERG
     );
     die();
 }
index 0e7418621f9f46fb5c6ceee2ad6c5982548f3229..05637049f5d1df87de0e20ca6fd291815e4ad0ac 100644 (file)
@@ -90,7 +90,7 @@ function addDynamicTranslation($text_orig, $error_detected)
                 $log->log(
                     'Entry for `' . $text_orig .
                     '` dynamic translation already exists.',
-                    PEAR_LOG_INFO
+                    KLogger::INFO
                 );
                 $zdb->db->update(
                     $l10n_table,
@@ -116,7 +116,7 @@ function addDynamicTranslation($text_orig, $error_detected)
         $log->log(
             'An error occured adding dynamic translation for `' .
             $text_orig . '` | ' . $e->getMessage(),
-            PEAR_LOG_ERR
+            KLogger::ERR
         );
         return false;
     }
@@ -152,7 +152,7 @@ function deleteDynamicTranslation($text_orig, $error_detected)
             'An error occured deleting dynamic translation for `' .
             $text_orig . '` (lang `' . $lang->getLongID() . '`) | ' .
             $e->getMessage(),
-            PEAR_LOG_ERR
+            KLogger::ERR
         );
         return false;
     }
@@ -196,7 +196,7 @@ function updateDynamicTranslation(
         $log->log(
             'An error occured updating dynamic translation for `' .
             $text_orig . '` | ' . $e->getMessage(),
-            PEAR_LOG_ERR
+            KLogger::ERR
         );
         return false;
     }
@@ -227,11 +227,11 @@ function getDynamicTranslation($text_orig, $text_locale)
         $log->log(
             'An error occured retrieving l10n entry. text_orig=' . $text_orig .
             ', text_locale=' . $text_locale . ' | ' . $e->getMessage(),
-            PEAR_LOG_WARNING
+            KLogger::WARN
         );
         $log->log(
             'Query was: ' . $select->__toString() . ' ' . $e->__toString(),
-            PEAR_LOG_ERR
+            KLogger::ERR
         );
         return false;
     }
index ba0358dea746a85fbbdd3bdab1679d939d308507..2ab1600630f9205bdc56bcf0b07dc7f64d862353 100644 (file)
@@ -836,7 +836,7 @@ case 'u7':
                 $log->log(
                     'Error executing query | ' . $e->getMessage() .
                     ' | Query was: ' . $query,
-                    PEAR_LOG_WARNING
+                    KLogger::WARN
                 );
                 echo '<li class="install-bad debuginfos">' . $w1 . ' ' . $w2 .
                     ' ' . $w3 . ' ' . $extra . '<span>' . $e->getMessage() .
index 9fb2f02f53ce9710b5948e3701d8e61d18111f06..50c19a481848b855d9cb9d9c36111b2add138980 100644 (file)
@@ -36,6 +36,8 @@
 
 namespace Galette\Core;
 
+use Galette\Common\Klogger as KLogger;
+
 /**
  * Zend_Db wrapper
  *
@@ -91,7 +93,7 @@ class Db extends \Zend_Db
             $this->_db->setFetchMode(\Zend_Db::FETCH_OBJ);
             $log->log(
                 '[ZendDb] Database connection was successfull!',
-                PEAR_LOG_DEBUG
+                KLogger::DEBUG
             );
         } catch (\Zend_Db_Adapter_Exception $e) {
             // perhaps a failed login credential, or perhaps the RDBMS is not running
@@ -99,7 +101,7 @@ class Db extends \Zend_Db
             $log->log(
                 '[ZendDb] No connexion (' . $ce->getCode() . '|' .
                 $ce->getMessage() . ')',
-                PEAR_LOG_ALERT
+                KLogger::ALERT
             );
             throw $e;
         } catch (\Exception $e) {
@@ -107,7 +109,7 @@ class Db extends \Zend_Db
             $log->log(
                 '[ZendDb] Error (' . $e->getCode() . '|' .
                 $e->getMessage() . ')',
-                PEAR_LOG_ALERT
+                KLogger::ALERT
             );
             throw $e;
         }
@@ -141,7 +143,7 @@ class Db extends \Zend_Db
         } catch ( \Exception $e ) {
             $log->log(
                 'Cannot check database version: ' . $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -235,7 +237,7 @@ class Db extends \Zend_Db
             $_db->closeConnection();
             $log->log(
                 '[' . __METHOD__ . '] Database connection was successfull!',
-                PEAR_LOG_DEBUG
+                KLogger::DEBUG
             );
             return true;
         } catch (\Zend_Db_Adapter_Exception $e) {
@@ -244,7 +246,7 @@ class Db extends \Zend_Db
             $log->log(
                 '[' . __METHOD__ . '] No connexion (' . $ce->getCode() . '|' .
                 $ce->getMessage() . ')',
-                PEAR_LOG_ALERT
+                KLogger::ALERT
             );
             return $e;
         } catch (\Exception $e) {
@@ -252,7 +254,7 @@ class Db extends \Zend_Db
             $log->log(
                 '[' . __METHOD__ . '] Error (' . $e->getCode() . '|' .
                 $e->getMessage() . ')',
-                PEAR_LOG_ALERT
+                KLogger::ALERT
             );
             return $e;
         }
@@ -270,11 +272,11 @@ class Db extends \Zend_Db
 
         try {
             $this->_db->query('DROP TABLE IF EXISTS galette_test');
-            $log->log('Test table successfully dropped.', PEAR_LOG_DEBUG);
+            $log->log('Test table successfully dropped.', KLogger::DEBUG);
         } catch (\Exception $e) {
             $log->log(
                 'Cannot drop test table! ' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
         }
     }
@@ -294,7 +296,7 @@ class Db extends \Zend_Db
 
         $log->log(
             'Check for database rights (mode ' . $mode . ')',
-            PEAR_LOG_DEBUG
+            KLogger::DEBUG
         );
         $stop = false;
         $results = array(
@@ -318,7 +320,7 @@ class Db extends \Zend_Db
             $this->_db->getConnection()->exec($sql);
             $results['create'] = true;
         } catch (\Exception $e) {
-            $log->log('Cannot CREATE TABLE', PEAR_LOG_WARNING);
+            $log->log('Cannot CREATE TABLE', KLogger::WARN);
             //if we cannot create tables, we cannot check other permissions
             $stop = true;
             $results['create'] = $e;
@@ -335,7 +337,7 @@ class Db extends \Zend_Db
                 } catch (\Exception $e) {
                     $log->log(
                         'Cannot ALTER TABLE | ' . $e->getMessage(),
-                        PEAR_LOG_WARNING
+                        KLogger::WARN
                     );
                     $results['alter'] = $e;
                 }
@@ -359,7 +361,7 @@ class Db extends \Zend_Db
             } catch (\Exception $e) {
                 $log->log(
                     'Cannot INSERT records | ' .$e->getMessage(),
-                    PEAR_LOG_WARNING
+                    KLogger::WARN
                 );
                 //if we cannot insert records, some others tests cannot be done
                 $stop = true;
@@ -386,7 +388,7 @@ class Db extends \Zend_Db
                 } catch (\Exception $e) {
                     $log->log(
                         'Cannot UPDATE records | ' .$e->getMessage(),
-                        PEAR_LOG_WARNING
+                        KLogger::WARN
                     );
                     $results['update'] = $e;
                 }
@@ -405,7 +407,7 @@ class Db extends \Zend_Db
                 } catch (\Exception $e) {
                     $log->log(
                         'Cannot SELECT records | ' . $e->getMessage(),
-                        PEAR_LOG_WARNING
+                        KLogger::WARN
                     );
                     $results['select'] = $e;
                 }
@@ -420,7 +422,7 @@ class Db extends \Zend_Db
                 } catch (\Exception $e) {
                     $log->log(
                         'Cannot DELETE records | ' .$e->getMessage(),
-                        PEAR_LOG_WARNING
+                        KLogger::WARN
                     );
                     $results['delete'] = $e;
                 }
@@ -434,7 +436,7 @@ class Db extends \Zend_Db
             } catch (\Exception $e) {
                 $log->log(
                     'Cannot DROP TABLE | ' . $e->getMessage(),
-                    PEAR_LOG_WARNING
+                    KLogger::WARN
                 );
                 $results['drop'] = $e;
             }
@@ -500,7 +502,7 @@ class Db extends \Zend_Db
                     $this->_db->getConnection()->exec($query);
                     $log->log(
                         'Charset successfully changed for table `' . $table .'`',
-                        PEAR_LOG_DEBUG
+                        KLogger::DEBUG
                     );
                 }
 
@@ -515,7 +517,7 @@ class Db extends \Zend_Db
             $log->log(
                 'An error occured while converting to utf table ' .
                 $table . ' (' . $e->getMessage() . ')',
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
         }
     }
@@ -540,7 +542,7 @@ class Db extends \Zend_Db
             $log->log(
                 'Cannot SET NAMES on table `' . $table . '`. ' .
                 $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
         }
 
@@ -616,7 +618,7 @@ class Db extends \Zend_Db
             $log->log(
                 'An error occured while converting contents to UTF-8 for table ' .
                 $table . ' (' . $e->getMessage() . ')',
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
         }
     }
index 0a4b175920a0f16bfe5c92149be86472987c1fe3..baf589467b3930048821bdbbf4ab8b65eefa156f 100644 (file)
@@ -37,6 +37,8 @@
 
 namespace Galette\Core;
 
+use Galette\Common\KLogger as KLogger;
+
 /**
  * Error handler
  *
@@ -76,7 +78,7 @@ class Error
                     array('Strict standards', $errstr, $errfile, $errline),
                     $str
                 ),
-                PEAR_LOG_INFO
+                KLogger::INFO
             );
             break;
         case E_DEPRECATED:
@@ -87,7 +89,7 @@ class Error
                     array('Deprecated', $errstr, $errfile, $errline),
                     $str
                 ),
-                PEAR_LOG_INFO
+                KLogger::INFO
             );
             break;
         case E_NOTICE:
@@ -101,7 +103,7 @@ class Error
                         array('Notice', $errstr, $errfile, $errline),
                         $str
                     ),
-                    PEAR_LOG_INFO
+                    KLogger::INFO
                 );
             }
             break;
@@ -113,7 +115,7 @@ class Error
                     array('Warning', $errstr, $errfile, $errline),
                     $str
                 ),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             break;
         case E_ERROR:
@@ -124,7 +126,7 @@ class Error
                     array('Fatal', $errstr, $errfile, $errline),
                     $str
                 ),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             exit("FATAL error $errstr at $errfile:$errline");
         default:
@@ -134,7 +136,7 @@ class Error
                     array('Unknown', $errstr, $errfile, $errline),
                     $str
                 ),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             exit("Unknown error at $errfile:$errline");
         }
index cbdfed4eb11606a8ab9f7ced7dbe1fea073fe1c4..1454cad2cdb6cdf4f1a4b4fa08be7769e31cbf38 100644 (file)
@@ -37,6 +37,8 @@
 
 namespace Galette\Core;
 
+use Galette\Common\KLogger as KLogger;
+
 /** @ignore */
 require_once 'class.phpmailer.php';
 require_once WEB_ROOT . 'includes/html2text.php';
@@ -117,7 +119,7 @@ class GaletteMail
                     $log->log(
                         '[' . get_class($this) .
                         ']No SMTP port provided. Switch to default (25).',
-                        PEAR_LOG_INFO
+                        KLogger::INFO
                     );
                     $this->_mail->Port = 25;
                 }
@@ -187,7 +189,7 @@ class GaletteMail
                 $log->log(
                     '[' . get_class($this) .
                     '] One of recipients adress is not valid.',
-                    PEAR_LOG_INFO
+                    KLogger::INFO
                 );
                 $this->_mail->ClearBCCs();
                 break;
@@ -277,7 +279,7 @@ class GaletteMail
                 $log->log(
                     'An error occured sending mail to: ' .
                     implode(', ', array_keys($this->_recipients)),
-                    PEAR_LOG_INFO
+                    KLogger::INFO
                 );
                 $this->_mail = null;
                 return self::MAIL_ERROR;
@@ -288,7 +290,7 @@ class GaletteMail
                 }
                 $log->log(
                     'A mail has been sent to: ' . $txt,
-                    PEAR_LOG_INFO
+                    KLogger::INFO
                 );
                 $this->_mail = null;
                 return self::MAIL_SENT;
@@ -296,7 +298,7 @@ class GaletteMail
         } catch (\Exception $e) {
             $log->log(
                 'Error sending message: ' . $e.getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             $this->errors[] = $e->getMessage();
             $this->_mail = null;
@@ -318,7 +320,7 @@ class GaletteMail
         if ( !$valid ) {
             $log->log(
                 '[GaletteMail] Adresss `' . $address . '` is not valid ',
-                PEAR_LOG_INFO
+                KLogger::INFO
             );
         }
         return $valid;
index 1c91c8c35a0fee7ce73e2ee76dbe5729e356b720..80a9486f8679d23b96ba21514569581fe179e2db 100644 (file)
@@ -37,6 +37,8 @@
 
 namespace Galette\Core;
 
+use Galette\Common\KLogger as KLogger;
+
 /**
  * History management
  *
@@ -120,13 +122,13 @@ class History extends Pagination
             $log->log(
                 'Unable to initialize add log entry into database.' .
                 $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             return false;
         } catch (\Exception $e) {
             $log->log(
                 "An error occured trying to add log entry. " . $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -149,7 +151,7 @@ class History extends Pagination
             if ( !$result ) {
                 $log->log(
                     'An error occured cleaning history. ',
-                    PEAR_LOG_WARNING
+                    KLogger::WARN
                 );
                 $this->add('Arror flushing logs');
                 return false;
@@ -160,7 +162,7 @@ class History extends Pagination
             /** TODO */
             $log->log(
                 'Unable to flush logs. | ' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
         }
     }
@@ -178,7 +180,7 @@ class History extends Pagination
             $c = $this->getCount();
 
             if ($c == 0) {
-                $log->log('No entry in history (yet?).', PEAR_LOG_DEBUG);
+                $log->log('No entry in history (yet?).', KLogger::DEBUG);
                 return;
             } else {
                 $this->counter = (int)$c;
@@ -197,11 +199,11 @@ class History extends Pagination
             /** TODO */
             $log->log(
                 'Unable to get history. | ' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $log->log(
                 'Query was: ' . $select->__toString() . ' ' . $e->__toString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -228,11 +230,11 @@ class History extends Pagination
             /** TODO */
             $log->log(
                 'Unable to get history count. | ' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $log->log(
                 'Query was: ' . $select->__toString() . ' ' . $e->__toString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -251,7 +253,7 @@ class History extends Pagination
 
         $log->log(
             '[History] Getting property `' . $name . '`',
-            PEAR_LOG_DEBUG
+            KLogger::DEBUG
         );
 
         if ( in_array($name, $this->pagination_fields) ) {
@@ -283,7 +285,7 @@ class History extends Pagination
             } else {
                 $log->log(
                     '[History] Unable to get proprety `' .$name . '`',
-                    PEAR_LOG_WARNING
+                    KLogger::WARN
                 );
             }
         }
@@ -305,7 +307,7 @@ class History extends Pagination
         } else {
             $log->log(
                 '[History] Setting property `' . $name . '`',
-                PEAR_LOG_DEBUG
+                KLogger::DEBUG
             );
 
             $forbidden = array();
@@ -324,7 +326,7 @@ class History extends Pagination
             } else {
                 $log->log(
                     '[History] Unable to set proprety `' .$name . '`',
-                    PEAR_LOG_WARNING
+                    KLogger::WARN
                 );
             }
         }
index eed163a09620f7a5c7fa264ce776ad2dcd144439..b20563c3979a441c25d593dfb35bb20089bbbd3c 100644 (file)
@@ -37,6 +37,8 @@
 
 namespace Galette\Core;
 
+use Galette\Common\KLogger as KLogger;
+
 /**
  * i18n handling
  *
@@ -110,7 +112,7 @@ class I18n
     public function changeLanguage($id)
     {
         global $log;
-        $log->log('Trying to set locale to ' . $id, PEAR_LOG_DEBUG);
+        $log->log('Trying to set locale to ' . $id, KLogger::DEBUG);
 
         $xml = simplexml_load_file($this->_file);
         $current = $xml->xpath(
@@ -121,7 +123,7 @@ class I18n
         if ( !isset($current[0]) ) {
             $log->log(
                 $id . ' does not exist in XML file, switching to default.',
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $id = self::DEFAULT_LANG;
             //do not forget to reload informations from the xml file
index 9e364e66adee8ac406852bb06be34ff12d244172..7b014be62e785bee299ddcab07fb2092822c6d86 100644 (file)
@@ -41,6 +41,7 @@ use Galette\Repository\Groups as Groups;
 use Galette\Repository\Members as Members;
 use Galette\Entity\Adherent as Adherent;
 use Galette\Entity\Status as Status;
+use Galette\Common\KLogger as KLogger;
 
 /**
  * Default authentication class for galette
@@ -105,18 +106,18 @@ class Login extends Authentication
             $select->where('mdp_adh = ?', $passe);
             $log->log(
                 'Login query: ' . $select->__toString(),
-                PEAR_LOG_DEBUG
+                KLogger::DEBUG
             );
             $row = $zdb->db->fetchRow($select);
 
             if ( $row === false ) {
                 $log->log(
                     'No entry found for login `' . $user . '`',
-                    PEAR_LOG_WARNING
+                    KLogger::WARN
                 );
                 return false;
             } else {
-                $log->log('User `' . $user . '` logged in.', PEAR_LOG_INFO);
+                $log->log('User `' . $user . '` logged in.', KLogger::INFO);
                 $this->id = $row->id_adh;
                 $this->login = $user;
                 $this->passe = $row->mdp_adh;
@@ -160,16 +161,16 @@ class Login extends Authentication
         } catch (\Zend_Db_Adapter_Exception $e) {
             $log->log(
                 'An error occured: ' . $e->getChainedException()->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
-            $log->log($e->getTrace(), PEAR_LOG_ERR);
+            $log->log($e->getTrace(), KLogger::ERR);
             return false;
         } catch(\Exception $e) {
             $log->log(
                 'An error occured: ' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
-            $log->log($e->getTrace(), PEAR_LOG_ERR);
+            $log->log($e->getTrace(), KLogger::ERR);
             return false;
         }
     }
@@ -202,11 +203,11 @@ class Login extends Authentication
         } catch (\Exception $e) {
             $log->log(
                 'Cannot check if login exists | ' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $log->log(
                 'Query was: ' . $select->__toString() . ' ' . $e->__toString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             /* If an error occurs, we consider that username already exists */
             return true;
index 80d805bb40dae27e695ce6d469d392d8c5dbe768..e21b7fbd9ca58a085579df804f80282952c77c47 100644 (file)
@@ -37,6 +37,8 @@
 
 namespace Galette\Core;
 
+use Galette\Common\KLogger as KLogger;
+
 /**
  * This class stores and serve the logo.
  * If no custom logo is found, we take galette's default one.
index 01bf227913e443550c846b17aeef7015a3d31e6b..d834405fa905974225e12fbe9e12925d7160cacd 100644 (file)
@@ -37,6 +37,8 @@
 
 namespace Galette\Core;
 
+use Galette\Common\KLogger as KLogger;
+
 /**
  * Mailing features
  *
@@ -169,7 +171,7 @@ class Mailing extends GaletteMail
                 $log->log(
                     '[' . get_class($this) . 'Trying to get ' . $name .
                     ' renamed: ' . $rname,
-                    PEAR_LOG_DEBUG
+                    KLogger::DEBUG
                 );
                 return $this->$rname;
                 break;
@@ -178,7 +180,7 @@ class Mailing extends GaletteMail
             $log->log(
                 '[' . get_class($this) . 'Unable to get ' . $name .
                 ' renamed: ' . $rname,
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -212,7 +214,7 @@ class Mailing extends GaletteMail
                     '[' . get_class($this) . '] Value for field `' . $name .
                     '` should be boolean - (' . gettype($value) . ')' .
                     $value . ' given',
-                    PEAR_LOG_WARNING
+                    KLogger::WARN
                 );
             }
             break;
@@ -235,14 +237,14 @@ class Mailing extends GaletteMail
                     '[' . get_class($this) . '] Value for field `' . $name .
                     '` should be integer and know - (' . gettype($value) . ')' .
                     $value . ' given',
-                    PEAR_LOG_WARNING
+                    KLogger::WARN
                 );
             }
             break;
         default:
             $log->log(
                 '[' . get_class($this) . '] Unable to set proprety `' . $name . '`',
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             break;
         }
index 8632765ced385cd97e64c48bf9c09e6fdd48cbc8..3fc69d6093d4226ea2466ef5b439f426ba532124 100644 (file)
@@ -36,6 +36,8 @@
  */
 
 namespace Galette\Core;
+
+use Galette\Common\KLogger as KLogger;
 use Galette\Entity\Adherent;
 
 /**
@@ -82,7 +84,7 @@ class MailingHistory extends History
             $log->log(
                 '[' . __METHOD__ .
                 '] Mailing should be either null or an instance of Mailing',
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
         }
     }
@@ -110,7 +112,7 @@ class MailingHistory extends History
             $c = $this->getCount();
 
             if ($c == 0) {
-                $log->log('No entry in history (yet?).', PEAR_LOG_DEBUG);
+                $log->log('No entry in history (yet?).', KLogger::DEBUG);
                 return;
             } else {
                 $this->counter = (int)$c;
@@ -161,11 +163,11 @@ class MailingHistory extends History
             /** TODO */
             $log->log(
                 'Unable to get history. | ' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $log->log(
                 'Query was: ' . $select->__toString() . ' ' . $e->__toString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -203,7 +205,7 @@ class MailingHistory extends History
             $log->log(
                 'Unable to load mailing model #' . $id . ' | ' .
                 $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             return false;
         }
@@ -232,7 +234,7 @@ class MailingHistory extends History
             $log->log(
                 '[' . __METHOD__ .
                 '] Mailing should be either null or an instance of Mailing',
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -268,7 +270,7 @@ class MailingHistory extends History
         } catch (\Exception $e) {
             $log->log(
                 'An error occurend storing Mailing | ' . $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -318,7 +320,7 @@ class MailingHistory extends History
                 $log->log(
                     'Unable to delete selected mailing history entries |' .
                     $e->getMessage(),
-                    PEAR_LOG_ERR
+                    KLogger::ERR
                 );
                 return false;
             }
@@ -326,7 +328,7 @@ class MailingHistory extends History
             //not numeric and not an array: incorrect.
             $log->log(
                 'Asking to remove mailing entries, but without providing an array or a single numeric value.',
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             return false;
         }
index b1ec0049a562693f0eb0da9dae25e9b2a64c186e..d23410269e460d904cc4c3b0083de2af3bf2e078 100644 (file)
@@ -37,6 +37,8 @@
 
 namespace Galette\Core;
 
+use Galette\Common\KLogger as KLogger;
+
 /**
  * Pagination and ordering facilities
  *
@@ -143,7 +145,7 @@ abstract class Pagination
             $log->log(
                 'Trying to set a sort direction that is not know (`' .
                 $direction . '`). Reverting to default value.',
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $this->_ordered == self::ORDER_ASC;
         }
@@ -273,7 +275,7 @@ abstract class Pagination
         $log->log(
             '[' . get_class($this) .
             '|Pagination] Getting property `' . $name . '`',
-            PEAR_LOG_DEBUG
+            KLogger::DEBUG
         );
 
         if ( in_array($name, $this->pagination_fields) ) {
@@ -283,7 +285,7 @@ abstract class Pagination
             $log->log(
                 '[' . get_class($this) .
                 '|Pagination] Unable to get proprety `' .$name . '`',
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
         }
     }
@@ -303,7 +305,7 @@ abstract class Pagination
         $log->log(
             '[' . get_class($this) . '|Pagination] Setting property `' .
             $name . '`',
-            PEAR_LOG_DEBUG
+            KLogger::DEBUG
         );
 
         $rname = '_' . $name;
@@ -317,7 +319,7 @@ abstract class Pagination
                     '|Pagination] Possibles values for field `' .
                     $name . '` are: `' . self::ORDER_ASC . '` or `' .
                     self::ORDER_DESC . '` - `' . $value . '` given',
-                    PEAR_LOG_WARNING
+                    KLogger::WARN
                 );
             }
             break;
@@ -340,7 +342,7 @@ abstract class Pagination
                     '|Pagination] Value for field `' .
                     $name . '` should be a positive integer - (' .
                     gettype($value) . ')' . $value . ' given',
-                    PEAR_LOG_WARNING
+                    KLogger::WARN
                 );
             }
             break;
@@ -355,7 +357,7 @@ abstract class Pagination
                     '[' . get_class($this) . '|Pagination] Value for `' .
                     $name . '` should be a positive integer or \'all\' - (' .
                     gettype($value) . ')' . $value . ' given',
-                    PEAR_LOG_WARNING
+                    KLogger::WARN
                 );
             }
             break;
@@ -363,7 +365,7 @@ abstract class Pagination
             $log->log(
                 '[' . get_class($this) .
                 '|Pagination] Unable to set proprety `' . $name . '`',
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             break;
         }
index c3853eccafe46c60145def433668e3a456ed9cf1..cf2e43400caf63f2ff019f0fc489e31181c97f86 100644 (file)
@@ -40,6 +40,7 @@
 
 namespace Galette\Core;
 
+use Galette\Common\KLogger as KLogger;
 use Galette\Entity\Adherent;
 
 /**
@@ -125,7 +126,7 @@ class Password
             if ( $del ) {
                 $log->log(
                     'Temporary passwords for `' . $id_adh . '` has been removed.',
-                    PEAR_LOG_DEBUG
+                    KLogger::DEBUG
                 );
             }
         } catch (\Exception $e) {
@@ -133,7 +134,7 @@ class Password
             $log->log(
                 'An error has occured removing old tmppasswords ' .
                 $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -168,7 +169,7 @@ class Password
             if ( $add ) {
                 $log->log(
                     'New passwords temporary set for `' . $id_adh . '`.',
-                    PEAR_LOG_DEBUG
+                    KLogger::DEBUG
                 );
                 $this->_new_password = $password;
                 $this->_hash = $hash;
@@ -180,14 +181,14 @@ class Password
             $log->log(
                 'Unable to add add new password entry into database.' .
                 $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             return false;
         } catch (\Exception $e) {
             $log->log(
                 "An error occured trying to add temporary password entry. " .
                 $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -216,7 +217,7 @@ class Password
             if ( $del ) {
                 $log->log(
                     'Old Temporary passwords has been deleted.',
-                    PEAR_LOG_DEBUG
+                    KLogger::DEBUG
                 );
             }
         } catch (\Exception $e) {
@@ -224,7 +225,7 @@ class Password
             $log->log(
                 'An error occured deleting expired temporary passwords. ' .
                 $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             return false;
         }
@@ -252,7 +253,7 @@ class Password
             /** TODO */
             $log->log(
                 'An error occured getting requested hash. ' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             return false;
         }
@@ -280,7 +281,7 @@ class Password
             if ( $del ) {
                 $log->log(
                     'Used hash has been successfully remove',
-                    PEAR_LOG_DEBUG
+                    KLogger::DEBUG
                 );
                 return true;
             }
@@ -289,7 +290,7 @@ class Password
             $log->log(
                 'An error ocured attempting to delete used hash' .
                 $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             return false;
         }
index 8a1666d0ebfea3b8656117844f88a5a906ce130a..15be57df7a7d2eb7de25ba25fbed394a241ea34b 100644 (file)
@@ -38,6 +38,7 @@
 namespace Galette\Core;
 
 use Galette\Entity\Adherent;
+use Galette\Common\KLogger as KLogger;
 
 /**
  * Picture handling
@@ -360,7 +361,7 @@ class Picture
                     }
                     $log->log(
                         'The file ' . $_file . ' was found on the disk but cannot be removed.',
-                        PEAR_LOG_ERR
+                        KLogger::ERR
                     );
                     return false;
                 } else {
@@ -385,7 +386,7 @@ class Picture
             $log->log(
                 'An error occured attempting to delete picture ' . $this->db_id .
                 'from database | ' . $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -418,7 +419,7 @@ class Picture
         if ( preg_match($reg, $name, $matches) ) {
             $log->log(
                 '[' . $class . '] Filename and extension are OK, proceed.',
-                PEAR_LOG_DEBUG
+                KLogger::DEBUG
             );
             $extension = $matches[2];
             if ( $extension == 'jpeg' ) {
@@ -447,7 +448,7 @@ class Picture
 
             $log->log(
                 $err_msg,
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return $ret;
         }
@@ -458,11 +459,11 @@ class Picture
                 '[' . $class . '] File is too big (' . ( $file['size'] * 1024 ) .
                 'Ko for maximum authorized ' . ( $class::MAX_FILE_SIZE * 1024 ) .
                 'Ko',
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return self::FILE_TOO_BIG;
         } else {
-            $log->log('[' . $class . '] Filesize is OK, proceed', PEAR_LOG_DEBUG);
+            $log->log('[' . $class . '] Filesize is OK, proceed', KLogger::DEBUG);
         }
 
         $current = getimagesize($tmpfile);
@@ -470,13 +471,13 @@ class Picture
         if ( !in_array($current['mime'], $this->_allowed_mimes) ) {
             $log->log(
                 '[' . $class . '] Mimetype `' . $current['mime'] . '` not allowed',
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return self::MIME_NOT_ALLOWED;
         } else {
             $log->log(
                 '[' . $class . '] Mimetype is allowed, proceed',
-                PEAR_LOG_DEBUG
+                KLogger::DEBUG
             );
         }
 
@@ -521,7 +522,7 @@ class Picture
             $log->log(
                 'An error occured storing picture in database: ' .
                 $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return self::SQL_ERROR;
         }
@@ -558,7 +559,7 @@ class Picture
                     $log->log(
                         '[' . $class . '] GD has no JPEG Support - ' .
                         'pictures could not be resized!',
-                        PEAR_LOG_ERR
+                        KLogger::ERR
                     );
                     return false;
                 }
@@ -568,7 +569,7 @@ class Picture
                     $log->log(
                         '[' . $class . '] GD has no PNG Support - ' .
                         'pictures could not be resized!',
-                        PEAR_LOG_ERR
+                        KLogger::ERR
                     );
                     return false;
                 }
@@ -578,7 +579,7 @@ class Picture
                     $log->log(
                         '[' . $class . '] GD has no GIF Support - ' .
                         'pictures could not be resized!',
-                        PEAR_LOG_ERR
+                        KLogger::ERR
                     );
                     return false;
                 }
@@ -633,7 +634,7 @@ class Picture
             $log->log(
                 '[' . $class . '] GD is not present - ' .
                 'pictures could not be resized!',
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
         }
     }
index 861e634588fde12c8e57a65d2625d6b52641bc26..dacc468466cd4a59aa29396fa6666010b8cca85b 100644 (file)
@@ -37,6 +37,7 @@
 
 namespace Galette\Core;
 
+use Galette\Common\KLogger as KLogger;
 use Galette\Entity\Adherent as Adherent;
 
 /**
@@ -178,7 +179,7 @@ class Preferences
                 $this->_prefs[$k] = $v;
                 $log->log(
                     'The field `' . $k . '` does not exists, Galette will attempt to create it.',
-                    PEAR_LOG_INFO
+                    KLogger::INFO
                 );
                 $proceed = true;
                 $params[] = array(
@@ -205,14 +206,14 @@ class Preferences
             } catch (\Exception $e) {
                 $log->log(
                     'Unable to add missing preferences.' . $e->getMessage(),
-                    PEAR_LOG_WARNING
+                    KLogger::WARN
                 );
                 return false;
             }
 
             $log->log(
                 'Missing preferences were successfully stored into database.',
-                PEAR_LOG_INFO
+                KLogger::INFO
             );
         }
     }
@@ -239,7 +240,7 @@ class Preferences
             $log->log(
                 'Preferences cannot be loaded. Galette should not work without ' .
                 'preferences. Exiting.',
-                PEAR_LOG_EMERG
+                KLogger::EMERG
             );
             return false;
         }
@@ -282,13 +283,13 @@ class Preferences
 
             $log->log(
                 'Default preferences were successfully stored into database.',
-                PEAR_LOG_INFO
+                KLogger::INFO
             );
             return true;
         } catch (\Exception $e) {
             $log->log(
                 'Unable to initialize default preferences.' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             return $e;
         }
@@ -321,7 +322,7 @@ class Preferences
             );
 
             foreach ( self::$_defaults as $k=>$v ) {
-                $log->log('Storing ' . $k, PEAR_LOG_DEBUG);
+                $log->log('Storing ' . $k, KLogger::DEBUG);
                 $stmt->bindValue(':value', $this->_prefs[$k], \PDO::PARAM_STR);
                 $stmt->bindValue(':name', $k, \PDO::PARAM_STR);
 
@@ -329,18 +330,18 @@ class Preferences
             }
             $log->log(
                 'Preferences were successfully stored into database.',
-                PEAR_LOG_INFO
+                KLogger::INFO
             );
             return true;
         } catch (\Exception $e) {
             /** TODO */
             $log->log(
                 'Unable to store preferences | ' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $log->log(
                 $e->__toString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -482,7 +483,7 @@ class Preferences
         } else {
             $log->log(
                 'Preference `' . $name . '` is not set or is forbidden',
-                PEAR_LOG_INFO
+                KLogger::INFO
             );
             return false;
         }
@@ -505,7 +506,7 @@ class Preferences
             $log->log(
                 'Trying to set a preference value which does not seems to exist ('
                 . $name . ')',
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             return false;
         }
index d34d8a3223182dc67624aed70db67fa256ce6595..7760b21af27e68a390b62c941ed4c0a80be02f35 100644 (file)
@@ -37,6 +37,7 @@
 
 namespace Galette\Entity;
 
+use Galette\Common\KLogger as KLogger;
 use Galette\Core\Picture as Picture;
 use Galette\Core\GaletteMail as GaletteMail;
 use Galette\Core\Password as Password;
@@ -523,11 +524,11 @@ class Adherent
             /** TODO */
             $log->log(
                 'Cannot load member form id `' . $id . '` | ' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $log->log(
                 'Query was: ' . $select->__toString() . ' ' . $e->__toString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -561,11 +562,11 @@ class Adherent
             $log->log(
                 'Cannot load member form login `' . $login . '` | ' .
                 $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $log->log(
                 'Query was: ' . $select->__toString() . ' ' . $e->__toString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -887,11 +888,11 @@ class Adherent
             $log->log(
                 'Cannot get formatted name for member form id `' . $id . '` | ' .
                 $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $log->log(
                 'Query was: ' . $select->__toString() . ' ' . $e->__toString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -917,7 +918,7 @@ class Adherent
             );
             $log->log(
                 'Password for `' . $id_adh . '` has been updated.',
-                PEAR_LOG_DEBUG
+                KLogger::DEBUG
             );
             return true;
         } catch (\Exception $e) {
@@ -925,7 +926,7 @@ class Adherent
             $log->log(
                 'An error occured while updating password for `' . $id_adh .
                 '` | ' . $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -1031,7 +1032,7 @@ class Adherent
                                 'Wrong date format. field: ' . $key .
                                 ', value: ' . $value . ', expected fmt: ' .
                                 _T("Y-m-d") . ' | ' . $e->getMessage(),
-                                PEAR_LOG_INFO
+                                KLogger::INFO
                             );
                             $errors[] = str_replace(
                                 array(
@@ -1072,11 +1073,11 @@ class Adherent
                             } catch (\Exception $e) {
                                 $log->log(
                                     'An error occured checking member email unicity.',
-                                    PEAR_LOG_ERR
+                                    KLogger::ERR
                                 );
                                 $log->log(
                                     'Query was: ' . $select->__toString(),
-                                    PEAR_LOG_INFO
+                                    KLogger::INFO
                                 );
                                 $errors[] = _T("An error has occured while looking if login already exists.");
                             }
@@ -1120,11 +1121,11 @@ class Adherent
                                 } catch (\Exception $e) {
                                     $log->log(
                                         'An error occured checking member login unicity.',
-                                        PEAR_LOG_ERR
+                                        KLogger::ERR
                                     );
                                     $log->log(
                                         'Query was: ' . $select->__toString(),
-                                        PEAR_LOG_INFO
+                                        KLogger::INFO
                                     );
                                     $errors[] = _T("An error has occured while looking if login already exists.");
                                 }
@@ -1167,13 +1168,13 @@ class Adherent
             $log->log(
                 'Some errors has been throwed attempting to edit/store a member' .
                 print_r($errors, true),
-                PEAR_LOG_DEBUG
+                KLogger::DEBUG
             );
             return $errors;
         } else {
             $log->log(
                 'Member checked successfully.',
-                PEAR_LOG_DEBUG
+                KLogger::DEBUG
             );
             return true;
         }
@@ -1279,7 +1280,7 @@ class Adherent
             $log->log(
                 'Something went wrong :\'( | ' . $e->getMessage() . "\n" .
                 $e->getTraceAsString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -1305,7 +1306,7 @@ class Adherent
             $log->log(
                 'Something went wrong updating modif date :\'( | ' .
                 $e->getMessage() . "\n" . $e->getTraceAsString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
         }
     }
index 5db79d1f851208cb1489c1cc6965ebecbccf86b8..8980bd150b37f5c42cfcbf531dd2997bf49f20a1 100644 (file)
@@ -37,6 +37,8 @@
 
 namespace Galette\Entity;
 
+use Galette\Common\KLogger as KLogger;
+
 /**
  * Contribution class for galette
  *
@@ -246,7 +248,7 @@ class Contribution
             $log->log(
                 'An error occured attempting to load contribution #' . $id .
                 $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -346,7 +348,7 @@ class Contribution
                                 'Wrong date format. field: ' . $key .
                                 ', value: ' . $value . ', expected fmt: ' .
                                 _T("Y-m-d") . ' | ' . $e->getMessage(),
-                                PEAR_LOG_INFO
+                                KLogger::INFO
                             );
                             $errors[] = str_replace(
                                 array(
@@ -433,13 +435,13 @@ class Contribution
             $log->log(
                 'Some errors has been throwed attempting to edit/store a contribution' .
                 print_r($errors, true),
-                PEAR_LOG_DEBUG
+                KLogger::DEBUG
             );
             return $errors;
         } else {
             $log->log(
                 'Contribution checked successfully.',
-                PEAR_LOG_DEBUG
+                KLogger::DEBUG
             );
             return true;
         }
@@ -489,11 +491,11 @@ class Contribution
             /** FIXME */
             $log->log(
                 'An error occured checking overlaping fee. ' . $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             $log->log(
                 'Query was: ' . $select->__toString(),
-                PEAR_LOG_DEBUG
+                KLogger::DEBUG
             );
             return false;
         }
@@ -588,7 +590,7 @@ class Contribution
             $log->log(
                 'Something went wrong :\'( | ' . $e->getMessage() . "\n" .
                 $e->getTraceAsString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -623,7 +625,7 @@ class Contribution
                 'An error occured updating member ' . $this->_member .
                 '\'s deadline |' .
                 $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -663,7 +665,7 @@ class Contribution
             $log->log(
                 'An error occured trying to remove contribution #' .
                 $this->_id . ' | ' . $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -733,7 +735,7 @@ class Contribution
             /** FIXME */
             $log->log(
                 'An error occured trying to retrieve member\'s due date',
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -765,7 +767,7 @@ class Contribution
                 $log->log(
                     'Contribution #' . $contrib_id .
                     ' is not actually part of transaction #' . $trans_id,
-                    PEAR_LOG_WARNING
+                    KLogger::WARN
                 );
                 return false;
             }
@@ -773,7 +775,7 @@ class Contribution
             $log->log(
                 'Unable to detach contribution #' . $contrib_id .
                 ' to transaction #' . $trans_id . ' | ' . $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -802,7 +804,7 @@ class Contribution
             $log->log(
                 'Unable to attach contribution #' . $contrib_id .
                 ' to transaction #' . $trans_id . ' | ' . $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -876,7 +878,7 @@ class Contribution
                         $log->log(
                             'Bad date (' . $his->$rname . ') | ' .
                             $e->getMessage(),
-                            PEAR_LOG_INFO
+                            KLogger::INFO
                         );
                         return $this->$rname;
                     }
@@ -915,7 +917,7 @@ class Contribution
                 default:
                     $log->log(
                         'Unknown payment type ' . $this->_payment_type,
-                        PEAR_LOG_WARNING
+                        KLogger::WARN
                     );
                     return '-';
                     break;
@@ -951,7 +953,7 @@ class Contribution
                 } else {
                     $log->log(
                         'Trying to set a transaction from an id that is not an integer.',
-                        PEAR_LOG_WARNING
+                        KLogger::WARN
                     );
                 }
                 break;
@@ -968,7 +970,7 @@ class Contribution
                 } else {
                     $log->log(
                         'Trying to set a type from an id that is not an integer.',
-                        PEAR_LOG_WARNING
+                        KLogger::WARN
                     );
                 }
                 break;
@@ -984,7 +986,7 @@ class Contribution
                         'Wrong date format. field: ' . $key .
                         ', value: ' . $value . ', expected fmt: ' .
                         _T("Y-m-d") . ' | ' . $e->getMessage(),
-                        PEAR_LOG_INFO
+                        KLogger::INFO
                     );
                     $errors[] = str_replace(
                         array(
@@ -1006,7 +1008,7 @@ class Contribution
                     $log->log(
                         'Trying to set an amount with a non numeric value, ' .
                         'or with a zero value',
-                        PEAR_LOG_WARNING
+                        KLogger::WARN
                     );
                 }
                 break;
@@ -1014,7 +1016,7 @@ class Contribution
                 $log->log(
                     '[' . __CLASS__ . ']: Trying to set an unknown property (' .
                     $name . ')',
-                    PEAR_LOG_WARNING
+                    KLogger::WARN
                 );
                 break;
             }
index 4a0483befbe7c452c841820363dd55c244fe77dc..1b33eeba69436d146153df2eb1afd5bbce48eacb 100644 (file)
@@ -37,6 +37,8 @@
 
 namespace Galette\Entity;
 
+use Galette\Common\KLogger as KLogger;
+
 /* TODO: Most of the code is duplicated in Galette\Entity\Status. Should
  * probably use a superclass for genericity.
  */
@@ -120,11 +122,11 @@ class ContributionsTypes
             $log->log(
                 'Cannot load contribution type form id `' . $id . '` | ' .
                 $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $log->log(
                 'Query was: ' . $select->__toString() . ' ' . $e->__toString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -173,14 +175,14 @@ class ContributionsTypes
 
             $log->log(
                 'Default contributions types were successfully stored into database.',
-                PEAR_LOG_INFO
+                KLogger::INFO
             );
             return true;
         } catch (\Exception $e) {
             $log->log(
                 'Unable to initialize default contributions types.' .
                 $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             return $e;
         }
@@ -219,11 +221,11 @@ class ContributionsTypes
         } catch (\Exception $e) {
             $log->log(
                 'An error occured. ' . $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             $log->log(
                 'Query was: ' . $select->__toString(),
-                PEAR_LOG_DEBUG
+                KLogger::DEBUG
             );
             return false;
         }
@@ -250,7 +252,7 @@ class ContributionsTypes
             if ( count($types) == 0 ) {
                 $log->log(
                     'No contributions types defined in database.',
-                    PEAR_LOG_INFO
+                    KLogger::INFO
                 );
             } else {
                 foreach ( $types as $type ) {
@@ -265,11 +267,11 @@ class ContributionsTypes
             /** TODO */
             $log->log(
                 'Cannot list contribution types | ' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $log->log(
                 'Query was: ' . $select->__toString() . ' ' . $e->__toString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -298,11 +300,11 @@ class ContributionsTypes
             /** TODO */
             $log->log(
                 __METHOD__ . ' | ' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $log->log(
                 'Query was: ' . $select->__toString() . ' ' . $e->__toString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -342,7 +344,7 @@ class ContributionsTypes
             $log->log(
                 'Unable to retrieve contributions type from label `' .
                 $label . '` | ' . $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -366,7 +368,7 @@ class ContributionsTypes
         if ( $ret !== false ) {
             $log->log(
                 'Contribution type `' . $label . '` already exists',
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             return -2;
         }
@@ -385,7 +387,7 @@ class ContributionsTypes
             if ( $ret >  0) {
                 $log->log(
                     'New contributions type `' . $label . '` added successfully.',
-                    PEAR_LOG_INFO
+                    KLogger::INFO
                 );
                 return $zdb->db->lastInsertId(
                     PREFIX_DB . self::TABLE,
@@ -399,7 +401,7 @@ class ContributionsTypes
             $log->log(
                 'Unable to add new contributions type `' . $label . '` | ' .
                 $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -433,7 +435,7 @@ class ContributionsTypes
             $fieldtype = 'integer';
         }
 
-        $log->log("Setting field $field to $value for ctype $id", PEAR_LOG_INFO);
+        $log->log("Setting field $field to $value for ctype $id", KLogger::INFO);
 
         try {
             $values= array(
@@ -448,7 +450,7 @@ class ContributionsTypes
 
             $log->log(
                 'Contributions type ' . $id . ' updated successfully.',
-                PEAR_LOG_INFO
+                KLogger::INFO
             );
             return true;
         } catch (\Exception $e) {
@@ -456,7 +458,7 @@ class ContributionsTypes
             $log->log(
                 'Unable to update contributions types ' . $id . ' | ' .
                 $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -486,7 +488,7 @@ class ContributionsTypes
             );
             $log->log(
                 'Contributions type ' . $id . ' deleted successfully.',
-                PEAR_LOG_INFO
+                KLogger::INFO
             );
             return true;
         } catch (\Exception $e) {
@@ -494,7 +496,7 @@ class ContributionsTypes
             $log->log(
                 'Unable to delete contributions type ' . $id . ' | ' .
                 $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -526,7 +528,7 @@ class ContributionsTypes
             $log->log(
                 'Unable to check if contribution `' . $id . '` is used. | ' .
                 $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             //in case of error, we consider that type is used, to avoid errors
             return true;
index 4c190acd22338333cfb48139799d18b42dcaaa28..c72b2199af6dc9cd6ac78f5a4e873fc2be8383d5 100644 (file)
@@ -37,6 +37,8 @@
 
 namespace Galette\Entity;
 
+use Galette\Common\KLogger as KLogger;
+
 /**
  * Fields categories class for galette
  *
@@ -108,11 +110,11 @@ class FieldsCategories
             $log->log(
                 '[' . get_class($this) . '] Cannot get fields categories list | ' .
                 $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $log->log(
                 'Query was: ' . $select->__toString() . ' ' . $e->__toString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -147,14 +149,14 @@ class FieldsCategories
 
             $log->log(
                 'Default fields configurations were successfully stored into database.',
-                PEAR_LOG_INFO
+                KLogger::INFO
             );
             return true;
         } catch (\Exception $e) {
             $log->log(
                 'Unable to initialize default fields configuration.' .
                 $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             return $e;
         }
index b474e7fbfd4ce41947cab1e640a400dee0d00578..075be7b0dafc03bd536bf5f53115c6d2d1d029d9 100644 (file)
@@ -37,6 +37,8 @@
 
 namespace Galette\Entity;
 
+use Galette\Common\KLogger as KLogger;
+
 /**
  * Fields config class for galette :
  * defines fields mandatory, order and visibility
@@ -148,7 +150,7 @@ class FieldsConfig
                         '` columns does not match records. Is : ' .
                         count($result) . ' and should be ' .
                         count($meta) . '. Reinit.',
-                        PEAR_LOG_INFO
+                        KLogger::INFO
                     );
                     $this->init(true);
                 }
@@ -158,11 +160,11 @@ class FieldsConfig
                 '[' . $class . '] An error occured while checking update for ' .
                 'fields configuration for table `' . $this->_table . '`. ' .
                 $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             $log->log(
                 'Query was: ' . $select->__toString() . ' ' . $e->__toString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             throw $e;
         }
@@ -188,13 +190,13 @@ class FieldsConfig
         $log->log(
             '[' . $class . '] Initializing fields configuration for table `' .
             PREFIX_DB . $this->_table . '`',
-            PEAR_LOG_DEBUG
+            KLogger::DEBUG
         );
         if ( $reinit ) {
             $log->log(
                 '[' . $class . '] Reinit mode, we delete config content for ' .
                 'table `' . PREFIX_DB . $this->_table . '`',
-                PEAR_LOG_DEBUG
+                KLogger::DEBUG
             );
             //Delete all entries for current table. Existing entries are
             //already stored, new ones will be added :)
@@ -207,7 +209,7 @@ class FieldsConfig
                 $log->log(
                     'Unable to delete fields configuration for reinitialization' .
                     $e->getMessage(),
-                    PEAR_LOG_WARNING
+                    KLogger::WARN
                 );
                 return false;
             }
@@ -265,7 +267,7 @@ class FieldsConfig
             $log->log(
                 '[' . $class . '] Initialisation seems successfull, we reload ' .
                 'the object',
-                PEAR_LOG_DEBUG
+                KLogger::DEBUG
             );
             $log->log(
                 str_replace(
@@ -274,7 +276,7 @@ class FieldsConfig
                     '[' . $class . '] Fields configuration for table %s '.
                     'initialized successfully.'
                 ),
-                PEAR_LOG_INFO
+                KLogger::INFO
             );
             $this->_checkUpdate(false);
         } catch (\Exception $e) {
@@ -283,7 +285,7 @@ class FieldsConfig
                 '[' . $class . '] An error occured trying to initialize fields ' .
                 'configuration for table `' . PREFIX_DB . $this->_table . '`.' .
                 $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             throw $e;
         }
@@ -401,13 +403,13 @@ class FieldsConfig
                 '[' . $class . '] An error occured while storing fields ' .
                 'configuration for table `' . $this->_table . '`.' .
                 $stmt->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         } else {
             $log->log(
                 '[' . $class . '] Fields configuration stored successfully! ',
-                PEAR_LOG_DEBUG
+                KLogger::DEBUG
             );
             $log->log(
                 str_replace(
@@ -416,7 +418,7 @@ class FieldsConfig
                     '[' . $class . '] Fields configuration for table %s stored ' .
                     'successfully.'
                 ),
-                PEAR_LOG_INFO
+                KLogger::INFO
             );
             $stmt->free();
             return true;
index cae59686c324efe05e16f53d417fc69a3c48936d..4d4417a1e2aa793986f1a802f909af1b87410ab2 100644 (file)
@@ -37,6 +37,8 @@
 
 namespace Galette\Entity;
 
+use Galette\Common\KLogger as KLogger;
+
 /**
  * Group entity
  *
@@ -109,11 +111,11 @@ class Group
         } catch (\Exception $e) {
             $log->log(
                 'Cannot load group form id `' . $id . '` | ' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $log->log(
                 'Query was: ' . $select->__toString() . ' ' . $e->__toString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -190,11 +192,11 @@ class Group
         } catch (\Exception $e) {
             $log->log(
                 'Cannot get group persons | ' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $log->log(
                 'Query was: ' . $select->__toString() . ' ' . $e->__toString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
         }
     }
@@ -237,11 +239,11 @@ class Group
             $log->log(
                 'Cannot get subgroup for group ' . $this->_group_name .
                 ' (' . $this->_id . ')| ' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $log->log(
                 'Query was: ' . $select->__toString() . ' ' . $e->__toString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
         }
     }
@@ -289,7 +291,7 @@ class Group
             $log->log(
                 'Unable to delete group ' . $this->_group_name .
                 ' (' . $this->_id  . ') |' . $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -327,7 +329,7 @@ class Group
                 '` (' . $this->_id . ') from its parent:\'( | ' .
                 $e->getMessage() . "\n" .
                 $e->getTraceAsString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             throw new \Exception(_T("Unable to detach group :("));
         }
@@ -398,7 +400,7 @@ class Group
             $log->log(
                 'Something went wrong :\'( | ' . $e->getMessage() . "\n" .
                 $e->getTraceAsString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -607,7 +609,7 @@ class Group
             $log->log(
                 'Group members has been removed for `' . $this->_group_name .
                 ', we can now store new ones.',
-                PEAR_LOG_INFO
+                KLogger::INFO
             );
 
             $stmt = $zdb->db->prepare(
@@ -625,14 +627,14 @@ class Group
                         $log->log(
                             'Member `' . $m->sname . '` attached to group `' .
                             $this->_group_name . '`.',
-                            PEAR_LOG_DEBUG
+                            KLogger::DEBUG
                         );
                     } else {
                         $log->log(
                             'An error occured trying to attach member `' .
                             $m->sname . '` to group `' . $this->_group_name .
                             '` ('  . $this->_id . ').',
-                            PEAR_LOG_ERR
+                            KLogger::ERR
                         );
                         throw new \Exception(
                             'Unable to attach `' . $m->sname . '` ' .
@@ -646,7 +648,7 @@ class Group
 
             $log->log(
                 'Group members updated successfully.',
-                PEAR_LOG_INFO
+                KLogger::INFO
             );
 
             return true;
@@ -655,7 +657,7 @@ class Group
             $log->log(
                 'Unable to attach members to group `' . $this->_group_name .
                 '` (' . $this->_id . ')|' . $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -683,7 +685,7 @@ class Group
             $log->log(
                 'Group managers has been removed for `' . $this->_group_name .
                 ', we can now store new ones.',
-                PEAR_LOG_INFO
+                KLogger::INFO
             );
 
             $stmt = $zdb->db->prepare(
@@ -701,14 +703,14 @@ class Group
                         $log->log(
                             'Manager `' . $m->sname . '` attached to group `' .
                             $this->_group_name . '`.',
-                            PEAR_LOG_DEBUG
+                            KLogger::DEBUG
                         );
                     } else {
                         $log->log(
                             'An error occured trying to attach manager `' .
                             $m->sname . '` to group `' . $this->_group_name .
                             '` ('  . $this->_id . ').',
-                            PEAR_LOG_ERR
+                            KLogger::ERR
                         );
                         throw new \Exception(
                             'Unable to attach `' . $m->sname . '` ' .
@@ -722,7 +724,7 @@ class Group
 
             $log->log(
                 'Groups managers updated successfully.',
-                PEAR_LOG_INFO
+                KLogger::INFO
             );
 
             return true;
@@ -731,7 +733,7 @@ class Group
             $log->log(
                 'Unable to attach managers to group `' . $this->_group_name .
                 '` (' . $this->_id . ')|' . $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
index 24fff12a1306af17a472090a77b13abeabb5142e..5f3f313df420dfe6b4de12d1c76f038270f25966 100644 (file)
@@ -37,6 +37,8 @@
 
 namespace Galette\Entity;
 
+use Galette\Common\KLogger as KLogger;
+
 /**
  * Politeness class for galette
  *
index e25fb83cd6ec02db194ba497e1c18bce06e06a22..829857ccb5e8f64e6fb5ed967cd789babe2cfd3b 100644 (file)
@@ -37,6 +37,8 @@
 
 namespace Galette\Entity;
 
+use Galette\Common\KLogger as KLogger;
+
 /**
  * Required class for galette :
  * defines which fields are mandatory and which are not.
@@ -103,7 +105,7 @@ class Required
                         'Members columns count does not match required records.' .
                         ' Is: ' . count($required) . ' and should be ' .
                         count($meta) . '. Reinit.',
-                        PEAR_LOG_WARNING
+                        KLogger::WARN
                     );
                     $this->init(true);
                 }
@@ -133,11 +135,11 @@ class Required
             /** TODO */
             $log->log(
                 'Cannot check required fields update | ' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $log->log(
                 'Query was: ' . $select->__toString() . ' ' . $e->__toString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -155,20 +157,20 @@ class Required
     function init($reinit=false)
     {
         global $zdb, $log;
-        $log->log('Initializing required fiels', PEAR_LOG_DEBUG);
+        $log->log('Initializing required fiels', KLogger::DEBUG);
         if ( $reinit ) {
-            $log->log('Reinit mode, we delete table\'s content', PEAR_LOG_DEBUG);
+            $log->log('Reinit mode, we delete table\'s content', KLogger::DEBUG);
             try {
                 $zdb->db->query('TRUNCATE ' . PREFIX_DB . self::TABLE);
             } catch (\Exception $e) {
                 $log->log(
                     'An error has occured deleting current required records | ' .
                     $e->getMessage(),
-                    PEAR_LOG_ERR
+                    KLogger::ERR
                 );
                 $log->log(
                     $e->getTraceAsString(),
-                    PEAR_LOG_WARNING
+                    KLogger::WARN
                 );
                 return false;
             }
@@ -193,23 +195,23 @@ class Required
                 if ( $stmt->execute() ) {
                     $log->log(
                         'Field ' . $k . ' processed.',
-                        PEAR_LOG_DEBUG
+                        KLogger::DEBUG
                     );
                 } else {
                     $log->log(
                         'An error occured trying to initialize required fields',
-                        PEAR_LOG_ERR
+                        KLogger::ERR
                     );
                     return false;
                 }
             }
             $log->log(
                 'Required adherents table updated successfully.',
-                PEAR_LOG_INFO
+                KLogger::INFO
             );
             $log->log(
                 'Initialisation seems successfull, we reload the object',
-                PEAR_LOG_DEBUG
+                KLogger::DEBUG
             );
             $this->_checkUpdate(false);
         } catch (\Exception $e) {
@@ -217,11 +219,11 @@ class Required
             $log->log(
                 'An error occured trying to initialize required fields | ' .
                 $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $log->log(
                 $e->__toString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -281,11 +283,11 @@ class Required
             $log->log(
                 'An error has occured updating required fields | ' .
                 $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $log->log(
                 $e->getTraceAsString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
index 78a6371b18a2e2f6fe93bfe5c51bd95a801b83d0..8236f17453e4c0948b0b7f90b9f3b96f757f2a1f 100644 (file)
@@ -37,6 +37,8 @@
 
 namespace Galette\Entity;
 
+use Galette\Common\KLogger as KLogger;
+
 /* TODO: Most of the code is duplicated in Galette\Entity\ContributionsTypes. Should
  * probably use a superclass for genericity.
  */
@@ -121,13 +123,13 @@ class Status
 
             $log->log(
                 'Default status were successfully stored into database.',
-                PEAR_LOG_INFO
+                KLogger::INFO
             );
             return true;
         } catch (\Exception $e) {
             $log->log(
                 'Unable to initialize default status.' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             return $e;
         }
@@ -149,7 +151,7 @@ class Status
                 ->order(self::ORDER_FIELD, self::PK);
             $statuses = $select->query()->fetchAll();
             if ( count($statuses) == 0 ) {
-                $log->log('No status defined in database.', PEAR_LOG_INFO);
+                $log->log('No status defined in database.', KLogger::INFO);
             } else {
                 foreach ( $statuses as $status ) {
                     $list[$status->id_statut] = _T($status->libelle_statut);
@@ -160,11 +162,11 @@ class Status
             /** TODO */
             $log->log(
                 __METHOD__ . ' | ' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $log->log(
                 'Query was: ' . $select->__toString() . ' ' . $e->__toString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
         }
     }
@@ -187,7 +189,7 @@ class Status
             $statuses = $select->query()->fetchAll();
 
             if ( count($statuses) == 0 ) {
-                $log->log('No status defined in database.', PEAR_LOG_INFO);
+                $log->log('No status defined in database.', KLogger::INFO);
             } else {
                 foreach ( $statuses as $status ) {
                     $list[$status->id_statut] = array(
@@ -201,11 +203,11 @@ class Status
             /** TODO */
             $log->log(
                 'Cannot list statuses | ' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $log->log(
                 'Query was: ' . $select->__toString() . ' ' . $e->__toString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -234,11 +236,11 @@ class Status
             /** TODO */
             $log->log(
                 __METHOD__ . ' | ' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $log->log(
                 'Query was: ' . $select->__toString() . ' ' . $e->__toString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -280,7 +282,7 @@ class Status
             $log->log(
                 'Unable to retrieve status from label `' . $label . '` | ' .
                 $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -304,7 +306,7 @@ class Status
         if ( $ret !== false ) {
             $log->log(
                 'Status `' . $label . '` already exists',
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             return -2;
         }
@@ -323,7 +325,7 @@ class Status
             if ( $ret >  0) {
                 $log->log(
                     'New status `' . $label . '` added successfully.',
-                    PEAR_LOG_INFO
+                    KLogger::INFO
                 );
                 return $zdb->db->lastInsertId(
                     PREFIX_DB . self::TABLE,
@@ -337,7 +339,7 @@ class Status
             $log->log(
                 'Unable to add new status `' . $label . '` | ' .
                 $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -371,7 +373,7 @@ class Status
             $fieldtype = 'integer';
         }
 
-        $log->log("Setting field $field to $value for ctype $id", PEAR_LOG_INFO);
+        $log->log("Setting field $field to $value for ctype $id", KLogger::INFO);
 
         try {
             $values= array(
@@ -384,13 +386,13 @@ class Status
                 self::PK . ' = ' . $id
             );
 
-            $log->log('Status ' . $id . ' updated successfully.', PEAR_LOG_INFO);
+            $log->log('Status ' . $id . ' updated successfully.', KLogger::INFO);
             return true;
         } catch (\Exception $e) {
             /** FIXME */
             $log->log(
                 'Unable to update status ' . $id . ' | ' . $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -420,14 +422,14 @@ class Status
             );
             $log->log(
                 'Status ' . $id . ' deleted successfully.',
-                PEAR_LOG_INFO
+                KLogger::INFO
             );
             return true;
         } catch (\Exception $e) {
             /** FIXME */
             $log->log(
                 'Unable to delete status ' . $id . ' | ' . $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -459,7 +461,7 @@ class Status
             $log->log(
                 'Unable to check if status `' . $id . '` is used. | ' .
                 $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             //in case of error, we consider that status is used, to avoid errors
             return true;
index f51618f1a38fe27d9275a56e27719277c73f8722..b3a9b4977070582ec8489558debd0708c38f6457 100644 (file)
@@ -38,6 +38,8 @@
 
 namespace Galette\Entity;
 
+use Galette\Common\KLogger as KLogger;
+
 /**
  * Texts class for galette
  *
@@ -274,14 +276,14 @@ class Texts
                         $log->log(
                             'Unable to add missing requested text "' . $ref .
                             ' (' . $lang . ') | ' . $e->getMessage(),
-                            PEAR_LOG_WARNING
+                            KLogger::WARN
                         );
                     }
                 } else {
                     $log->log(
                         'Unable to find missing requested text "' . $ref .
                         ' (' . $lang . ')',
-                        PEAR_LOG_WARNING
+                        KLogger::WARN
                     );
                 }
             }
@@ -291,11 +293,11 @@ class Texts
             $log->log(
                 'Cannot get text `' . $ref . '` for lang `' . $lang . '` | ' .
                 $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $log->log(
                 'Query was: ' . $select->__toString() . ' ' . $e->__toString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -339,7 +341,7 @@ class Texts
             $log->log(
                 'An error has occured while storing mail text. | ' .
                 $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -369,11 +371,11 @@ class Texts
             $log->log(
                 'Cannot get refs for lang `' . $lang . '` | ' .
                 $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $log->log(
                 'Query was: ' . $select->__toString() . ' ' . $e->__toString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -445,14 +447,14 @@ class Texts
 
                 $log->log(
                     'Default texts were successfully stored into database.',
-                    PEAR_LOG_INFO
+                    KLogger::INFO
                 );
                 return true;
             }
         } catch (\Exception $e) {
             $log->log(
                 'Unable to initialize default texts.' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             return $e;
         }
index 2e934b54157fcab6d8ce5da79f42c1a08a7b2a72..9d089d66e6aa56cf0ae95a2e985a02c4043d24e1 100644 (file)
@@ -37,6 +37,7 @@
 
 namespace Galette\Entity;
 
+use Galette\Common\KLogger as KLogger;
 use Galette\Repository\Contributions as Contributions;
 
 /**
@@ -144,7 +145,7 @@ class Transaction
             $log->log(
                 'Cannot load transaction form id `' . $id . '` | ' .
                 $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             return false;
         }
@@ -195,7 +196,7 @@ class Transaction
             $log->log(
                 'An error occured trying to remove transaction #' .
                 $this->_id . ' | ' . $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -264,7 +265,7 @@ class Transaction
                                 'Wrong date format. field: ' . $key .
                                 ', value: ' . $value . ', expected fmt: ' .
                                 _T("Y-m-d") . ' | ' . $e->getMessage(),
-                                PEAR_LOG_INFO
+                                KLogger::INFO
                             );
                             $errors[] = str_replace(
                                 array(
@@ -325,13 +326,13 @@ class Transaction
             $log->log(
                 'Some errors has been throwed attempting to edit/store a transaction' .
                 print_r($errors, true),
-                PEAR_LOG_DEBUG
+                KLogger::DEBUG
             );
             return $errors;
         } else {
             $log->log(
                 'Transaction checked successfully.',
-                PEAR_LOG_DEBUG
+                KLogger::DEBUG
             );
             return true;
         }
@@ -400,7 +401,7 @@ class Transaction
             $log->log(
                 'Something went wrong :\'( | ' . $e->getMessage() . "\n" .
                 $e->getTraceAsString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -427,11 +428,11 @@ class Transaction
             $log->log(
                 'An error occured retrieving dispatched amounts | ' .
                 $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             $log->log(
                 'Query was: ' . $select->__toString(),
-                PEAR_LOG_DEBUG
+                KLogger::DEBUG
             );
         }
     }
@@ -457,11 +458,11 @@ class Transaction
             $log->log(
                 'An error occured retrieving missing amounts | ' .
                 $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             $log->log(
                 'Query was: ' . $select->__toString(),
-                PEAR_LOG_DEBUG
+                KLogger::DEBUG
             );
         }
     }
index 2437dcaa648ffe1ff2437d6877d3f2529888090b..2ea019ce2c480b3a2afb090c42d2e34312cf4962 100644 (file)
@@ -37,6 +37,7 @@
 
 namespace Galette\Filters;
 
+use Galette\Common\KLogger as KLogger;
 use Galette\Core\Pagination as Pagination;
 use Galette\Entity\Group as Group;
 use Galette\Repository\Members as Members;
@@ -115,7 +116,7 @@ class MembersList extends Pagination
 
         $log->log(
             '[MembersList] Getting property `' . $name . '`',
-            PEAR_LOG_DEBUG
+            KLogger::DEBUG
         );
 
         if ( in_array($name, $this->pagination_fields) ) {
@@ -137,7 +138,7 @@ class MembersList extends Pagination
             } else {
                 $log->log(
                     '[MembersList] Unable to get proprety `' .$name . '`',
-                    PEAR_LOG_WARNING
+                    KLogger::WARN
                 );
             }
         }
@@ -160,7 +161,7 @@ class MembersList extends Pagination
         } else {
             $log->log(
                 '[MembersList] Setting property `' . $name . '`',
-                PEAR_LOG_DEBUG
+                KLogger::DEBUG
             );
 
             switch($name) {
@@ -173,7 +174,7 @@ class MembersList extends Pagination
                     $log->log(
                         '[MembersList] Value for property `' . $name .
                         '` should be an array (' . gettype($value) . ' given)',
-                        PEAR_LOG_WARNING
+                        KLogger::WARN
                     );
                 }
                 break;
@@ -191,7 +192,7 @@ class MembersList extends Pagination
                     $log->log(
                         '[MembersList] Value for property `' . $name .
                         '` should be an integer (' . gettype($value) . ' given)',
-                        PEAR_LOG_WARNING
+                        KLogger::WARN
                     );
                 }
                 break;
@@ -208,7 +209,7 @@ class MembersList extends Pagination
                         Members::FILTER_DC_EMAIL . ', ' .
                         Members::FILTER_W_EMAIL . ' or ' .
                         Members::FILTER_WO_EMAIL . ' (' . $value . ' given)',
-                        PEAR_LOG_WARNING
+                        KLogger::WARN
                     );
                     break;
                 }
@@ -223,21 +224,21 @@ class MembersList extends Pagination
                     } else {
                         $log->log(
                             'Group #' . $value . ' does not exists!',
-                            PEAR_LOG_WARNING
+                            KLogger::WARN
                         );
                     }
                 } else {
                     $log->log(
                         '[MembersList] Value for group filter should be an '
                         .'integer (' . gettype($value) . ' given',
-                        PEAR_LOG_WARNING
+                        KLogger::WARN
                     );
                 }
                 break;
             default:
                 $log->log(
                     '[MembersList] Unable to set proprety `' . $name . '`',
-                    PEAR_LOG_WARNING
+                    KLogger::WARN
                 );
                 break;
             }
index 185fb5420a9ecb9aba9e6301797cdbe9c8ec2fa7..db5b27ef2a3d8d39d32b20c6e1bf083f6649f42e 100644 (file)
@@ -37,6 +37,8 @@
 
 namespace Galette\IO;
 
+use Galette\Common\KLogger as KLogger;
+
 /**
  * CSV exports
  *
@@ -319,7 +321,7 @@ class Csv
             } else {
                 $log->log(
                     'File ' . $filename . ' is not writeable.',
-                    PEAR_LOG_ERR
+                    KLogger::ERR
                 );
                 return self::FILE_NOT_WRITABLE;
             }
@@ -327,7 +329,7 @@ class Csv
         } catch (\Exception $e) {
             $log->log(
                 'An error occured while exporting | ' . $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return self::DB_ERROR;
         }
index eaede40b7a41c7ff876c1541f6636c8e957d0822..f77b43b4e72ffe03e64f5ee7d1eca40e8fa4ce40 100644 (file)
@@ -37,6 +37,8 @@
 
 namespace Galette\IO;
 
+use Galette\Common\KLogger as KLogger;
+
 /** @ignore */
 require_once GALETTE_GAPI_PATH . '/apiClient.php';
 require_once GALETTE_GAPI_PATH . '/contrib/apiPlusService.php';
@@ -130,7 +132,7 @@ class News
                 $log->log(
                     'Unable chack cache expiracy. Are you sure you have ' .
                     'properly configured PHP timezone settings on your server?',
-                    PEAR_LOG_WARNING
+                    KLogger::WARN
                 );
             }
         } else {
@@ -255,7 +257,7 @@ class News
         } catch (\Exception $e) {
             $log->log(
                 'Unable to load Tweets :( | ' . $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             $this->_tweets = array();
         }
@@ -296,7 +298,7 @@ class News
         } catch ( \Exception $e ) {
             $log->log(
                 'Unable to load GooGlePlus posts :( | ' . $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
         }
     }
@@ -326,13 +328,13 @@ class News
                 //something went wrong :/
                 $log->log(
                     'Unable to load twitter URI ' . $this->_twitter_url,
-                    PEAR_LOG_WARNING
+                    KLogger::WARN
                 );
 
                 if ( count($errors) > 0 ) {
                     $log->log(
                         'XML errors has been throwed: ' . implode("\n", $errors),
-                        PEAR_LOG_INFO
+                        KLogger::INFO
                     );
                 }
                 libxml_clear_errors();
@@ -345,7 +347,7 @@ class News
         } else {
             $log->log(
                 'Required modules for Tweeter access are not present.',
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             return false;
         }
@@ -382,13 +384,13 @@ class News
                 } else {
                     $log->log(
                         'No Google+ posts has been loaded :(',
-                        PEAR_LOG_WARNING
+                        KLogger::WARN
                     );
                 }
             } catch ( \Exception $e ) {
                 $log->log(
                     'Unable to load GooGlePlus posts :( | ' . $e->getMessage(),
-                    PEAR_LOG_ERR
+                    KLogger::ERR
                 );
             }
 
@@ -396,7 +398,7 @@ class News
         } else {
             $log->log(
                 'Required modules for Google+ access are not present.',
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             return false;
         }
index 52f90cdfad539769dd4aad895ae5e8ccbaef90e0..ada2d42dddcfb9cedfefa538ea6b3f3ed5fe91e7 100644 (file)
@@ -37,6 +37,7 @@
 
 namespace Galette\Repository;
 
+use Galette\Common\KLogger as KLogger;
 use Galette\Core\Pagination as Pagination;
 use Galette\Entity\Contribution as Contribution;
 use Galette\Entity\Adherent as Adherent;
@@ -160,11 +161,11 @@ class Contributions extends Pagination
             /** TODO */
             $log->log(
                 'Cannot list contributions | ' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $log->log(
                 'Query was: ' . $select->__toString() . ' ' . $e->__toString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -213,11 +214,11 @@ class Contributions extends Pagination
             /** TODO */
             $log->log(
                 'Cannot build SELECT clause for contributions | ' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $log->log(
                 'Query was: ' . $select->__toString() . ' ' . $e->__toString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -252,11 +253,11 @@ class Contributions extends Pagination
             /** TODO */
             $log->log(
                 'Cannot count contributions | ' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $log->log(
                 'Query was: ' . $countSelect->__toString() . ' ' . $e->__toString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -286,11 +287,11 @@ class Contributions extends Pagination
             /** TODO */
             $log->log(
                 'Cannot calculate contributions sum | ' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $log->log(
                 'Query was: ' . $sumSelect->__toString() . ' ' . $e->__toString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -393,7 +394,7 @@ class Contributions extends Pagination
             /** TODO */
             $log->log(
                 __METHOD__ . ' | ' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
         }
     }
@@ -472,7 +473,7 @@ class Contributions extends Pagination
                 $log->log(
                     'An error occured trying to remove contributions | ' .
                     $e->getMessage(),
-                    PEAR_LOG_ERR
+                    KLogger::ERR
                 );
                 return false;
             }
@@ -480,7 +481,7 @@ class Contributions extends Pagination
             //not numeric and not an array: incorrect.
             $log->log(
                 'Asking to remove contribution, but without providing an array or a single numeric value.',
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             return false;
         }
@@ -500,7 +501,7 @@ class Contributions extends Pagination
 
         $log->log(
             '[Contributions] Getting property `' . $name . '`',
-            PEAR_LOG_DEBUG
+            KLogger::DEBUG
         );
 
         if ( in_array($name, $this->pagination_fields) ) {
@@ -534,7 +535,7 @@ class Contributions extends Pagination
             } else {
                 $log->log(
                     '[Contributions] Unable to get proprety `' .$name . '`',
-                    PEAR_LOG_WARNING
+                    KLogger::WARN
                 );
             }
         }
@@ -556,7 +557,7 @@ class Contributions extends Pagination
         } else {
             $log->log(
                 '[Contributions] Setting property `' . $name . '`',
-                PEAR_LOG_DEBUG
+                KLogger::DEBUG
             );
 
             $forbidden = array();
@@ -650,7 +651,7 @@ class Contributions extends Pagination
                             'Wrong date format. field: ' . $key .
                             ', value: ' . $value . ', expected fmt: ' .
                             _T("Y-m-d") . ' | ' . $e->getMessage(),
-                            PEAR_LOG_INFO
+                            KLogger::INFO
                         );
                         throw $e;
                     }
@@ -662,7 +663,7 @@ class Contributions extends Pagination
             } else {
                 $log->log(
                     '[Contributions] Unable to set proprety `' .$name . '`',
-                    PEAR_LOG_WARNING
+                    KLogger::WARN
                 );
             }
         }
index bc40eb10846ab2bd94eb3bafbe9fa6cde4b4d062..357b718d06361514ba7a2c42a30190000da5f980 100644 (file)
@@ -37,6 +37,7 @@
 
 namespace Galette\Repository;
 
+use Galette\Common\KLogger as KLogger;
 use Galette\Entity\Group as Group;
 use Galette\Entity\Adherent as Adherent;
 
@@ -80,11 +81,11 @@ class Groups
         } catch (\Exception $e) {
             $log->log(
                 'Cannot list groups (simple) | ' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $log->log(
                 'Query was: ' . $select->__toString() . ' ' . $e->getTraceAsString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
 
         }
@@ -132,11 +133,11 @@ class Groups
         } catch (\Exception $e) {
             $log->log(
                 'Cannot list groups | ' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $log->log(
                 'Query was: ' . $select->__toString() . ' ' . $e->getTraceAsString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
         }
     }
@@ -185,7 +186,7 @@ class Groups
             $result = $select->query()->fetchAll();
             $log->log(
                 'Exectued query: ' . $select->__toString(),
-                PEAR_LOG_DEBUG
+                KLogger::DEBUG
             );
             $groups = array();
             foreach ( $result as $r ) {
@@ -201,11 +202,11 @@ class Groups
             $log->log(
                 'Cannot load member groups for id `' . $id . '` | ' .
                 $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $log->log(
                 'Query was: ' . $select->__toString() . ' ' . $e->__toString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -235,7 +236,7 @@ class Groups
             $log->log(
                 'Member `' . $adh->sname . '` has been detached of its groups' .
                 ', we can now store new ones.',
-                PEAR_LOG_INFO
+                KLogger::INFO
             );
 
             //we proceed, if grousp has been specified
@@ -255,14 +256,14 @@ class Groups
                         $log->log(
                             'Member `' . $adh->sname . '` attached to group `' .
                             $gname . '` (' . $gid . ').',
-                            PEAR_LOG_DEBUG
+                            KLogger::DEBUG
                         );
                     } else {
                         $log->log(
                             'An error occured trying to attach member `' .
                             $adh->sname . '` (' . $adh->id . ') to group `' .
                             $gname . '` (' . $gid . ').',
-                            PEAR_LOG_ERR
+                            KLogger::ERR
                         );
                         throw new \Exception(
                             'Unable to attach `' . $adh->sname . '` (' . $adh->id .
@@ -280,7 +281,7 @@ class Groups
                 'Unable to add member `' . $adh->sname . '` (' . $adh->id .
                 ') to specified groups |' .
                 $e->getMessage(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -308,11 +309,11 @@ class Groups
         } catch (\Exception $e) {
             $log->log(
                 'Cannot list groups (simple) | ' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $log->log(
                 'Query was: ' . $select->__toString() . ' ' . $e->getTraceAsString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
         }
     }
index deb22ddd059f8de125e455733628b6944255a7eb..fa2fd6afdae69e7e7ea7f66219a757f62dfc8abb 100644 (file)
@@ -37,6 +37,7 @@
 
 namespace Galette\Repository;
 
+use Galette\Common\KLogger as KLogger;
 use Galette\Entity\Adherent as Adherent;
 use Galette\Entity\Contribution as Contribution;
 use Galette\Entity\Transaction as Transaction;
@@ -207,7 +208,7 @@ class Members
             $log->log(
                 "The following query will be executed: \n" .
                 $select->__toString(),
-                PEAR_LOG_DEBUG
+                KLogger::DEBUG
             );
 
             $members = array();
@@ -223,11 +224,11 @@ class Members
             /** TODO */
             $log->log(
                 'Cannot list members | ' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $log->log(
                 'Query was: ' . $select->__toString() . ' ' . $e->__toString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
         }
     }
@@ -274,7 +275,7 @@ class Members
                         if ( !$p->delete(false) ) {
                             $log->log(
                                 'Unable to delete picture for member ' . $str_adh,
-                                PEAR_LOG_ERR
+                                KLogger::ERR
                             );
                             throw new \Exception(
                                 'Unable to delete picture for member ' .
@@ -323,7 +324,7 @@ class Members
                 $log->log(
                     'Unable to delete selected member(s) |' .
                     $e->getMessage(),
-                    PEAR_LOG_ERR
+                    KLogger::ERR
                 );
                 return false;
             }
@@ -331,7 +332,7 @@ class Members
             //not numeric and not an array: incorrect.
             $log->log(
                 'Asking to remove members, but without providing an array or a single numeric value.',
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             return false;
         }
@@ -390,7 +391,7 @@ class Members
             $log->log(
                 "The following query will be executed: \n" .
                 $select->__toString(),
-                PEAR_LOG_DEBUG
+                KLogger::DEBUG
             );
 
             if ( $filters ) {
@@ -407,11 +408,11 @@ class Members
             $log->log(
                 'Cannot list members with public informations (photos: '
                 . $with_photos . ') | ' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $log->log(
                 'Query was: ' . $select->__toString() . ' ' . $e->__toString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -431,7 +432,7 @@ class Members
         global $zdb, $log;
 
         if ( !is_array($ids) || count($ids) < 1 ) {
-            $log->log('No member selected for labels.', PEAR_LOG_INFO);
+            $log->log('No member selected for labels.', KLogger::INFO);
             return false;
         }
 
@@ -451,7 +452,7 @@ class Members
             $log->log(
                 "The following query will be executed: \n" .
                 $select->__toString(),
-                PEAR_LOG_DEBUG
+                KLogger::DEBUG
             );
 
             $result = $select->query();
@@ -464,11 +465,11 @@ class Members
             /** TODO */
             $log->log(
                 'Cannot load members form ids array | ' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $log->log(
                 'Query was: ' . $select->__toString() . ' ' . $e->__toString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
         }
     }
@@ -551,11 +552,11 @@ class Members
             /** TODO */
             $log->log(
                 'Cannot build SELECT clause for members | ' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $log->log(
                 'Query was: ' . $select->__toString() . ' ' . $e->__toString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -597,11 +598,11 @@ class Members
             /** TODO */
             $log->log(
                 'Cannot count members | ' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $log->log(
                 'Query was: ' . $countSelect->__toString() . ' ' . $e->__toString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -798,7 +799,7 @@ class Members
             /** TODO */
             $log->log(
                 __METHOD__ . ' | ' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
         }
     }
index 2af1a16b72c67038743626c776b7feb4ce0ad2db..c630ade29ecfcfa36237dc87f4b1e1bb61a469f0 100644 (file)
@@ -37,6 +37,7 @@
 
 namespace Galette\Repository;
 
+use Galette\Common\KLogger as KLogger;
 use Galette\Core\Pagination as Pagination;
 use Galette\Entity\Transaction as Transaction;
 use Galette\Entity\Adherent as Adherent;
@@ -129,11 +130,11 @@ class Transactions extends Pagination
             /** TODO */
             $log->log(
                 'Cannot list transactions | ' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $log->log(
                 'Query was: ' . $select->__toString() . ' ' . $e->__toString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -186,11 +187,11 @@ class Transactions extends Pagination
             /** TODO */
             $log->log(
                 'Cannot build SELECT clause for transactions | ' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $log->log(
                 'Query was: ' . $select->__toString() . ' ' . $e->__toString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -225,11 +226,11 @@ class Transactions extends Pagination
             /** TODO */
             $log->log(
                 'Cannot count transactions | ' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             $log->log(
                 'Query was: ' . $countSelect->__toString() . ' ' . $e->__toString(),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             return false;
         }
@@ -311,7 +312,7 @@ class Transactions extends Pagination
             /** TODO */
             $log->log(
                 __METHOD__ . ' | ' . $e->getMessage(),
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
         }
     }
@@ -382,7 +383,7 @@ class Transactions extends Pagination
                 $log->log(
                     'An error occured trying to remove transactions | ' .
                     $e->getMessage(),
-                    PEAR_LOG_ERR
+                    KLogger::ERR
                 );
                 return false;
             }
@@ -390,7 +391,7 @@ class Transactions extends Pagination
             //not numeric and not an array: incorrect.
             $log->log(
                 'Asking to remove transaction, but without providing an array or a single numeric value.',
-                PEAR_LOG_WARNING
+                KLogger::WARN
             );
             return false;
         }
@@ -409,7 +410,7 @@ class Transactions extends Pagination
 
         $log->log(
             '[Transactions] Getting property `' . $name . '`',
-            PEAR_LOG_DEBUG
+            KLogger::DEBUG
         );
 
         if ( in_array($name, $this->pagination_fields) ) {
@@ -426,7 +427,7 @@ class Transactions extends Pagination
             } else {
                 $log->log(
                     '[Transactions] Unable to get proprety `' .$name . '`',
-                    PEAR_LOG_WARNING
+                    KLogger::WARN
                 );
             }
         }*/
@@ -448,7 +449,7 @@ class Transactions extends Pagination
         } else {
             $log->log(
                 '[Transactions] Setting property `' . $name . '`',
-                PEAR_LOG_DEBUG
+                KLogger::DEBUG
             );
 
             $forbidden = array();
@@ -476,7 +477,7 @@ class Transactions extends Pagination
             } else {
                 $log->log(
                     '[Transactions] Unable to set proprety `' .$name . '`',
-                    PEAR_LOG_WARNING
+                    KLogger::WARN
                 );
             }
         }
index 793c2382e1ab74f47401d0ecc9ff10736b0685bd..d9989f0d6950c4f6e4fedb8753c067693d643e0b 100644 (file)
@@ -77,7 +77,7 @@ if ( $preferences->pref_mail_method == Core\Mailing::METHOD_DISABLED
     if ( count($filters->selected) == 0 ) {
         $log->log(
             '[mailing_adherents.php] No member selected for mailing',
-            PEAR_LOG_INFO
+            KLogger::INFO
         );
         header('location:gestion_adherents.php');
         die();
@@ -136,7 +136,7 @@ if ( $preferences->pref_mail_method == Core\Mailing::METHOD_DISABLED
             $log->log(
                 '[mailing_adherents.php] Message was not sent. Errors: ' .
                 print_r($mailing->errors, true),
-                PEAR_LOG_ERR
+                KLogger::ERR
             );
             foreach ( $mailing->errors as $e ) {
                 $error_detected[] = $e;
@@ -146,7 +146,7 @@ if ( $preferences->pref_mail_method == Core\Mailing::METHOD_DISABLED
             $mlh->storeMailing(true);
             $log->log(
                 '[mailing_adherents.php] Message has been sent.',
-                PEAR_LOG_INFO
+                KLogger::INFO
             );
             $mailing->current_step = Core\Mailing::STEP_SENT;
             //cleanup
index 8152397d45bb9f784a88ce7372ff8f0f7242a669..f46e50b916d36c7936878eb7947dc3759afb8c59 100644 (file)
@@ -116,7 +116,7 @@ if ( isset($_POST['valid']) && $_POST['valid'] == '1' ) {
                 if ( GALETTE_MODE === 'DEMO' ) {
                     $log->log(
                         'Trying to set pref_email while in DEMO.',
-                        PEAR_LOG_WARNING
+                        KLogger::WARN
                     );
                 } else {
                     if ( !Core\GaletteMail::isValidEmail($value) ) {
@@ -128,7 +128,7 @@ if ( isset($_POST['valid']) && $_POST['valid'] == '1' ) {
                 if ( GALETTE_MODE === 'DEMO' ) {
                     $log->log(
                         'Trying to set superadmin login while in DEMO.',
-                        PEAR_LOG_WARNING
+                        KLogger::WARN
                     );
                 } else {
                     if ( strlen($value) < 4 ) {
@@ -185,7 +185,7 @@ if ( isset($_POST['valid']) && $_POST['valid'] == '1' ) {
                 if ( GALETTE_MODE == 'DEMO' ) {
                     $log->log(
                         'Trying to set superadmin pass while in DEMO.',
-                        PEAR_LOG_WARNING
+                        KLogger::WARN
                     );
                 } else {
                     if ( strlen($value) < 4 ) {
@@ -335,7 +335,7 @@ if ( isset($_POST['valid']) && $_POST['valid'] == '1' ) {
             } else if ($_FILES['logo']['error'] !== UPLOAD_ERR_NO_FILE) {
                 $log->log(
                     $logo->getPhpErrorMessage($_FILES['logo']['error']),
-                    PEAR_LOG_WARNING
+                    KLogger::WARN
                 );
                 $error_detected[] = $logo->getPhpErrorMessage(
                     $_FILES['logo']['error']
@@ -369,7 +369,7 @@ if ( isset($_POST['valid']) && $_POST['valid'] == '1' ) {
             } else if ($_FILES['card_logo']['error'] !== UPLOAD_ERR_NO_FILE) {
                 $log->log(
                     $print_logo->getPhpErrorMessage($_FILES['card_logo']['error']),
-                    PEAR_LOG_WARNING
+                    KLogger::WARN
                 );
                 $error_detected[] = $print_logo->getPhpErrorMessage(
                     $_FILES['card_logo']['error']
index 9edc02268dd064b5f19237231c27adedc4084be6..a2558ce4c2c1c798d716acbc396458ed13ffa78b 100644 (file)
@@ -102,11 +102,11 @@ try {
     $log->log(
         'An error occured counting l10n entries | ' .
         $e->getMessage(),
-        PEAR_LOG_WARNING
+        KLogger::WARN
     );
     $log->log(
         'Query was: ' . $select->__toString() . ' ' . $e->__toString(),
-        PEAR_LOG_ERR
+        KLogger::ERR
     );
 }
 
@@ -150,11 +150,11 @@ if ( is_numeric($nb_fields) && $nb_fields > 0 ) {
         $log->log(
             'An error occured retrieving l10n entries | ' .
             $e->getMessage(),
-            PEAR_LOG_WARNING
+            KLogger::WARN
         );
         $log->log(
             'Query was: ' . $select->__toString() . ' ' . $e->__toString(),
-            PEAR_LOG_ERR
+            KLogger::ERR
         );
     }
 }