[SPIP][PLUGINS] v3.0-->v3.2
[lhc/web/www.git] / www / ecrire / install / etape_fin.php
index 471ac7f..be4cf05 100644 (file)
@@ -3,47 +3,50 @@
 /***************************************************************************\
  *  SPIP, Systeme de publication pour l'internet                           *
  *                                                                         *
- *  Copyright (c) 2001-2016                                                *
+ *  Copyright (c) 2001-2017                                                *
  *  Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James  *
  *                                                                         *
  *  Ce programme est un logiciel libre distribue sous licence GNU/GPL.     *
  *  Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne.   *
 \***************************************************************************/
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
 include_spip('inc/headers');
 include_spip('inc/acces');
 
 // Mise en place des fichiers de configuration si ce n'est fait
 
-// http://doc.spip.org/@install_etape_fin_dist
-function install_etape_fin_dist()
-{
+// http://code.spip.net/@install_etape_fin_dist
+function install_etape_fin_dist() {
        ecrire_acces();
 
-       $f = str_replace( _FILE_TMP_SUFFIX, '.php', _FILE_CHMOD_TMP);
+       $f = str_replace(_FILE_TMP_SUFFIX, '.php', _FILE_CHMOD_TMP);
        if (file_exists(_FILE_CHMOD_TMP)) {
                if (!@rename(_FILE_CHMOD_TMP, $f)) {
-                       if (@copy(_FILE_CHMOD_TMP, $f))
+                       if (@copy(_FILE_CHMOD_TMP, $f)) {
                                spip_unlink(_FILE_CHMOD_TMP);
+                       }
                }
        }
 
-       $f = str_replace( _FILE_TMP_SUFFIX, '.php', _FILE_CONNECT_TMP);
+       $f = str_replace(_FILE_TMP_SUFFIX, '.php', _FILE_CONNECT_TMP);
        if (file_exists(_FILE_CONNECT_TMP)) {
                spip_log("renomme $f");
                if (!@rename(_FILE_CONNECT_TMP, $f)) {
-                       if (@copy(_FILE_CONNECT_TMP, $f))
+                       if (@copy(_FILE_CONNECT_TMP, $f)) {
                                @spip_unlink(_FILE_CONNECT_TMP);
+                       }
                }
        }
 
        // creer le repertoire cache, qui sert partout !
        // deja fait en etape 4 en principe, on garde au cas ou
-       if(!@file_exists(_DIR_CACHE)) {
-               $rep = preg_replace(','._DIR_TMP.',', '', _DIR_CACHE);
-               $rep = sous_repertoire(_DIR_TMP, $rep, true,true);
+       if (!@file_exists(_DIR_CACHE)) {
+               $rep = preg_replace(',' . _DIR_TMP . ',', '', _DIR_CACHE);
+               $rep = sous_repertoire(_DIR_TMP, $rep, true, true);
        }
 
        // Verifier la securite des htaccess
@@ -51,25 +54,31 @@ function install_etape_fin_dist()
        $msg = install_verifier_htaccess();
        if ($msg) {
                $cible = _T('public:accueil_site');
-               $cible = generer_form_ecrire('accueil', '','', $cible);
+               $cible = generer_form_ecrire('accueil', '', '', $cible);
                echo minipres('AUTO', $msg . $cible);
-       // ok, deboucher dans l'espace prive
-       } else redirige_url_ecrire('accueil');
+               // ok, deboucher dans l'espace prive
+       } else {
+               redirige_url_ecrire('accueil');
+       }
 }
 
-function install_verifier_htaccess()
-{
+function install_verifier_htaccess() {
        if (verifier_htaccess(_DIR_TMP, true)
-       AND verifier_htaccess(_DIR_CONNECT, true))
+               and verifier_htaccess(_DIR_CONNECT, true)
+       ) {
                return '';
+       }
 
        $titre = _T('htaccess_inoperant');
 
-       $averti = _T('htaccess_a_simuler', 
-               array('htaccess' => '<tt>' . _ACCESS_FILE_NAME . '</tt>',
-                       'constantes' =>  '<tt>_DIR_TMP &amp; _DIR_CONNECT</tt>',
-                       'document_root' => '<tt>' . $_SERVER['DOCUMENT_ROOT'] . '</tt>'));
+       $averti = _T(
+               'htaccess_a_simuler',
+               array(
+                       'htaccess' => '<tt>' . _ACCESS_FILE_NAME . '</tt>',
+                       'constantes' => '<tt>_DIR_TMP &amp; _DIR_CONNECT</tt>',
+                       'document_root' => '<tt>' . $_SERVER['DOCUMENT_ROOT'] . '</tt>'
+               )
+       );
 
        return "<div class='error'><h3>$titre</h3><p>$averti</p></div>";
 }
-?>