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();
}
if ( !$id ) {
$log->log(
'Trying to display ajax_group.php without groups specified',
- PEAR_LOG_INFO
+ KLogger::INFO
);
die();
}
) {
$log->log(
'Trying to display ajax_group.php without appropriate permissions',
- PEAR_LOG_INFO
+ KLogger::INFO
);
die();
}
} else {
$log->log(
'Trying to reorder without target specified',
- PEAR_LOG_INFO
+ KLogger::INFO
);
echo json_encode(array('success' => false));
die();
if ( !$ids || !$mode ) {
$log->log(
'Trying to display ajax_group_members.php without persons or mode specified',
- PEAR_LOG_INFO
+ KLogger::INFO
);
die();
}
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();
}
) {
$log->log(
'Trying to display ajax_groups.php without appropriate permissions',
- PEAR_LOG_INFO
+ KLogger::INFO
);
die();
}
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();
}
if ( !$login->isLogged() || !$login->isAdmin() && !$login->isStaff() ) {
$log->log(
'Trying to display ajax_members.php without appropriate permissions',
- PEAR_LOG_INFO
+ KLogger::INFO
);
die();
}
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);
} else {
$log->log(
'Trying to list group members with unknown mode',
- PEAR_LOG_ERR
+ KLogger::ERR
);
throw new Exception('Unknown mode.');
exit(0);
if ( !$login->isLogged() || !$login->isAdmin() && !$login->isStaff() ) {
$log->log(
'Trying to display ajax_members.php without appropriate permissions',
- PEAR_LOG_INFO
+ KLogger::INFO
);
die();
}
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();
}
if ( $plugin === null ) {
$log->log(
'Unable to load plugin `' . $plugid . '`!',
- PEAR_LOG_EMERG
+ KLogger::EMERG
);
die();
}
$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)
if ( !$login->isLogged() || !$login->isAdmin() && !$login->isStaff() ) {
$log->log(
'Trying to display ajax_recipients.php without appropriate permissions',
- PEAR_LOG_INFO
+ KLogger::INFO
);
die();
}
if ( !$name ) {
$log->log(
'Trying to check if group name is unique without name specified',
- PEAR_LOG_INFO
+ KLogger::INFO
);
die();
}
if ( !$login->isLogged() || !$login->isAdmin() && !$login->isStaff() ) {
$log->log(
'Trying to display ajax_group.php without appropriate permissions',
- PEAR_LOG_INFO
+ KLogger::INFO
);
die();
}
$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.");
}
} 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']
}
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();
}
$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 {
$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();
}
default:
$log->log(
'Trying to configure fields on unknown table (' . $current . ')',
- PEAR_LOG_WARNING
+ KLogger::WARN
);
break;
}
$log->log(
'An error occured adding new dynamic field. | ' .
$e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
}
}
$log->log(
'Unable to change field ' . $field_id . ' rank | ' .
$e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
}
}
$log->log(
'Unable to retrieve field `' . $field_id . '` informations | ' .
$e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
$error_detected[] = _T("Unable to retrieve field informations.");
}
/** FIXME */
$log->log(
'An error occured checking field duplicity' . $e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
}
/** FIXME */
$log->log(
'An error occured storing field | ' . $e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
$error_detected[] = _T("An error occured storing the field.");
}
$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");
}
$zdb->db->rollBack();
$log->log(
'Unable to store field ' . $field_id . ' values',
- PEAR_LOG_ERR
+ KLogger::ERR
);
}
}
$log->log(
'Unable to retrieve fields types for field ' . $field_id . ' | ' .
$e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
}
}
$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();
}
} else {
$log->log(
'Trying to display group ' . $id . ' without appropriate permissions',
- PEAR_LOG_INFO
+ KLogger::INFO
);
die();
}
if ( !isset($_GET['file']) ) {
$log->log(
'No requested file',
- PEAR_LOG_INFO
+ KLogger::INFO
);
header("HTTP/1.1 500 Internal Server Error");
die();
$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');
}
$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');
}
* @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. */
/** 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
);
}
}
'; 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;
}
/** 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
);
}
}
/** 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
);
}
}
* @link http://galette.tuxfamily.org
*/
+use Galette\Common\KLogger as KLogger;
+
function PasswordImageName($c)
{
return 'pw_' . md5($c) . '.png';
$log->log(
'[get_numeric_form_value] not a numeric value! (value was: `' .
$val . '`)',
- PEAR_LOG_INFO
+ KLogger::INFO
);
$val = $defval;
}
$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();
}
$log->log(
'Entry for `' . $text_orig .
'` dynamic translation already exists.',
- PEAR_LOG_INFO
+ KLogger::INFO
);
$zdb->db->update(
$l10n_table,
$log->log(
'An error occured adding dynamic translation for `' .
$text_orig . '` | ' . $e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
}
'An error occured deleting dynamic translation for `' .
$text_orig . '` (lang `' . $lang->getLongID() . '`) | ' .
$e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
}
$log->log(
'An error occured updating dynamic translation for `' .
$text_orig . '` | ' . $e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
}
$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;
}
$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() .
namespace Galette\Core;
+use Galette\Common\Klogger as KLogger;
+
/**
* Zend_Db wrapper
*
$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
$log->log(
'[ZendDb] No connexion (' . $ce->getCode() . '|' .
$ce->getMessage() . ')',
- PEAR_LOG_ALERT
+ KLogger::ALERT
);
throw $e;
} catch (\Exception $e) {
$log->log(
'[ZendDb] Error (' . $e->getCode() . '|' .
$e->getMessage() . ')',
- PEAR_LOG_ALERT
+ KLogger::ALERT
);
throw $e;
}
} catch ( \Exception $e ) {
$log->log(
'Cannot check database version: ' . $e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
}
$_db->closeConnection();
$log->log(
'[' . __METHOD__ . '] Database connection was successfull!',
- PEAR_LOG_DEBUG
+ KLogger::DEBUG
);
return true;
} catch (\Zend_Db_Adapter_Exception $e) {
$log->log(
'[' . __METHOD__ . '] No connexion (' . $ce->getCode() . '|' .
$ce->getMessage() . ')',
- PEAR_LOG_ALERT
+ KLogger::ALERT
);
return $e;
} catch (\Exception $e) {
$log->log(
'[' . __METHOD__ . '] Error (' . $e->getCode() . '|' .
$e->getMessage() . ')',
- PEAR_LOG_ALERT
+ KLogger::ALERT
);
return $e;
}
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
);
}
}
$log->log(
'Check for database rights (mode ' . $mode . ')',
- PEAR_LOG_DEBUG
+ KLogger::DEBUG
);
$stop = false;
$results = array(
$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;
} catch (\Exception $e) {
$log->log(
'Cannot ALTER TABLE | ' . $e->getMessage(),
- PEAR_LOG_WARNING
+ KLogger::WARN
);
$results['alter'] = $e;
}
} 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;
} catch (\Exception $e) {
$log->log(
'Cannot UPDATE records | ' .$e->getMessage(),
- PEAR_LOG_WARNING
+ KLogger::WARN
);
$results['update'] = $e;
}
} catch (\Exception $e) {
$log->log(
'Cannot SELECT records | ' . $e->getMessage(),
- PEAR_LOG_WARNING
+ KLogger::WARN
);
$results['select'] = $e;
}
} catch (\Exception $e) {
$log->log(
'Cannot DELETE records | ' .$e->getMessage(),
- PEAR_LOG_WARNING
+ KLogger::WARN
);
$results['delete'] = $e;
}
} catch (\Exception $e) {
$log->log(
'Cannot DROP TABLE | ' . $e->getMessage(),
- PEAR_LOG_WARNING
+ KLogger::WARN
);
$results['drop'] = $e;
}
$this->_db->getConnection()->exec($query);
$log->log(
'Charset successfully changed for table `' . $table .'`',
- PEAR_LOG_DEBUG
+ KLogger::DEBUG
);
}
$log->log(
'An error occured while converting to utf table ' .
$table . ' (' . $e->getMessage() . ')',
- PEAR_LOG_ERR
+ KLogger::ERR
);
}
}
$log->log(
'Cannot SET NAMES on table `' . $table . '`. ' .
$e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
}
$log->log(
'An error occured while converting contents to UTF-8 for table ' .
$table . ' (' . $e->getMessage() . ')',
- PEAR_LOG_ERR
+ KLogger::ERR
);
}
}
namespace Galette\Core;
+use Galette\Common\KLogger as KLogger;
+
/**
* Error handler
*
array('Strict standards', $errstr, $errfile, $errline),
$str
),
- PEAR_LOG_INFO
+ KLogger::INFO
);
break;
case E_DEPRECATED:
array('Deprecated', $errstr, $errfile, $errline),
$str
),
- PEAR_LOG_INFO
+ KLogger::INFO
);
break;
case E_NOTICE:
array('Notice', $errstr, $errfile, $errline),
$str
),
- PEAR_LOG_INFO
+ KLogger::INFO
);
}
break;
array('Warning', $errstr, $errfile, $errline),
$str
),
- PEAR_LOG_WARNING
+ KLogger::WARN
);
break;
case E_ERROR:
array('Fatal', $errstr, $errfile, $errline),
$str
),
- PEAR_LOG_ERR
+ KLogger::ERR
);
exit("FATAL error $errstr at $errfile:$errline");
default:
array('Unknown', $errstr, $errfile, $errline),
$str
),
- PEAR_LOG_ERR
+ KLogger::ERR
);
exit("Unknown error at $errfile:$errline");
}
namespace Galette\Core;
+use Galette\Common\KLogger as KLogger;
+
/** @ignore */
require_once 'class.phpmailer.php';
require_once WEB_ROOT . 'includes/html2text.php';
$log->log(
'[' . get_class($this) .
']No SMTP port provided. Switch to default (25).',
- PEAR_LOG_INFO
+ KLogger::INFO
);
$this->_mail->Port = 25;
}
$log->log(
'[' . get_class($this) .
'] One of recipients adress is not valid.',
- PEAR_LOG_INFO
+ KLogger::INFO
);
$this->_mail->ClearBCCs();
break;
$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;
}
$log->log(
'A mail has been sent to: ' . $txt,
- PEAR_LOG_INFO
+ KLogger::INFO
);
$this->_mail = null;
return self::MAIL_SENT;
} catch (\Exception $e) {
$log->log(
'Error sending message: ' . $e.getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
$this->errors[] = $e->getMessage();
$this->_mail = null;
if ( !$valid ) {
$log->log(
'[GaletteMail] Adresss `' . $address . '` is not valid ',
- PEAR_LOG_INFO
+ KLogger::INFO
);
}
return $valid;
namespace Galette\Core;
+use Galette\Common\KLogger as KLogger;
+
/**
* History management
*
$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;
}
if ( !$result ) {
$log->log(
'An error occured cleaning history. ',
- PEAR_LOG_WARNING
+ KLogger::WARN
);
$this->add('Arror flushing logs');
return false;
/** TODO */
$log->log(
'Unable to flush logs. | ' . $e->getMessage(),
- PEAR_LOG_WARNING
+ KLogger::WARN
);
}
}
$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;
/** 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;
}
/** 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;
}
$log->log(
'[History] Getting property `' . $name . '`',
- PEAR_LOG_DEBUG
+ KLogger::DEBUG
);
if ( in_array($name, $this->pagination_fields) ) {
} else {
$log->log(
'[History] Unable to get proprety `' .$name . '`',
- PEAR_LOG_WARNING
+ KLogger::WARN
);
}
}
} else {
$log->log(
'[History] Setting property `' . $name . '`',
- PEAR_LOG_DEBUG
+ KLogger::DEBUG
);
$forbidden = array();
} else {
$log->log(
'[History] Unable to set proprety `' .$name . '`',
- PEAR_LOG_WARNING
+ KLogger::WARN
);
}
}
namespace Galette\Core;
+use Galette\Common\KLogger as KLogger;
+
/**
* i18n handling
*
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(
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
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
$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;
} 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;
}
}
} 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;
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.
namespace Galette\Core;
+use Galette\Common\KLogger as KLogger;
+
/**
* Mailing features
*
$log->log(
'[' . get_class($this) . 'Trying to get ' . $name .
' renamed: ' . $rname,
- PEAR_LOG_DEBUG
+ KLogger::DEBUG
);
return $this->$rname;
break;
$log->log(
'[' . get_class($this) . 'Unable to get ' . $name .
' renamed: ' . $rname,
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
}
'[' . get_class($this) . '] Value for field `' . $name .
'` should be boolean - (' . gettype($value) . ')' .
$value . ' given',
- PEAR_LOG_WARNING
+ KLogger::WARN
);
}
break;
'[' . 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;
}
*/
namespace Galette\Core;
+
+use Galette\Common\KLogger as KLogger;
use Galette\Entity\Adherent;
/**
$log->log(
'[' . __METHOD__ .
'] Mailing should be either null or an instance of Mailing',
- PEAR_LOG_ERR
+ KLogger::ERR
);
}
}
$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;
/** 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;
}
$log->log(
'Unable to load mailing model #' . $id . ' | ' .
$e->getMessage(),
- PEAR_LOG_WARNING
+ KLogger::WARN
);
return false;
}
$log->log(
'[' . __METHOD__ .
'] Mailing should be either null or an instance of Mailing',
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
}
} catch (\Exception $e) {
$log->log(
'An error occurend storing Mailing | ' . $e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
}
$log->log(
'Unable to delete selected mailing history entries |' .
$e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
}
//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;
}
namespace Galette\Core;
+use Galette\Common\KLogger as KLogger;
+
/**
* Pagination and ordering facilities
*
$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;
}
$log->log(
'[' . get_class($this) .
'|Pagination] Getting property `' . $name . '`',
- PEAR_LOG_DEBUG
+ KLogger::DEBUG
);
if ( in_array($name, $this->pagination_fields) ) {
$log->log(
'[' . get_class($this) .
'|Pagination] Unable to get proprety `' .$name . '`',
- PEAR_LOG_WARNING
+ KLogger::WARN
);
}
}
$log->log(
'[' . get_class($this) . '|Pagination] Setting property `' .
$name . '`',
- PEAR_LOG_DEBUG
+ KLogger::DEBUG
);
$rname = '_' . $name;
'|Pagination] Possibles values for field `' .
$name . '` are: `' . self::ORDER_ASC . '` or `' .
self::ORDER_DESC . '` - `' . $value . '` given',
- PEAR_LOG_WARNING
+ KLogger::WARN
);
}
break;
'|Pagination] Value for field `' .
$name . '` should be a positive integer - (' .
gettype($value) . ')' . $value . ' given',
- PEAR_LOG_WARNING
+ KLogger::WARN
);
}
break;
'[' . get_class($this) . '|Pagination] Value for `' .
$name . '` should be a positive integer or \'all\' - (' .
gettype($value) . ')' . $value . ' given',
- PEAR_LOG_WARNING
+ KLogger::WARN
);
}
break;
$log->log(
'[' . get_class($this) .
'|Pagination] Unable to set proprety `' . $name . '`',
- PEAR_LOG_WARNING
+ KLogger::WARN
);
break;
}
namespace Galette\Core;
+use Galette\Common\KLogger as KLogger;
use Galette\Entity\Adherent;
/**
if ( $del ) {
$log->log(
'Temporary passwords for `' . $id_adh . '` has been removed.',
- PEAR_LOG_DEBUG
+ KLogger::DEBUG
);
}
} catch (\Exception $e) {
$log->log(
'An error has occured removing old tmppasswords ' .
$e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
}
if ( $add ) {
$log->log(
'New passwords temporary set for `' . $id_adh . '`.',
- PEAR_LOG_DEBUG
+ KLogger::DEBUG
);
$this->_new_password = $password;
$this->_hash = $hash;
$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;
}
if ( $del ) {
$log->log(
'Old Temporary passwords has been deleted.',
- PEAR_LOG_DEBUG
+ KLogger::DEBUG
);
}
} catch (\Exception $e) {
$log->log(
'An error occured deleting expired temporary passwords. ' .
$e->getMessage(),
- PEAR_LOG_WARNING
+ KLogger::WARN
);
return false;
}
/** TODO */
$log->log(
'An error occured getting requested hash. ' . $e->getMessage(),
- PEAR_LOG_WARNING
+ KLogger::WARN
);
return false;
}
if ( $del ) {
$log->log(
'Used hash has been successfully remove',
- PEAR_LOG_DEBUG
+ KLogger::DEBUG
);
return true;
}
$log->log(
'An error ocured attempting to delete used hash' .
$e->getMessage(),
- PEAR_LOG_WARNING
+ KLogger::WARN
);
return false;
}
namespace Galette\Core;
use Galette\Entity\Adherent;
+use Galette\Common\KLogger as KLogger;
/**
* Picture handling
}
$log->log(
'The file ' . $_file . ' was found on the disk but cannot be removed.',
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
} else {
$log->log(
'An error occured attempting to delete picture ' . $this->db_id .
'from database | ' . $e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
}
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' ) {
$log->log(
$err_msg,
- PEAR_LOG_ERR
+ KLogger::ERR
);
return $ret;
}
'[' . $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);
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
);
}
$log->log(
'An error occured storing picture in database: ' .
$e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
return self::SQL_ERROR;
}
$log->log(
'[' . $class . '] GD has no JPEG Support - ' .
'pictures could not be resized!',
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
}
$log->log(
'[' . $class . '] GD has no PNG Support - ' .
'pictures could not be resized!',
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
}
$log->log(
'[' . $class . '] GD has no GIF Support - ' .
'pictures could not be resized!',
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
}
$log->log(
'[' . $class . '] GD is not present - ' .
'pictures could not be resized!',
- PEAR_LOG_ERR
+ KLogger::ERR
);
}
}
namespace Galette\Core;
+use Galette\Common\KLogger as KLogger;
use Galette\Entity\Adherent as Adherent;
/**
$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(
} 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
);
}
}
$log->log(
'Preferences cannot be loaded. Galette should not work without ' .
'preferences. Exiting.',
- PEAR_LOG_EMERG
+ KLogger::EMERG
);
return false;
}
$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;
}
);
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);
}
$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;
}
} else {
$log->log(
'Preference `' . $name . '` is not set or is forbidden',
- PEAR_LOG_INFO
+ KLogger::INFO
);
return false;
}
$log->log(
'Trying to set a preference value which does not seems to exist ('
. $name . ')',
- PEAR_LOG_WARNING
+ KLogger::WARN
);
return false;
}
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;
/** 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;
}
$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;
}
$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;
}
);
$log->log(
'Password for `' . $id_adh . '` has been updated.',
- PEAR_LOG_DEBUG
+ KLogger::DEBUG
);
return true;
} catch (\Exception $e) {
$log->log(
'An error occured while updating password for `' . $id_adh .
'` | ' . $e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
}
'Wrong date format. field: ' . $key .
', value: ' . $value . ', expected fmt: ' .
_T("Y-m-d") . ' | ' . $e->getMessage(),
- PEAR_LOG_INFO
+ KLogger::INFO
);
$errors[] = str_replace(
array(
} 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.");
}
} 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.");
}
$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;
}
$log->log(
'Something went wrong :\'( | ' . $e->getMessage() . "\n" .
$e->getTraceAsString(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
}
$log->log(
'Something went wrong updating modif date :\'( | ' .
$e->getMessage() . "\n" . $e->getTraceAsString(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
}
}
namespace Galette\Entity;
+use Galette\Common\KLogger as KLogger;
+
/**
* Contribution class for galette
*
$log->log(
'An error occured attempting to load contribution #' . $id .
$e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
}
'Wrong date format. field: ' . $key .
', value: ' . $value . ', expected fmt: ' .
_T("Y-m-d") . ' | ' . $e->getMessage(),
- PEAR_LOG_INFO
+ KLogger::INFO
);
$errors[] = str_replace(
array(
$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;
}
/** 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;
}
$log->log(
'Something went wrong :\'( | ' . $e->getMessage() . "\n" .
$e->getTraceAsString(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
}
'An error occured updating member ' . $this->_member .
'\'s deadline |' .
$e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
}
$log->log(
'An error occured trying to remove contribution #' .
$this->_id . ' | ' . $e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
}
/** FIXME */
$log->log(
'An error occured trying to retrieve member\'s due date',
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
}
$log->log(
'Contribution #' . $contrib_id .
' is not actually part of transaction #' . $trans_id,
- PEAR_LOG_WARNING
+ KLogger::WARN
);
return false;
}
$log->log(
'Unable to detach contribution #' . $contrib_id .
' to transaction #' . $trans_id . ' | ' . $e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
}
$log->log(
'Unable to attach contribution #' . $contrib_id .
' to transaction #' . $trans_id . ' | ' . $e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
}
$log->log(
'Bad date (' . $his->$rname . ') | ' .
$e->getMessage(),
- PEAR_LOG_INFO
+ KLogger::INFO
);
return $this->$rname;
}
default:
$log->log(
'Unknown payment type ' . $this->_payment_type,
- PEAR_LOG_WARNING
+ KLogger::WARN
);
return '-';
break;
} else {
$log->log(
'Trying to set a transaction from an id that is not an integer.',
- PEAR_LOG_WARNING
+ KLogger::WARN
);
}
break;
} else {
$log->log(
'Trying to set a type from an id that is not an integer.',
- PEAR_LOG_WARNING
+ KLogger::WARN
);
}
break;
'Wrong date format. field: ' . $key .
', value: ' . $value . ', expected fmt: ' .
_T("Y-m-d") . ' | ' . $e->getMessage(),
- PEAR_LOG_INFO
+ KLogger::INFO
);
$errors[] = str_replace(
array(
$log->log(
'Trying to set an amount with a non numeric value, ' .
'or with a zero value',
- PEAR_LOG_WARNING
+ KLogger::WARN
);
}
break;
$log->log(
'[' . __CLASS__ . ']: Trying to set an unknown property (' .
$name . ')',
- PEAR_LOG_WARNING
+ KLogger::WARN
);
break;
}
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.
*/
$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;
}
$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;
}
} 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;
}
if ( count($types) == 0 ) {
$log->log(
'No contributions types defined in database.',
- PEAR_LOG_INFO
+ KLogger::INFO
);
} else {
foreach ( $types as $type ) {
/** 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;
}
/** 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;
}
$log->log(
'Unable to retrieve contributions type from label `' .
$label . '` | ' . $e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
}
if ( $ret !== false ) {
$log->log(
'Contribution type `' . $label . '` already exists',
- PEAR_LOG_WARNING
+ KLogger::WARN
);
return -2;
}
if ( $ret > 0) {
$log->log(
'New contributions type `' . $label . '` added successfully.',
- PEAR_LOG_INFO
+ KLogger::INFO
);
return $zdb->db->lastInsertId(
PREFIX_DB . self::TABLE,
$log->log(
'Unable to add new contributions type `' . $label . '` | ' .
$e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
}
$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(
$log->log(
'Contributions type ' . $id . ' updated successfully.',
- PEAR_LOG_INFO
+ KLogger::INFO
);
return true;
} catch (\Exception $e) {
$log->log(
'Unable to update contributions types ' . $id . ' | ' .
$e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
}
);
$log->log(
'Contributions type ' . $id . ' deleted successfully.',
- PEAR_LOG_INFO
+ KLogger::INFO
);
return true;
} catch (\Exception $e) {
$log->log(
'Unable to delete contributions type ' . $id . ' | ' .
$e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
}
$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;
namespace Galette\Entity;
+use Galette\Common\KLogger as KLogger;
+
/**
* Fields categories class for galette
*
$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;
}
$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;
}
namespace Galette\Entity;
+use Galette\Common\KLogger as KLogger;
+
/**
* Fields config class for galette :
* defines fields mandatory, order and visibility
'` columns does not match records. Is : ' .
count($result) . ' and should be ' .
count($meta) . '. Reinit.',
- PEAR_LOG_INFO
+ KLogger::INFO
);
$this->init(true);
}
'[' . $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;
}
$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 :)
$log->log(
'Unable to delete fields configuration for reinitialization' .
$e->getMessage(),
- PEAR_LOG_WARNING
+ KLogger::WARN
);
return false;
}
$log->log(
'[' . $class . '] Initialisation seems successfull, we reload ' .
'the object',
- PEAR_LOG_DEBUG
+ KLogger::DEBUG
);
$log->log(
str_replace(
'[' . $class . '] Fields configuration for table %s '.
'initialized successfully.'
),
- PEAR_LOG_INFO
+ KLogger::INFO
);
$this->_checkUpdate(false);
} catch (\Exception $e) {
'[' . $class . '] An error occured trying to initialize fields ' .
'configuration for table `' . PREFIX_DB . $this->_table . '`.' .
$e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
throw $e;
}
'[' . $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(
'[' . $class . '] Fields configuration for table %s stored ' .
'successfully.'
),
- PEAR_LOG_INFO
+ KLogger::INFO
);
$stmt->free();
return true;
namespace Galette\Entity;
+use Galette\Common\KLogger as KLogger;
+
/**
* Group entity
*
} 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;
}
} 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
);
}
}
$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
);
}
}
$log->log(
'Unable to delete group ' . $this->_group_name .
' (' . $this->_id . ') |' . $e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
}
'` (' . $this->_id . ') from its parent:\'( | ' .
$e->getMessage() . "\n" .
$e->getTraceAsString(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
throw new \Exception(_T("Unable to detach group :("));
}
$log->log(
'Something went wrong :\'( | ' . $e->getMessage() . "\n" .
$e->getTraceAsString(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
}
$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(
$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 . '` ' .
$log->log(
'Group members updated successfully.',
- PEAR_LOG_INFO
+ KLogger::INFO
);
return true;
$log->log(
'Unable to attach members to group `' . $this->_group_name .
'` (' . $this->_id . ')|' . $e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
}
$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(
$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 . '` ' .
$log->log(
'Groups managers updated successfully.',
- PEAR_LOG_INFO
+ KLogger::INFO
);
return true;
$log->log(
'Unable to attach managers to group `' . $this->_group_name .
'` (' . $this->_id . ')|' . $e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
}
namespace Galette\Entity;
+use Galette\Common\KLogger as KLogger;
+
/**
* Politeness class for galette
*
namespace Galette\Entity;
+use Galette\Common\KLogger as KLogger;
+
/**
* Required class for galette :
* defines which fields are mandatory and which are not.
'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);
}
/** 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;
}
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;
}
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) {
$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;
}
$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;
}
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.
*/
$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;
}
->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);
/** TODO */
$log->log(
__METHOD__ . ' | ' . $e->getMessage(),
- PEAR_LOG_WARNING
+ KLogger::WARN
);
$log->log(
'Query was: ' . $select->__toString() . ' ' . $e->__toString(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
}
}
$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(
/** 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;
}
/** 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;
}
$log->log(
'Unable to retrieve status from label `' . $label . '` | ' .
$e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
}
if ( $ret !== false ) {
$log->log(
'Status `' . $label . '` already exists',
- PEAR_LOG_WARNING
+ KLogger::WARN
);
return -2;
}
if ( $ret > 0) {
$log->log(
'New status `' . $label . '` added successfully.',
- PEAR_LOG_INFO
+ KLogger::INFO
);
return $zdb->db->lastInsertId(
PREFIX_DB . self::TABLE,
$log->log(
'Unable to add new status `' . $label . '` | ' .
$e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
}
$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(
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;
}
);
$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;
}
$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;
namespace Galette\Entity;
+use Galette\Common\KLogger as KLogger;
+
/**
* Texts class for galette
*
$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
);
}
}
$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;
}
$log->log(
'An error has occured while storing mail text. | ' .
$e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
}
$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;
}
$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;
}
namespace Galette\Entity;
+use Galette\Common\KLogger as KLogger;
use Galette\Repository\Contributions as Contributions;
/**
$log->log(
'Cannot load transaction form id `' . $id . '` | ' .
$e->getMessage(),
- PEAR_LOG_WARNING
+ KLogger::WARN
);
return false;
}
$log->log(
'An error occured trying to remove transaction #' .
$this->_id . ' | ' . $e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
}
'Wrong date format. field: ' . $key .
', value: ' . $value . ', expected fmt: ' .
_T("Y-m-d") . ' | ' . $e->getMessage(),
- PEAR_LOG_INFO
+ KLogger::INFO
);
$errors[] = str_replace(
array(
$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;
}
$log->log(
'Something went wrong :\'( | ' . $e->getMessage() . "\n" .
$e->getTraceAsString(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
}
$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
);
}
}
$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
);
}
}
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;
$log->log(
'[MembersList] Getting property `' . $name . '`',
- PEAR_LOG_DEBUG
+ KLogger::DEBUG
);
if ( in_array($name, $this->pagination_fields) ) {
} else {
$log->log(
'[MembersList] Unable to get proprety `' .$name . '`',
- PEAR_LOG_WARNING
+ KLogger::WARN
);
}
}
} else {
$log->log(
'[MembersList] Setting property `' . $name . '`',
- PEAR_LOG_DEBUG
+ KLogger::DEBUG
);
switch($name) {
$log->log(
'[MembersList] Value for property `' . $name .
'` should be an array (' . gettype($value) . ' given)',
- PEAR_LOG_WARNING
+ KLogger::WARN
);
}
break;
$log->log(
'[MembersList] Value for property `' . $name .
'` should be an integer (' . gettype($value) . ' given)',
- PEAR_LOG_WARNING
+ KLogger::WARN
);
}
break;
Members::FILTER_DC_EMAIL . ', ' .
Members::FILTER_W_EMAIL . ' or ' .
Members::FILTER_WO_EMAIL . ' (' . $value . ' given)',
- PEAR_LOG_WARNING
+ KLogger::WARN
);
break;
}
} 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;
}
namespace Galette\IO;
+use Galette\Common\KLogger as KLogger;
+
/**
* CSV exports
*
} else {
$log->log(
'File ' . $filename . ' is not writeable.',
- PEAR_LOG_ERR
+ KLogger::ERR
);
return self::FILE_NOT_WRITABLE;
}
} catch (\Exception $e) {
$log->log(
'An error occured while exporting | ' . $e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
return self::DB_ERROR;
}
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';
$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 {
} catch (\Exception $e) {
$log->log(
'Unable to load Tweets :( | ' . $e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
$this->_tweets = array();
}
} catch ( \Exception $e ) {
$log->log(
'Unable to load GooGlePlus posts :( | ' . $e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
}
}
//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();
} else {
$log->log(
'Required modules for Tweeter access are not present.',
- PEAR_LOG_WARNING
+ KLogger::WARN
);
return false;
}
} 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
);
}
} else {
$log->log(
'Required modules for Google+ access are not present.',
- PEAR_LOG_WARNING
+ KLogger::WARN
);
return false;
}
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;
/** 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;
}
/** 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;
}
/** 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;
}
/** 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;
}
/** TODO */
$log->log(
__METHOD__ . ' | ' . $e->getMessage(),
- PEAR_LOG_WARNING
+ KLogger::WARN
);
}
}
$log->log(
'An error occured trying to remove contributions | ' .
$e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
}
//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;
}
$log->log(
'[Contributions] Getting property `' . $name . '`',
- PEAR_LOG_DEBUG
+ KLogger::DEBUG
);
if ( in_array($name, $this->pagination_fields) ) {
} else {
$log->log(
'[Contributions] Unable to get proprety `' .$name . '`',
- PEAR_LOG_WARNING
+ KLogger::WARN
);
}
}
} else {
$log->log(
'[Contributions] Setting property `' . $name . '`',
- PEAR_LOG_DEBUG
+ KLogger::DEBUG
);
$forbidden = array();
'Wrong date format. field: ' . $key .
', value: ' . $value . ', expected fmt: ' .
_T("Y-m-d") . ' | ' . $e->getMessage(),
- PEAR_LOG_INFO
+ KLogger::INFO
);
throw $e;
}
} else {
$log->log(
'[Contributions] Unable to set proprety `' .$name . '`',
- PEAR_LOG_WARNING
+ KLogger::WARN
);
}
}
namespace Galette\Repository;
+use Galette\Common\KLogger as KLogger;
use Galette\Entity\Group as Group;
use Galette\Entity\Adherent as Adherent;
} 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
);
}
} 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
);
}
}
$result = $select->query()->fetchAll();
$log->log(
'Exectued query: ' . $select->__toString(),
- PEAR_LOG_DEBUG
+ KLogger::DEBUG
);
$groups = array();
foreach ( $result as $r ) {
$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;
}
$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
$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 .
'Unable to add member `' . $adh->sname . '` (' . $adh->id .
') to specified groups |' .
$e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
}
} 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
);
}
}
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;
$log->log(
"The following query will be executed: \n" .
$select->__toString(),
- PEAR_LOG_DEBUG
+ KLogger::DEBUG
);
$members = array();
/** 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
);
}
}
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 ' .
$log->log(
'Unable to delete selected member(s) |' .
$e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
}
//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;
}
$log->log(
"The following query will be executed: \n" .
$select->__toString(),
- PEAR_LOG_DEBUG
+ KLogger::DEBUG
);
if ( $filters ) {
$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;
}
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;
}
$log->log(
"The following query will be executed: \n" .
$select->__toString(),
- PEAR_LOG_DEBUG
+ KLogger::DEBUG
);
$result = $select->query();
/** 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
);
}
}
/** 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;
}
/** 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;
}
/** TODO */
$log->log(
__METHOD__ . ' | ' . $e->getMessage(),
- PEAR_LOG_WARNING
+ KLogger::WARN
);
}
}
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;
/** 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;
}
/** 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;
}
/** 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;
}
/** TODO */
$log->log(
__METHOD__ . ' | ' . $e->getMessage(),
- PEAR_LOG_WARNING
+ KLogger::WARN
);
}
}
$log->log(
'An error occured trying to remove transactions | ' .
$e->getMessage(),
- PEAR_LOG_ERR
+ KLogger::ERR
);
return false;
}
//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;
}
$log->log(
'[Transactions] Getting property `' . $name . '`',
- PEAR_LOG_DEBUG
+ KLogger::DEBUG
);
if ( in_array($name, $this->pagination_fields) ) {
} else {
$log->log(
'[Transactions] Unable to get proprety `' .$name . '`',
- PEAR_LOG_WARNING
+ KLogger::WARN
);
}
}*/
} else {
$log->log(
'[Transactions] Setting property `' . $name . '`',
- PEAR_LOG_DEBUG
+ KLogger::DEBUG
);
$forbidden = array();
} else {
$log->log(
'[Transactions] Unable to set proprety `' .$name . '`',
- PEAR_LOG_WARNING
+ KLogger::WARN
);
}
}
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();
$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;
$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
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) ) {
if ( GALETTE_MODE === 'DEMO' ) {
$log->log(
'Trying to set superadmin login while in DEMO.',
- PEAR_LOG_WARNING
+ KLogger::WARN
);
} else {
if ( strlen($value) < 4 ) {
if ( GALETTE_MODE == 'DEMO' ) {
$log->log(
'Trying to set superadmin pass while in DEMO.',
- PEAR_LOG_WARNING
+ KLogger::WARN
);
} else {
if ( strlen($value) < 4 ) {
} 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']
} 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']
$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
);
}
$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
);
}
}