From b33c1d721c0e0025d4b6e32e1e14ca37f9118ddc Mon Sep 17 00:00:00 2001 From: Fil <fil@rezo.net> Date: Thu, 2 Mar 2006 00:00:40 +0000 Subject: [PATCH] nettoyage des include_ecrire() en include_spip() et petits bugs --- ecrire/action/cookie.php | 4 ++-- ecrire/action/ical.php | 2 +- ecrire/action/inscription.php | 2 +- ecrire/action/tester.php | 2 +- ecrire/base/upgrade.php | 8 ++++---- ecrire/exec/admin_plugin.php | 2 +- ecrire/exec/convert_utf8.php | 2 +- ecrire/exec/install.php | 4 ++-- ecrire/inc/acces.php | 2 +- ecrire/inc/config.php | 2 +- ecrire/inc/import.php | 2 +- ecrire/inc/invalideur.php | 2 +- ecrire/inc/minipres.php | 2 +- ecrire/inc/plugin.php | 2 +- ecrire/inc/presentation.php | 2 +- ecrire/inc/rubriques.php | 4 ++-- ecrire/inc/session.php | 2 +- ecrire/inc/utils.php | 6 +++--- ecrire/inc_debug_sql.php | 8 ++++---- ecrire/public.php | 2 +- ecrire/public/cache.php | 2 +- ecrire/public/calcul-outils.php | 2 +- ecrire/public/calcul.php | 2 +- ecrire/public/compilo.php | 2 +- ecrire/public/criteres.php | 2 +- ecrire/public/messforum.php | 2 +- ecrire/urls/propres.php | 2 +- formulaires/inc-formulaire_forum.php | 2 +- formulaires/inc-formulaire_signature.php | 4 ++-- formulaires/inc-formulaire_site.php | 2 +- formulaires/inc-login_public.php | 4 ++-- 31 files changed, 44 insertions(+), 44 deletions(-) diff --git a/ecrire/action/cookie.php b/ecrire/action/cookie.php index a930d2c14f..78eb4520c2 100644 --- a/ecrire/action/cookie.php +++ b/ecrire/action/cookie.php @@ -144,7 +144,7 @@ if ($essai_login == "oui") { if ($ldap_present) $auths[] = 'ldap'; $ok = false; foreach ($auths as $nom_auth) { - include_ecrire("inc_auth_".$nom_auth); + include_spip('inc/auth_'.$nom_auth); $classe_auth = "Auth_".$nom_auth; $auth = new $classe_auth; if ($auth->init()) { @@ -265,7 +265,7 @@ if (ereg("^Apache", $GLOBALS['SERVER_SOFTWARE'])) { redirige_par_entete($redirect); } else { - include_ecrire('inc_headers'); + include_spip('inc/headers'); spip_header("Refresh: 0; url=" . $redirect); echo "<html><head>"; echo "<meta http-equiv='Refresh' content='0; url=".$redirect."'>"; diff --git a/ecrire/action/ical.php b/ecrire/action/ical.php index 630926120f..31f427dd5c 100644 --- a/ecrire/action/ical.php +++ b/ecrire/action/ical.php @@ -15,7 +15,7 @@ if (!defined("_ECRIRE_INC_VERSION")) return; include_spip('inc/minipres'); include_spip('inc/texte'); include_spip('inc/charsets'); -include_ecrire("inc_meta"); +include_spip('inc/meta'); include_spip('inc/acces'); // avec le nouveau compilateur tout ceci me semble faisable en squelette. diff --git a/ecrire/action/inscription.php b/ecrire/action/inscription.php index 2a52d1a079..6f6a724d33 100644 --- a/ecrire/action/inscription.php +++ b/ecrire/action/inscription.php @@ -15,7 +15,7 @@ function action_inscription_dist() { include_spip('inc-formulaire_inscription'); include_spip('public/global'); include_spip('inc/lang'); - include_ecrire('inc_headers'); + include_spip('inc/headers'); utiliser_langue_site(); utiliser_langue_visiteur(); diff --git a/ecrire/action/tester.php b/ecrire/action/tester.php index 548f7bb4ee..8bf4a7dd39 100644 --- a/ecrire/action/tester.php +++ b/ecrire/action/tester.php @@ -11,7 +11,7 @@ \***************************************************************************/ if (!defined("_ECRIRE_INC_VERSION")) return; -include_ecrire("inc_meta"); +include_spip('inc/meta'); // Tester nos capacites function action_tester_dist() { diff --git a/ecrire/base/upgrade.php b/ecrire/base/upgrade.php index a6a0cf9df2..98275a487d 100644 --- a/ecrire/base/upgrade.php +++ b/ecrire/base/upgrade.php @@ -16,7 +16,7 @@ if (!defined("_ECRIRE_INC_VERSION")) return; function maj_version ($version, $test = true) { if ($test) { - include_ecrire('inc_meta'); + include_spip('inc/meta'); ecrire_meta('version_installee', $version); ecrire_metas(); spip_log("mise a jour de la base vers $version"); @@ -397,7 +397,7 @@ function maj_base() { if ($version_installee < 1.414) { // Forum par defaut "en dur" dans les spip_articles // -> non, prio (priori), pos (posteriori), abo (abonnement) - include_ecrire ("inc_meta"); + include_spip('inc/meta'); $accepter_forum = substr($GLOBALS['meta']["forums_publics"],0,3) ; $query = "ALTER TABLE spip_articles CHANGE accepter_forum accepter_forum CHAR(3) NOT NULL"; $result = spip_query($query); @@ -422,7 +422,7 @@ function maj_base() { $query = "SELECT * FROM spip_auteurs WHERE statut = '0minirezo' AND email != '' ORDER BY id_auteur LIMIT 1"; $result = spip_query($query); if ($webmaster = spip_fetch_array($result)) { - include_ecrire("inc_meta"); + include_spip('inc/meta'); ecrire_meta('email_webmaster', $webmaster['email']); ecrire_metas(); } @@ -1135,7 +1135,7 @@ function maj_base() { spip_query("INSERT INTO spip_index (hash,points,id_objet,id_table) SELECT hash,points,id_syndic as id_objet,'9' as id_table FROM spip_index_syndic"); spip_query("DROP TABLE IF EXISTS spip_index_syndic"); - include_ecrire('inc_meta'); + include_spip('inc/meta'); lire_metas(); ecrire_metas(); diff --git a/ecrire/exec/admin_plugin.php b/ecrire/exec/admin_plugin.php index 48ebf9e4a1..6e9f976aff 100644 --- a/ecrire/exec/admin_plugin.php +++ b/ecrire/exec/admin_plugin.php @@ -13,7 +13,7 @@ if (!defined("_ECRIRE_INC_VERSION")) return; include_spip('inc/config'); -include_ecrire ("inc_plugin"); +include_spip('inc/plugin'); include_spip('inc/presentation'); include_spip('inc/layer'); diff --git a/ecrire/exec/convert_utf8.php b/ecrire/exec/convert_utf8.php index 0b23b389fe..c3cdffc6a0 100644 --- a/ecrire/exec/convert_utf8.php +++ b/ecrire/exec/convert_utf8.php @@ -71,7 +71,7 @@ function demander_conversion($tables_a_convertir, $action) { } function exec_convert_utf8_dist() { - include_ecrire('inc_meta'); + include_spip('inc/meta'); include_spip('inc/charsets'); lire_metas(); diff --git a/ecrire/exec/install.php b/ecrire/exec/install.php index 12104cc904..04a344059d 100644 --- a/ecrire/exec/install.php +++ b/ecrire/exec/install.php @@ -127,7 +127,7 @@ function install_6() # maintenant on connait le vrai charset du site s'il est deja configure # sinon par defaut inc_meta reglera _DEFAULT_CHARSET # (les donnees arrivent de toute facon postees en _DEFAULT_CHARSET) - include_ecrire ('inc_meta'); + include_spip('inc/meta'); lire_metas(); if ($login) { @@ -547,7 +547,7 @@ function install_ldap5() install_debut_html(); include_once(_FILE_CONNECT_INS . _FILE_TMP . _EXTENSION_PHP); - include_ecrire('inc_meta'); + include_spip('inc/meta'); ecrire_meta("ldap_statut_import", $statut_ldap); ecrire_metas(); diff --git a/ecrire/inc/acces.php b/ecrire/inc/acces.php index 1d8aec7f2d..99b14f22b5 100644 --- a/ecrire/inc/acces.php +++ b/ecrire/inc/acces.php @@ -52,7 +52,7 @@ function low_sec($id_auteur) { // Pas d'id_auteur : low_sec if (!$id_auteur = intval($id_auteur)) { if (!$low_sec = $GLOBALS['meta']['low_sec']) { - include_ecrire('inc_meta'); + include_spip('inc/meta'); ecrire_meta('low_sec', $low_sec = creer_pass_aleatoire()); ecrire_metas(); } diff --git a/ecrire/inc/config.php b/ecrire/inc/config.php index 85896eaa78..99f994372c 100644 --- a/ecrire/inc/config.php +++ b/ecrire/inc/config.php @@ -12,7 +12,7 @@ if (!defined("_ECRIRE_INC_VERSION")) return; -include_ecrire ("inc_meta"); +include_spip('inc/meta'); // // Appliquer les valeurs par defaut pour les options non initialisees diff --git a/ecrire/inc/import.php b/ecrire/inc/import.php index eabe160f33..bd6d4637fc 100644 --- a/ecrire/inc/import.php +++ b/ecrire/inc/import.php @@ -347,7 +347,7 @@ function import_tables($f, $tables, $gz=false) { $_fseek = ($gz) ? gzseek : fseek; // utiliser une version fraiche des metas (ie pas le cache) - include_ecrire('inc_meta'); + include_spip('inc/meta'); lire_metas(); $s = spip_query("SELECT UNIX_TIMESTAMP(maj) AS d diff --git a/ecrire/inc/invalideur.php b/ecrire/inc/invalideur.php index e7d63f3f5b..8981607665 100644 --- a/ecrire/inc/invalideur.php +++ b/ecrire/inc/invalideur.php @@ -13,7 +13,7 @@ if (!defined("_ECRIRE_INC_VERSION")) return; -include_ecrire('inc_serialbase'); +include_spip('base/serial'); function supprime_invalideurs() { spip_query("DELETE FROM spip_caches"); diff --git a/ecrire/inc/minipres.php b/ecrire/inc/minipres.php index 71705cc5ed..c4a871db0b 100644 --- a/ecrire/inc/minipres.php +++ b/ecrire/inc/minipres.php @@ -24,7 +24,7 @@ function install_debut_html($titre = 'AUTO') { if ($titre=='AUTO') $titre=_T('info_installation_systeme_publication'); - include_ecrire('inc_headers'); + include_spip('inc/headers'); http_no_cache(); diff --git a/ecrire/inc/plugin.php b/ecrire/inc/plugin.php index 8b18bcaf81..4416d482c7 100644 --- a/ecrire/inc/plugin.php +++ b/ecrire/inc/plugin.php @@ -17,7 +17,7 @@ if (!defined("_ECRIRE_INC_VERSION")) return; define('_FILE_PLUGIN_CONFIG', "plugin.xml"); // besoin de inc_meta -include_ecrire ("inc_meta"); +include_spip('inc/meta'); // lecture des sous repertoire plugin existants function liste_plugin_files(){ diff --git a/ecrire/inc/presentation.php b/ecrire/inc/presentation.php index 4fad66f269..6aeb57600e 100644 --- a/ecrire/inc/presentation.php +++ b/ecrire/inc/presentation.php @@ -2172,7 +2172,7 @@ function init_entete($titre, $rubrique, $css='') { $nom_site_spip= _T('info_mon_site_spip'); // envoi des en-tetes, du doctype et du <head><title... - include_ecrire('inc_headers'); + include_spip('inc/headers'); http_no_cache(); $head = _DOCTYPE_ECRIRE . "<html lang='".$GLOBALS['spip_lang']."' dir='" diff --git a/ecrire/inc/rubriques.php b/ecrire/inc/rubriques.php index 15f1270288..8e2a19b35c 100644 --- a/ecrire/inc/rubriques.php +++ b/ecrire/inc/rubriques.php @@ -35,7 +35,7 @@ function calculer_rubriques() { // // Afficher les articles post-dates ? - include_ecrire('inc_meta'); + include_spip('inc/meta'); $postdates = ($GLOBALS['meta']["post_dates"] == "non") ? "AND fille.date <= NOW()" : ''; @@ -209,7 +209,7 @@ function calculer_langues_rubriques() { if ($GLOBALS['meta']['multi_rubriques'] == 'oui') { // Ecrire meta liste langues utilisees dans rubriques - include_ecrire('inc_meta'); + include_spip('inc/meta'); $s = spip_query ("SELECT lang FROM spip_rubriques WHERE lang != '' GROUP BY lang"); while ($row = spip_fetch_array($s)) { diff --git a/ecrire/inc/session.php b/ecrire/inc/session.php index f419d501ed..9580b1f10c 100644 --- a/ecrire/inc/session.php +++ b/ecrire/inc/session.php @@ -12,7 +12,7 @@ if (!defined("_ECRIRE_INC_VERSION")) return; -include_ecrire ("inc_meta"); +include_spip('inc/meta'); /* * Gestion de l'authentification par sessions diff --git a/ecrire/inc/utils.php b/ecrire/inc/utils.php index 6e0a91f6ff..3d94fc00b7 100644 --- a/ecrire/inc/utils.php +++ b/ecrire/inc/utils.php @@ -132,7 +132,7 @@ function minipipe($fonc,$val){ function pipeline($action,$val){ $ok = @is_readable($f = _DIR_SESSIONS."charger_pipelines.php"); if (!$ok){ - include_ecrire('inc_plugin'); + include_spip('inc/plugin'); // generer les fichiers php precompiles // de chargement des plugins et des pipelines verif_plugin(); @@ -152,7 +152,7 @@ function pipeline($action,$val){ $val = $val['data']; } else{ - include_ecrire('inc_plugin'); + include_spip('inc/plugin'); //on passe $action en arg pour creer la fonction meme si le pipe n'est defini nul part // vu qu'on est la c'est qu'il existe ! verif_plugin($action); @@ -553,7 +553,7 @@ function http_last_modified($lastmodified, $expire = 0) { $GLOBALS['HTTP_IF_MODIFIED_SINCE']); $if_modified_since = trim(str_replace('GMT', '', $if_modified_since)); if ($if_modified_since == $gmoddate) { - include_ecrire('inc_headers'); + include_spip('inc/headers'); http_status(304); $headers_only = true; } diff --git a/ecrire/inc_debug_sql.php b/ecrire/inc_debug_sql.php index 4376ead231..f0626493c5 100644 --- a/ecrire/inc_debug_sql.php +++ b/ecrire/inc_debug_sql.php @@ -124,7 +124,7 @@ function erreur_squelette($message='', $lieu='') { if ($_COOKIE['spip_admin'] OR $auteur_session['statut'] == '0minirezo' OR ($GLOBALS['var_mode'] == 'debug')) { - include_ecrire('inc_headers'); + include_spip('inc/headers'); lang_select($auteur_session['lang']); http_no_cache(); echo _DOCTYPE_ECRIRE, @@ -331,7 +331,7 @@ function debug_dumpfile ($texte, $fonc, $type) { // - ca fait 2 headers ! ob_end_clean(); - include_ecrire('inc_headers'); + include_spip('inc/headers'); http_no_cache(); lang_select($auteur_session['lang']); echo _DOCTYPE_ECRIRE, @@ -423,8 +423,8 @@ function debug_dumpfile ($texte, $fonc, $type) { $titre = 'zbug_' . $titre; } else { - include_ecrire("inc_spip_sax"); - $res = spip_sax($texte); + if ($sax = include_fonction('sax', 'inc'); + $res = $sax($texte); if (!$res) $err = _T('impossible'); elseif (ereg("^[[:space:]]*([^<][^0-9]*)([0-9]*)(.*[^0-9])([0-9]*)$", $GLOBALS['xhtml_error'], $r)) { diff --git a/ecrire/public.php b/ecrire/public.php index 037abf4535..6009b3a9b5 100644 --- a/ecrire/public.php +++ b/ecrire/public.php @@ -33,7 +33,7 @@ if (defined("_INC_PUBLIC")) { $page = calcule_header_et_page ($fond); if ($page['status']) { - include_ecrire('inc_headers'); + include_spip('inc/headers'); http_status($page['status']); } diff --git a/ecrire/public/cache.php b/ecrire/public/cache.php index 51c936b6ca..fe196bc28f 100644 --- a/ecrire/public/cache.php +++ b/ecrire/public/cache.php @@ -181,7 +181,7 @@ function determiner_cache(&$use_cache, $contexte, $fond) { // Faut-il effacer des pages invalidees (en particulier ce cache-ci) ? if ($GLOBALS['meta']['invalider'] AND $GLOBALS['db_ok']) { - include_ecrire('inc_meta'); + include_spip('inc/meta'); lire_metas(); retire_caches($chemin_cache); } diff --git a/ecrire/public/calcul-outils.php b/ecrire/public/calcul-outils.php index de6f25e7e9..235dfcb830 100644 --- a/ecrire/public/calcul-outils.php +++ b/ecrire/public/calcul-outils.php @@ -243,7 +243,7 @@ array("$element=$id_element")); function table_from_primary($id) { global $tables_principales; - include_ecrire('inc_serialbase'); + include_spip('base/serial'); foreach ($tables_principales as $k => $v) { if ($v['key']['PRIMARY KEY'] == $id) return array($k, array_key_exists('id_rubrique', $v['field'])); diff --git a/ecrire/public/calcul.php b/ecrire/public/calcul.php index aa98d9abf5..c1ace6a101 100644 --- a/ecrire/public/calcul.php +++ b/ecrire/public/calcul.php @@ -18,7 +18,7 @@ if (!defined("_ECRIRE_INC_VERSION")) return; // Ce fichier calcule une page en executant un squelette. // -include_ecrire("inc_meta"); +include_spip('inc/meta'); include_spip("inc/indexation"); include_spip('inc/texte'); include_spip('inc/lang'); diff --git a/ecrire/public/compilo.php b/ecrire/public/compilo.php index fb2680d501..d91293e5d7 100644 --- a/ecrire/public/compilo.php +++ b/ecrire/public/compilo.php @@ -37,7 +37,7 @@ include_spip('public/balises'); include_spip('public/compilo-api'); # definition des tables -include_ecrire('inc_serialbase'); +include_spip('base/serial'); // // Calculer un <INCLURE()> diff --git a/ecrire/public/criteres.php b/ecrire/public/criteres.php index ac479fe480..27f20a3d07 100644 --- a/ecrire/public/criteres.php +++ b/ecrire/public/criteres.php @@ -645,7 +645,7 @@ function trouver_def_table($nom, &$boucle) if ($boucle->sql_serveur && $desc = $tables_des_serveurs_sql[$boucle->sql_serveur][$nom]) return array($nom, $desc); - include_ecrire('inc_auxbase'); + include_spip('base/aux'); if ($desc = $tables_auxiliaires['spip_' . $nom]) return array('spip_' . $nom, $desc); diff --git a/ecrire/public/messforum.php b/ecrire/public/messforum.php index 72165e9860..a57c1793bb 100644 --- a/ecrire/public/messforum.php +++ b/ecrire/public/messforum.php @@ -11,7 +11,7 @@ \***************************************************************************/ if (!defined("_ECRIRE_INC_VERSION")) return; -include_ecrire('inc_meta'); +include_spip('inc/meta'); include_spip('inc/forum'); include_spip('inc/filtres'); include_ecrire("inc_abstract_sql"); diff --git a/ecrire/urls/propres.php b/ecrire/urls/propres.php index df902e2207..6ddf711825 100644 --- a/ecrire/urls/propres.php +++ b/ecrire/urls/propres.php @@ -223,7 +223,7 @@ function recuperer_parametres_url(&$fond, $url) { $url_propre = $func($id_objet); if ($url_propre AND ($url_propre<>$regs[2])) { - include_ecrire('inc_headers'); + include_spip('inc/headers'); http_status(301); // recuperer les arguments supplementaires (&debut_xxx=...) $reste = preg_replace('/^&/','?', diff --git a/formulaires/inc-formulaire_forum.php b/formulaires/inc-formulaire_forum.php index 4d6a95251b..392cdf93bb 100644 --- a/formulaires/inc-formulaire_forum.php +++ b/formulaires/inc-formulaire_forum.php @@ -12,7 +12,7 @@ if (!defined("_ECRIRE_INC_VERSION")) return; #securite -include_ecrire('inc_meta'); +include_spip('inc/meta'); include_spip('inc/session'); include_spip('inc/acces'); include_spip('inc/texte'); diff --git a/formulaires/inc-formulaire_signature.php b/formulaires/inc-formulaire_signature.php index d784fc5782..5d29a98efd 100644 --- a/formulaires/inc-formulaire_signature.php +++ b/formulaires/inc-formulaire_signature.php @@ -161,7 +161,7 @@ function reponse_confirmation($id_article, $var_confirm = '') { $result = spip_query($query); // invalider les pages ayant des boucles signatures include_spip('inc/invalideur'); - include_ecrire('inc_meta'); + include_spip('inc/meta'); suivre_invalideur("id='varia/pet$id_article'"); $confirm= (_T('form_pet_signature_validee')); @@ -231,7 +231,7 @@ function reponse_signature($id_article, $nom_email, $adresse_email, $message, $n if (!$nom_site) { return _T('form_indiquer_nom_site'); } - include_ecrire("inc_sites"); + include_spip('inc/sites'); if (!recuperer_page($url_site)) { return _T('form_pet_url_invalide'); diff --git a/formulaires/inc-formulaire_site.php b/formulaires/inc-formulaire_site.php index 6f29ed9a33..a2ef1ad1bc 100644 --- a/formulaires/inc-formulaire_site.php +++ b/formulaires/inc-formulaire_site.php @@ -42,7 +42,7 @@ function balise_FORMULAIRE_SITE_dyn($id_rubrique) { } // Tester l'URL du site - include_ecrire("inc_sites"); + include_spip('inc/sites'); if (!recuperer_page(_request('url_site'))) return _T('form_pet_url_invalide'); diff --git a/formulaires/inc-login_public.php b/formulaires/inc-login_public.php index 7100a1a5db..10112a2092 100644 --- a/formulaires/inc-login_public.php +++ b/formulaires/inc-login_public.php @@ -12,7 +12,7 @@ if (!defined("_ECRIRE_INC_VERSION")) return; #securite -include_ecrire("inc_meta"); +include_spip('inc/meta'); include_spip('inc/session'); include_spip('inc/filtres'); include_spip('inc/logos'); @@ -87,7 +87,7 @@ function login_pour_tous($login, $cible, $action) { $pose_cookie = generer_url_public('spip_cookie'); if ($echec_cookie AND !$ignore_auth_http) { - include_ecrire('inc_headers'); + include_spip('inc/headers'); if (php_module()) $auth_http = $pose_cookie; } // Attention dans le cas 'intranet' la proposition de se loger -- GitLab