OSDN Git Service

FIX:XAMPP上でも正常に動作するようにskinnableAdminのコードを部分的にマージ
authorreine <reine@users.sourceforge.jp>
Wed, 11 Apr 2012 12:49:47 +0000 (21:49 +0900)
committerreine <reine@users.sourceforge.jp>
Wed, 11 Apr 2012 12:49:47 +0000 (21:49 +0900)
CHANGE:ディレクトリパスの処理方法を変更
CHANGE:データベース接続情報のパスワードに空文字を許可
CHANGE:skinie.phpのincludeタイミングを変更
CHANGE:installCustomPlugsとinstallCustomSkinsのシグネチャを統一

install/index.php

index 1ad310d..3171aa5 100644 (file)
@@ -16,7 +16,7 @@
 /**\r
  * @license http://nucleuscms.org/license.txt GNU General Public License\r
  * @copyright Copyright (C) 2002-2012 The Nucleus Group\r
- * @version $Id: index.php 1705 2012-03-23 15:46:55Z sakamocchi $\r
+ * @version $Id$\r
  */\r
 \r
 /* global values initialize */\r
@@ -1002,6 +1002,8 @@ function do_install()
                        $manager = new Manager();\r
                }\r
 \r
+               include_once($DIR_LIBS . 'skinie.php');\r
+               \r
                $aSkinErrors = installCustomSkins();\r
                if ( count($aSkinErrors) > 0 )\r
                {\r
@@ -1021,7 +1023,7 @@ function do_install()
                $query = sprintf($query, tableName('nucleus_config'), $defSkinID);\r
                sql_query($query);\r
 \r
-               $aPlugErrors = installCustomPlugs($manager);\r
+               $aPlugErrors = installCustomPlugs();\r
                if ( count($aPlugErrors) > 0 )\r
                {\r
                        array_merge($errors, $aPlugErrors);\r
@@ -1130,7 +1132,7 @@ function getMySqlVersion()
        if ( $result != FALSE && sql_num_rows($result) > 0 )\r
        {\r
                $row = sql_fetch_array($result);\r
-               $match = preg_split('#\.#', $row['version']);\r
+               $match = i18n::explode('.', $row['version']);\r
        }\r
        else\r
        {\r
@@ -1139,14 +1141,14 @@ function getMySqlVersion()
                if ( $result != FALSE && @sql_num_rows($result) > 0 )\r
                {\r
                        $row = sql_fetch_row($result);\r
-                       $match = preg_split('#\.#', $row[1]);\r
+                       $match = i18n::explode('.', $row[1]);\r
                }\r
                else\r
                {\r
                        //$output = shell_exec('mysql -V');\r
                        $output = ( function_exists('shell_exec') ) ? @shell_exec('mysql -V') : '0.0.0';\r
                        preg_match('@[0-9]+\.[0-9]+\.[0-9]+@', $output, $version);\r
-                       $match = preg_split('#\.#', $version[0]);\r
+                       $match = i18n::explode('.', $version[0]);\r
 \r
                        if ( $match[0] == '' )\r
                        {\r
@@ -1184,12 +1186,10 @@ function tableName($input)
 \r
 /**\r
  * Install custom plugins\r
- *\r
- * @param object $manager MANAGER class instance\r
  */\r
-function installCustomPlugs($manager)\r
+function installCustomPlugs()\r
 {\r
-       global $aConfPlugsToInstall, $DIR_LIBS;\r
+       global $aConfPlugsToInstall, $DIR_LIBS, $manager;\r
 \r
        $aErrors = array();\r
        if ( count($aConfPlugsToInstall) == 0 )\r
@@ -1253,7 +1253,6 @@ function installCustomSkins()
                return $aErrors;\r
        }\r
 \r
-       include_once($DIR_LIBS . 'skinie.php');\r
        $importer = new SkinImport();\r
 \r
        foreach ( $aConfSkinsToImport as $skinName )\r
@@ -1434,24 +1433,25 @@ class ParamManager
                $this->blog_shortname = 'mynucleuscms';\r
 \r
                /* root path */\r
-               $this->root_path = realpath(dirname(__FILE__) . '/..');\r
+//             $this->root_path = realpath(dirname(__FILE__) . '/..');\r
+               $this->root_path = implode('/', i18n::explode(DIRECTORY_SEPARATOR, realpath(dirname(__FILE__) . '/..')));\r
                if ( substr($this->root_path, -1, 1) !== '/' )\r
                {\r
                        $this->root_path .= '/';\r
                }\r
-               $base_path_pcre = preg_quote($this->root_path, '#');\r
+               $base_path_pcre = preg_quote($this->root_path, '|');\r
 \r
                /* current directry name */\r
-               $directory_name = preg_replace("#$base_path_pcre#", '', dirname(__FILE__));\r
-               $directory_name_pcre = preg_quote($directory_name, '#');\r
+               $directory_name = preg_replace("|$base_path_pcre|", '', implode('/', i18n::explode(DIRECTORY_SEPARATOR, realpath(dirname(__FILE__)))));\r
+               $directory_name_pcre = preg_quote($directory_name, '|');\r
 \r
                /* root uri */\r
                $root_url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];\r
-               $this->root_url = preg_replace("#$directory_name_pcre(.*)$#", '', $root_url);\r
+               $this->root_url = preg_replace("|$directory_name_pcre(.*)$|", '', $root_url);\r
 \r
-               $this->AdminPath = $this->root_path . 'nucleus' . DIRECTORY_SEPARATOR;\r
-               $this->MediaPath = $this->root_path . 'media' . DIRECTORY_SEPARATOR;\r
-               $this->SkinsPath = $this->root_path . 'skins' . DIRECTORY_SEPARATOR;\r
+               $this->AdminPath = $this->root_path . 'nucleus/';\r
+               $this->MediaPath = $this->root_path . 'media/';\r
+               $this->SkinsPath = $this->root_path . 'skins/';\r
 \r
                $this->IndexURL  = $this->root_url;\r
                $this->AdminURL  = $this->root_url . 'nucleus/';\r
@@ -1513,10 +1513,10 @@ class ParamManager
                        $errors[] = sprintf(_VALID_ERROR2, _DB_FIELD2);\r
                }\r
                \r
-               if ( $this->mysql_password == '' )\r
-               {\r
-                       $errors[] = sprintf(_VALID_ERROR1, _DB_FIELD3);\r
-               }\r
+//             if ( $this->mysql_password == '' )\r
+//             {\r
+//                     $errors[] = sprintf(_VALID_ERROR1, _DB_FIELD3);\r
+//             }\r
 \r
                if ( $this->mysql_database == '' )\r
                {\r