diff --git a/ecrire/inc/utils.php b/ecrire/inc/utils.php index d8d3604ca6c548aadc19f4897d8bab7b2b2f0a82..d420720fe309daaf70728fa74a6d8faaf58056f4 100644 --- a/ecrire/inc/utils.php +++ b/ecrire/inc/utils.php @@ -228,9 +228,10 @@ function pipeline($action, $val=null) { * spip_log($message,_LOG_DEBUG) * spip_log($message,'recherche.'._LOG_DEBUG) * ``` - * + * + * @api * @link http://doc.spip.org/@spip_log - * @see inc_log_dist() + * @uses inc_log_dist() * * @param string $message * Message à loger @@ -251,7 +252,7 @@ function spip_log($message=NULL, $name=NULL) { if (!isset($regs[2]) OR !$niveau = $regs[2]) $niveau = _LOG_INFO; - if ($niveau <= _LOG_FILTRE_GRAVITE) { + if ($niveau <= (defined('_LOG_FILTRE_GRAVITE') ? _LOG_FILTRE_GRAVITE : _LOG_INFO_IMPORTANTE)) { if (!$pre){ $pre = array( _LOG_HS=>'HS:', @@ -269,9 +270,13 @@ function spip_log($message=NULL, $name=NULL) { } } -// -// Enregistrement des journaux -// +/** + * Enregistrement des journaux + * + * @uses inc_journal_dist() + * @param string $phrase Texte du journal + * @param array $opt Tableau d'options +**/ function journal($phrase, $opt = array()) { $journal = charger_fonction('journal', 'inc'); $journal($phrase, $opt); diff --git a/ecrire/inc_version.php b/ecrire/inc_version.php index a610ed1af8081a2343c3fbfb241386f19390c01a..1472edcd97f8a316e2245eb10acad8eb2adbd0d9 100644 --- a/ecrire/inc_version.php +++ b/ecrire/inc_version.php @@ -33,8 +33,10 @@ error_reporting(E_ALL ^ E_NOTICE); /** version PHP minimum exigee (cf. inc/utils) */ define ('_PHP_MIN', '5.1.0'); -/** le nom du repertoire ecrire/ */ -if (!defined('_DIR_RESTREINT_ABS')) define('_DIR_RESTREINT_ABS', 'ecrire/'); +if (!defined('_DIR_RESTREINT_ABS')) { + /** le nom du repertoire ecrire/ */ + define('_DIR_RESTREINT_ABS', 'ecrire/'); +} /** Chemin relatif pour aller dans ecrire * vide si on est dans ecrire, 'ecrire/' sinon */ @@ -102,12 +104,15 @@ OR (@file_exists($f = _ROOT_RESTREINT . _NOM_CONFIG . '.php'))) { define('_FILE_OPTIONS', $f); } else define('_FILE_OPTIONS', ''); +if (!defined('MODULES_IDIOMES')) { /** * Modules par défaut pour la traduction. * * Constante utilisée par le compilateur et le décompilateur - * sa valeur etant traitée par inc_traduire_dist */ -if (!defined('MODULES_IDIOMES')) define('MODULES_IDIOMES', 'public|spip|ecrire'); + * sa valeur etant traitée par inc_traduire_dist + */ + define('MODULES_IDIOMES', 'public|spip|ecrire'); +} // *** Fin des define *** // @@ -347,15 +352,16 @@ require_once _ROOT_RESTREINT . 'base/connect_sql.php'; if (_FILE_OPTIONS) {include_once _FILE_OPTIONS;} -/** Compatibilite PHP 5.3 */ -if (!defined('E_DEPRECATED')) define('E_DEPRECATED', 8192); -/** Masquer les warning */ -if (!defined('SPIP_ERREUR_REPORT')) define('SPIP_ERREUR_REPORT', E_ALL ^ E_NOTICE ^ E_DEPRECATED); +if (!defined('E_DEPRECATED')) { + /** Compatibilite PHP 5.3 */ + define('E_DEPRECATED', 8192); +} +if (!defined('SPIP_ERREUR_REPORT')) { + /** Masquer les warning */ + define('SPIP_ERREUR_REPORT', E_ALL ^ E_NOTICE ^ E_DEPRECATED); +} error_reporting(SPIP_ERREUR_REPORT); -/** niveau maxi d'enregistrement des logs */ -defined('_LOG_FILTRE_GRAVITE') || define('_LOG_FILTRE_GRAVITE', _LOG_INFO_IMPORTANTE); - // Initialisations critiques non surchargeables par les plugins // INITIALISER LES REPERTOIRES NON PARTAGEABLES ET LES CONSTANTES // (charge aussi inc/flock) @@ -387,11 +393,19 @@ if (@is_readable(_CACHE_PLUGINS_OPT) AND @is_readable(_CACHE_PLUGINS_PATH)){ // de chargement des plugins et des pipelines actualise_plugins_actifs(); } + // Initialisations non critiques surchargeables par les plugins spip_initialisation_suite(); -if (!defined('_OUTILS_DEVELOPPEURS')) - define('_OUTILS_DEVELOPPEURS',false); +if (!defined('_LOG_FILTRE_GRAVITE')) { + /** niveau maxi d'enregistrement des logs */ + define('_LOG_FILTRE_GRAVITE', _LOG_INFO_IMPORTANTE); +} + +if (!defined('_OUTILS_DEVELOPPEURS')) { + /** Activer des outils pour développeurs ? */ + define('_OUTILS_DEVELOPPEURS', false); +} // charger systematiquement inc/autoriser dans l'espace restreint if (test_espace_prive())