mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-22 18:09:06 +01:00
Code cleaning: fix tabs
This commit is contained in:
parent
febb83e39d
commit
40fdc92451
47 changed files with 1814 additions and 1795 deletions
|
@ -47,17 +47,17 @@ LSerror :: defineError('SUPANN_04',
|
|||
___("SUPANN: Fail to load nomenclature %{nomenclature}.")
|
||||
);
|
||||
|
||||
/**
|
||||
/**
|
||||
* Verification du support SUPANN par ldapSaisie
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
*
|
||||
* @retval boolean true si SUPANN est pleinement supporté, false sinon
|
||||
*/
|
||||
function LSaddon_supann_support() {
|
||||
function LSaddon_supann_support() {
|
||||
$retval = true;
|
||||
|
||||
$MUST_DEFINE_STRING= array(
|
||||
$MUST_DEFINE_STRING = array(
|
||||
'LS_SUPANN_LASTNAME_ATTR',
|
||||
'LS_SUPANN_FIRSTNAME_ATTR',
|
||||
'LS_SUPANN_LSOBJECT_ENTITE_TYPE',
|
||||
|
@ -75,13 +75,13 @@ LSerror :: defineError('SUPANN_04',
|
|||
foreach(LSconfig :: get('ldap_servers') as $id => $infos) {
|
||||
if ( !isset($infos['globals'][$string]) || !is_string($infos['globals'][$string])) {
|
||||
LSerror :: addErrorCode('SUPANN_SUPPORT_01',$string);
|
||||
$retval=false;
|
||||
$retval = false;
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$MUST_DEFINE_ARRAY= array(
|
||||
$MUST_DEFINE_ARRAY = array(
|
||||
'LS_SUPANN_LSOBJECT_PARRAIN_TYPES',
|
||||
'supannNomenclatures',
|
||||
);
|
||||
|
@ -99,13 +99,13 @@ LSerror :: defineError('SUPANN_04',
|
|||
}
|
||||
|
||||
return $retval;
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* Fonctions de génération de valeurs d'attributs
|
||||
**********************************************************************/
|
||||
* Fonctions de génération de valeurs d'attributs
|
||||
**********************************************************************/
|
||||
|
||||
/**
|
||||
/**
|
||||
* Generation du displayName
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
|
@ -114,13 +114,19 @@ LSerror :: defineError('SUPANN_04',
|
|||
*
|
||||
* @retval string Le displayName ou false si il y a un problème durant la génération
|
||||
*/
|
||||
function generate_displayName($ldapObject) {
|
||||
function generate_displayName($ldapObject) {
|
||||
if ( get_class($ldapObject -> attrs[ $GLOBALS['LS_SUPANN_LASTNAME_ATTR'] ]) != 'LSattribute' ) {
|
||||
LSerror :: addErrorCode('SUPANN_01',array('dependency' => $GLOBALS['LS_SUPANN_LASTNAME_ATTR'], 'attr' => 'cn'));
|
||||
LSerror :: addErrorCode(
|
||||
'SUPANN_01',
|
||||
array('dependency' => $GLOBALS['LS_SUPANN_LASTNAME_ATTR'], 'attr' => 'cn')
|
||||
);
|
||||
return;
|
||||
}
|
||||
if ( get_class($ldapObject -> attrs[ $GLOBALS['LS_SUPANN_FIRSTNAME_ATTR'] ]) != 'LSattribute' ) {
|
||||
LSerror :: addErrorCode('SUPANN_01',array('dependency' => $GLOBALS['LS_SUPANN_FIRSTNAME_ATTR'], 'attr' => 'cn'));
|
||||
LSerror :: addErrorCode(
|
||||
'SUPANN_01',
|
||||
array('dependency' => $GLOBALS['LS_SUPANN_FIRSTNAME_ATTR'], 'attr' => 'cn')
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -128,9 +134,9 @@ LSerror :: defineError('SUPANN_04',
|
|||
$prenoms = $ldapObject -> attrs[ $GLOBALS['LS_SUPANN_FIRSTNAME_ATTR'] ] -> getValue();
|
||||
|
||||
return ($prenoms[0].' '.$noms[0]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Generation du CN
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
|
@ -139,13 +145,19 @@ LSerror :: defineError('SUPANN_04',
|
|||
*
|
||||
* @retval string Le CN ou false si il y a un problème durant la génération
|
||||
*/
|
||||
function generate_cn($ldapObject) {
|
||||
function generate_cn($ldapObject) {
|
||||
if ( get_class($ldapObject -> attrs[ $GLOBALS['LS_SUPANN_LASTNAME_ATTR'] ]) != 'LSattribute' ) {
|
||||
LSerror :: addErrorCode('SUPANN_01',array('dependency' => $GLOBALS['LS_SUPANN_LASTNAME_ATTR'], 'attr' => 'cn'));
|
||||
LSerror :: addErrorCode(
|
||||
'SUPANN_01',
|
||||
array('dependency' => $GLOBALS['LS_SUPANN_LASTNAME_ATTR'], 'attr' => 'cn')
|
||||
);
|
||||
return;
|
||||
}
|
||||
if ( get_class($ldapObject -> attrs[ $GLOBALS['LS_SUPANN_FIRSTNAME_ATTR'] ]) != 'LSattribute' ) {
|
||||
LSerror :: addErrorCode('SUPANN_01',array('dependency' => $GLOBALS['LS_SUPANN_FIRSTNAME_ATTR'], 'attr' => 'cn'));
|
||||
LSerror :: addErrorCode(
|
||||
'SUPANN_01',
|
||||
array('dependency' => $GLOBALS['LS_SUPANN_FIRSTNAME_ATTR'], 'attr' => 'cn')
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -153,9 +165,9 @@ LSerror :: defineError('SUPANN_04',
|
|||
$prenoms = $ldapObject -> attrs[ $GLOBALS['LS_SUPANN_FIRSTNAME_ATTR'] ] -> getValue();
|
||||
|
||||
return (withoutAccents($noms[0]).' '.withoutAccents($prenoms[0]));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Generation des valeurs de l'attribut eduPersonOrgUnitDN à partir des
|
||||
* valeurs de l'attribut supannEntiteAffectation.
|
||||
*
|
||||
|
@ -166,27 +178,30 @@ LSerror :: defineError('SUPANN_04',
|
|||
* @retval array Les valeurs de l'attribut eduPersonOrgUnitDN ou false
|
||||
* si il y a un problème durant la génération
|
||||
*/
|
||||
function generate_eduPersonOrgUnitDN($ldapObject) {
|
||||
function generate_eduPersonOrgUnitDN($ldapObject) {
|
||||
if ( get_class($ldapObject -> attrs[ 'supannEntiteAffectation' ]) != 'LSattribute' ) {
|
||||
LSerror :: addErrorCode('SUPANN_01',array('dependency' => 'supannEntiteAffectation', 'attr' => 'eduPersonOrgUnitDN'));
|
||||
LSerror :: addErrorCode(
|
||||
'SUPANN_01',
|
||||
array('dependency' => 'supannEntiteAffectation', 'attr' => 'eduPersonOrgUnitDN')
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
$affectations = $ldapObject -> attrs[ 'supannEntiteAffectation' ] -> getUpdateData();
|
||||
|
||||
$basedn=LSconfig :: get('LSobjects.'.$GLOBALS['LS_SUPANN_LSOBJECT_ENTITE_TYPE'].'.container_dn').','.LSsession::getTopDn();
|
||||
if ($basedn=="") {
|
||||
$basedn = LSconfig :: get('LSobjects.'.$GLOBALS['LS_SUPANN_LSOBJECT_ENTITE_TYPE'].'.container_dn').','.LSsession::getTopDn();
|
||||
if ($basedn == "") {
|
||||
LSerror :: addErrorCode('SUPANN_02','eduPersonOrgUnitDN');
|
||||
return;
|
||||
}
|
||||
|
||||
$retval=array();
|
||||
$retval = array();
|
||||
foreach ($affectations as $aff) {
|
||||
$retval[]="supannCodeEntite=".$aff.",$basedn";
|
||||
$retval[] = "supannCodeEntite=".$aff.",$basedn";
|
||||
}
|
||||
|
||||
return $retval;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generation de la valeur de l'attribut eduPersonPrimaryOrgUnitDN
|
||||
|
@ -199,7 +214,7 @@ LSerror :: defineError('SUPANN_04',
|
|||
* @retval array La valeur de l'attribut eduPersonPrimaryOrgUnitDN
|
||||
* ou false si il y a un problème durant la génération
|
||||
*/
|
||||
function generate_eduPersonPrimaryOrgUnitDN($ldapObject) {
|
||||
function generate_eduPersonPrimaryOrgUnitDN($ldapObject) {
|
||||
if ( get_class($ldapObject -> attrs[ 'supannEntiteAffectationPrincipale' ]) != 'LSattribute' ) {
|
||||
LSerror :: addErrorCode('SUPANN_01',array('dependency' => 'supannEntiteAffectationPrincipale', 'attr' => 'eduPersonPrimaryOrgUnitDN'));
|
||||
return;
|
||||
|
@ -207,19 +222,19 @@ LSerror :: defineError('SUPANN_04',
|
|||
|
||||
$affectations = $ldapObject -> attrs[ 'supannEntiteAffectationPrincipale' ] -> getUpdateData();
|
||||
|
||||
$basedn=LSconfig :: get('LSobjects.'.$GLOBALS['LS_SUPANN_LSOBJECT_ENTITE_TYPE'].'.container_dn').','.LSsession::getTopDn();
|
||||
if ($basedn=="") {
|
||||
$basedn = LSconfig :: get('LSobjects.'.$GLOBALS['LS_SUPANN_LSOBJECT_ENTITE_TYPE'].'.container_dn').','.LSsession::getTopDn();
|
||||
if ($basedn == "") {
|
||||
LSerror :: addErrorCode('SUPANN_02','eduPersonPrimaryOrgUnitDN');
|
||||
return;
|
||||
}
|
||||
|
||||
$retval=array();
|
||||
$retval = array();
|
||||
foreach ($affectations as $aff) {
|
||||
$retval[]="supannCodeEntite=".$aff.",$basedn";
|
||||
}
|
||||
|
||||
return $retval;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generation de la valeur de l'attribut eduPersonOrgDN
|
||||
|
@ -235,7 +250,7 @@ LSerror :: defineError('SUPANN_04',
|
|||
* @retval array La valeur de l'attribut eduPersonOrgDN ou false
|
||||
* si il y a un problème durant la génération
|
||||
*/
|
||||
function generate_eduPersonOrgDN($ldapObject) {
|
||||
function generate_eduPersonOrgDN($ldapObject) {
|
||||
if ( get_class($ldapObject -> attrs[ 'supannEtablissement' ]) != 'LSattribute' ) {
|
||||
LSerror :: addErrorCode('SUPANN_01',array('dependency' => 'supannEtablissement', 'attr' => 'eduPersonOrgDN'));
|
||||
return;
|
||||
|
@ -249,7 +264,7 @@ LSerror :: defineError('SUPANN_04',
|
|||
}
|
||||
|
||||
return $retval;
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* Fonction de parsing des valeurs spécifiques SUPANN
|
||||
|
@ -266,15 +281,15 @@ LSerror :: defineError('SUPANN_04',
|
|||
*
|
||||
* @retval array Un tableau cle->valeur contenant label et value ou False
|
||||
**/
|
||||
function supannParseLabeledValue($value) {
|
||||
if (preg_match('/^\{([^\}]*)\}(.*)$/',$value,$m)) {
|
||||
function supannParseLabeledValue($value) {
|
||||
if (preg_match('/^\{([^\}]*)\}(.*)$/', $value, $m)) {
|
||||
return array(
|
||||
'label'=>$m[1],
|
||||
'value'=>$m[2]
|
||||
'label' => $m[1],
|
||||
'value' => $m[2]
|
||||
);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse une valeur composite SUPANN
|
||||
|
@ -289,16 +304,16 @@ LSerror :: defineError('SUPANN_04',
|
|||
*
|
||||
* @retval array Un tableau contenant key->value ou false en cas d'erreur
|
||||
**/
|
||||
function supannParseCompositeValue($val) {
|
||||
function supannParseCompositeValue($val) {
|
||||
if (preg_match_all('/\[([^=]*)=([^\]]*)\]/',$val,$matches)) {
|
||||
$parseValue=array();
|
||||
for($i=0;$i<count($matches[0]);$i++) {
|
||||
$parseValue[$matches[1][$i]]=$matches[2][$i];
|
||||
$parseValue = array();
|
||||
for($i=0; $i<count($matches[0]); $i++) {
|
||||
$parseValue[$matches[1][$i]] = array$matches[2][$i];
|
||||
}
|
||||
return $parseValue;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* Fonctions relatives aux entités
|
||||
|
@ -311,7 +326,7 @@ LSerror :: defineError('SUPANN_04',
|
|||
*
|
||||
* @retval string Le nom de l'entite
|
||||
**/
|
||||
function supanGetEntiteNameById($id) {
|
||||
function supanGetEntiteNameById($id) {
|
||||
if (LSsession::loadLSobject($GLOBALS['LS_SUPANN_LSOBJECT_ENTITE_TYPE'])) {
|
||||
$e = new $GLOBALS['LS_SUPANN_LSOBJECT_ENTITE_TYPE']();
|
||||
$list=$e -> listObjectsName("(supannCodeEntite=$id)",NULL,array('onlyAccessible' => false),$GLOBALS['LS_SUPANN_LSOBJECT_ENTITE_FORMAT_SHORTNAME']);
|
||||
|
@ -319,8 +334,8 @@ LSerror :: defineError('SUPANN_04',
|
|||
return array_pop($list);
|
||||
}
|
||||
}
|
||||
return getFData(__("Entity %{id} (unrecognized)"),$id);
|
||||
}
|
||||
return getFData(__("Entity %{id} (unrecognized)"), $id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Valide l'ID d'une entite
|
||||
|
@ -329,7 +344,7 @@ LSerror :: defineError('SUPANN_04',
|
|||
*
|
||||
* @retval boolean True si une entité avec cet ID existe, False sinon
|
||||
**/
|
||||
function supannValidateEntityId($id) {
|
||||
function supannValidateEntityId($id) {
|
||||
if (LSsession::loadLSobject($GLOBALS['LS_SUPANN_LSOBJECT_ENTITE_TYPE'])) {
|
||||
$e = new $GLOBALS['LS_SUPANN_LSOBJECT_ENTITE_TYPE']();
|
||||
$list=$e -> listObjectsName("(supannCodeEntite=$id)",NULL,array('onlyAccessible' => False));
|
||||
|
@ -338,7 +353,7 @@ LSerror :: defineError('SUPANN_04',
|
|||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Cherche des entités répond au pattern de recherche passé en paramètres
|
||||
|
@ -351,8 +366,8 @@ LSerror :: defineError('SUPANN_04',
|
|||
* @retval array Tableau du résultat de la recherche mettant en relation
|
||||
* l'identifiant des entités trouvés avec leur nom d'affichage.
|
||||
**/
|
||||
function supannSearchEntityByPattern($pattern, $max_matches=10) {
|
||||
$retval=array();
|
||||
function supannSearchEntityByPattern($pattern, $max_matches=10) {
|
||||
$retval = array();
|
||||
if (LSsession::loadLSclass('LSsearch')) {
|
||||
$search=new LSsearch(
|
||||
$GLOBALS['LS_SUPANN_LSOBJECT_ENTITE_TYPE'],
|
||||
|
@ -367,13 +382,14 @@ LSerror :: defineError('SUPANN_04',
|
|||
$search -> run();
|
||||
|
||||
foreach($search -> getSearchEntries() as $e) {
|
||||
$code=$e->get('supannCodeEntite');
|
||||
if (is_array($code)) $code=$code[0];
|
||||
$retval[$code]=$e->displayName;
|
||||
$code = $e->get('supannCodeEntite');
|
||||
if (is_array($code))
|
||||
$code = $code[0];
|
||||
$retval[$code] = $e->displayName;
|
||||
}
|
||||
}
|
||||
return $retval;
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* Fonctions relatives aux parrains
|
||||
|
@ -386,7 +402,7 @@ LSerror :: defineError('SUPANN_04',
|
|||
*
|
||||
* @retval array Le nom, le type et le DN du parrain (Format: array('dn' => [DN], 'type' => [type], 'name' => [name]))
|
||||
**/
|
||||
function supanGetParrainInfoByDN($dn) {
|
||||
function supanGetParrainInfoByDN($dn) {
|
||||
$matched = array(
|
||||
'dn' => $dn,
|
||||
'type' => null,
|
||||
|
@ -406,7 +422,7 @@ LSerror :: defineError('SUPANN_04',
|
|||
}
|
||||
}
|
||||
return $matched;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Valide le DN d'un parrain
|
||||
|
@ -415,10 +431,10 @@ LSerror :: defineError('SUPANN_04',
|
|||
*
|
||||
* @retval boolean True si un parrain avec ce DN existe, False sinon
|
||||
**/
|
||||
function supannValidateParrainDN($dn) {
|
||||
function supannValidateParrainDN($dn) {
|
||||
$info = supanGetParrainInfoByDN($dn);
|
||||
return !is_null($info['type']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Cherche des parrains répondant au pattern de recherche passé en paramètres
|
||||
|
@ -430,8 +446,8 @@ LSerror :: defineError('SUPANN_04',
|
|||
* @retval array Tableau du résultat de la recherche mettant en relation
|
||||
* le DN des parrains trouvés avec leur nom d'affichage.
|
||||
**/
|
||||
function supannSearchParrainByPattern($pattern, $max_matches=10) {
|
||||
$retval=array();
|
||||
function supannSearchParrainByPattern($pattern, $max_matches=10) {
|
||||
$retval = array();
|
||||
if (LSsession::loadLSclass('LSsearch')) {
|
||||
foreach($GLOBALS['LS_SUPANN_LSOBJECT_PARRAIN_TYPES'] as $type) {
|
||||
if (!LSsession::loadLSobject($type)) continue;
|
||||
|
@ -453,7 +469,7 @@ LSerror :: defineError('SUPANN_04',
|
|||
}
|
||||
}
|
||||
return $retval;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -469,7 +485,7 @@ LSerror :: defineError('SUPANN_04',
|
|||
*
|
||||
* @retval booleab True si valide, False sinon
|
||||
**/
|
||||
function supannValidateNomenclatureValue($table, $label, $value) {
|
||||
function supannValidateNomenclatureValue($table, $label, $value) {
|
||||
if (!supannLoadNomenclature($table))
|
||||
return false;
|
||||
if ($label) {
|
||||
|
@ -500,7 +516,7 @@ LSerror :: defineError('SUPANN_04',
|
|||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le label d'une valeur en fonction de la table de nomenclature
|
||||
|
@ -513,12 +529,12 @@ LSerror :: defineError('SUPANN_04',
|
|||
* @retval array Le label de la valeur. En cas de valeur nor-reconnue, retourne
|
||||
* la valeur en spécifiant qu'elle n'est pas reconnue.
|
||||
**/
|
||||
function supannGetNomenclatureLabel($table, $label, $value) {
|
||||
function supannGetNomenclatureLabel($table, $label, $value) {
|
||||
$translated = supannValidateNomenclatureValue($table, $label, $value);
|
||||
if ($translated)
|
||||
return $translated['translated'];
|
||||
return getFData(__("%{value} (unrecognized value)"), $value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne les valeurs possibles d'une table de nomenclature pour chaque fournisseur
|
||||
|
@ -528,7 +544,7 @@ LSerror :: defineError('SUPANN_04',
|
|||
* @retval array Tableau contenant pour chaque fournisseur, les valeurs possibles de
|
||||
* la table de nomenclature
|
||||
**/
|
||||
function supannGetNomenclatureTable($table) {
|
||||
function supannGetNomenclatureTable($table) {
|
||||
$retval = array();
|
||||
if (!supannLoadNomenclature($table))
|
||||
return $retval;
|
||||
|
@ -538,7 +554,7 @@ LSerror :: defineError('SUPANN_04',
|
|||
}
|
||||
}
|
||||
return $retval;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne les valeurs possibles d'une table de nomenclature
|
||||
|
@ -551,7 +567,7 @@ LSerror :: defineError('SUPANN_04',
|
|||
* @retval array Tableau contenant les valeurs possibles de la table
|
||||
* de nomenclature
|
||||
**/
|
||||
function supannGetNomenclaturePossibleValues($table, $add_provider_label=True) {
|
||||
function supannGetNomenclaturePossibleValues($table, $add_provider_label=True) {
|
||||
$retval = array();
|
||||
if (!supannLoadNomenclature($table))
|
||||
return $retval;
|
||||
|
@ -565,7 +581,7 @@ LSerror :: defineError('SUPANN_04',
|
|||
}
|
||||
}
|
||||
return $retval;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Cherche des valeurs d'une nomenclature répondant au pattern de recherche passé en paramètres
|
||||
|
@ -576,8 +592,8 @@ LSerror :: defineError('SUPANN_04',
|
|||
*
|
||||
* @retval array Tableau du résultat de la recherche
|
||||
**/
|
||||
function supannSearchNomenclatureValueByPattern($table, $pattern, $max_matches=10) {
|
||||
$retval=array();
|
||||
function supannSearchNomenclatureValueByPattern($table, $pattern, $max_matches=10) {
|
||||
$retval = array();
|
||||
$pattern = withoutAccents(strtolower($pattern));
|
||||
foreach(supannGetNomenclatureTable($table) as $label => $values) {
|
||||
foreach($values as $value => $txt) {
|
||||
|
@ -595,7 +611,7 @@ LSerror :: defineError('SUPANN_04',
|
|||
break;
|
||||
}
|
||||
return $retval;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne les valeurs possibles de l'attribut supannCivilite.
|
||||
|
|
|
@ -69,5 +69,5 @@ class LSauthMethod_anonymous extends LSauthMethod {
|
|||
* Error Codes
|
||||
*/
|
||||
LSerror :: defineError('LSauthMethod_anonymous_01',
|
||||
___("LSauthMethod_anonymous : You must define the LSAUTHMETHOD_ANONYMOUS_USER contant in the configuration file.")
|
||||
___("LSauthMethod_anonymous : You must define the LSAUTHMETHOD_ANONYMOUS_USER contant in the configuration file.")
|
||||
);
|
||||
|
|
|
@ -326,7 +326,7 @@ class LSformElement extends LSlog_staticLoggerClass {
|
|||
/**
|
||||
* Return a parameter (or default value)
|
||||
*
|
||||
* @param[] $param The parameter
|
||||
* @param[] $param The configuration parameter
|
||||
* @param[] $default The default value (default : null)
|
||||
* @param[] $cast Cast resulting value in specific type (default : disabled)
|
||||
*
|
||||
|
|
|
@ -160,7 +160,7 @@ class LSioFormatDriver extends LSlog_staticLoggerClass {
|
|||
/**
|
||||
* Return a option parameter (or default value)
|
||||
*
|
||||
* @param[] $param The option parameter
|
||||
* @param[] $param The configuration parameter
|
||||
* @param[] $default The default value (default : null)
|
||||
* @param[] $cast Cast resulting value in specific type (default : disabled)
|
||||
*
|
||||
|
|
|
@ -323,7 +323,9 @@ class LSlog {
|
|||
* @retval void
|
||||
**/
|
||||
public static function exception($exception, $prefix=null, $fatal=true, $logger=null) {
|
||||
$message = ($prefix?"$prefix :\n":"An exception occured :\n"). self :: get_debug_backtrace_context(). "\n" .
|
||||
$message =
|
||||
($prefix?"$prefix :\n":"An exception occured :\n").
|
||||
self :: get_debug_backtrace_context(). "\n" .
|
||||
"## ".$exception->getFile().":".$exception->getLine(). " : ". $exception->getMessage();
|
||||
if (is_null($logger))
|
||||
self :: logging(($fatal?'FATAL':'ERROR'), $message);
|
||||
|
|
|
@ -86,7 +86,8 @@ class LSselect extends LSlog_staticLoggerClass {
|
|||
* @param[] $id string The LSselect ID
|
||||
* @param[] $param string The configuration parameter
|
||||
* @param[] $default mixed The default value (optional, default : null)
|
||||
* @param[] $cast Cast string|null resulting value in specific type (optional, default : null=disabled)
|
||||
* @param[] $cast Cast string|null resulting value in specific type
|
||||
* (optional, default : null=disabled)
|
||||
*
|
||||
* @retval mixed The configuration parameter value or default value if not set
|
||||
**/
|
||||
|
|
Loading…
Reference in a new issue