OSDN Git Service

Update some comments added in original 3.64.
authorsakamocchi <sakamocchi@1ca29b6e-896d-4ea0-84a5-967f57386b96>
Mon, 21 Mar 2011 01:04:35 +0000 (01:04 +0000)
committersakamocchi <sakamocchi@1ca29b6e-896d-4ea0-84a5-967f57386b96>
Mon, 21 Mar 2011 01:04:35 +0000 (01:04 +0000)
git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/nucleus-jp/trunk@1165 1ca29b6e-896d-4ea0-84a5-967f57386b96

utf8/install/index.php

index a5506ca..c6b87af 100755 (executable)
@@ -8,8 +8,9 @@
  * as published by the Free Software Foundation; either version 2\r
  * of the License, or (at your option) any later version.\r
  * (see nucleus/documentation/index.html#license for more info)\r
- * This script will install the Nucleus tables in your SQL-database, and initialize the data in\r
- * those tables.\r
+ * \r
+ * This script will install the Nucleus tables in your SQL-database, \r
+ * and initialize the data in those tables.\r
  *\r
  * Below is a friendly way of letting users on non-php systems know that Nucleus won't run there.\r
  * ?><div style="font-size: xx-large;">If you see this text in your browser when you open <i>/install/</i>, your web server is not able to run PHP-scripts, and therefor Nucleus will not be able to run there. </div><div style="display: none"><?php\r
@@ -71,6 +72,8 @@ if ((count($aConfPlugsToInstall) > 0) || (count($aConfSkinsToImport) > 0) ) {
        $CONF['installscript'] = 1;\r
 }\r
 \r
+// compatibility script for php < 4.1.0\r
+// ToDo: remove this here and from the core\r
 if (phpversion() >= '4.1.0') {\r
        include_once('../nucleus/libs/vars4.1.0.php');\r
 } else {\r
@@ -103,6 +106,9 @@ if (postVar('action') == 'go') {
 \r
 exit;\r
 \r
+/*\r
+ * Show the form for the installation settings\r
+ */\r
 function showInstallForm() {\r
        // 0. pre check if all necessary files exist\r
        doCheckFiles();\r
@@ -461,6 +467,12 @@ function showInstallForm() {
 \r
 <?php }\r
 \r
+/*\r
+ * Add a table prefix if it is used\r
+ * \r
+ * @param      $unPrefixed\r
+ *                     table name with prefix\r
+ */\r
 function tableName($unPrefixed) {\r
        global $mysql_usePrefix, $mysql_prefix;\r
 \r
@@ -471,6 +483,9 @@ function tableName($unPrefixed) {
        }\r
 }\r
 \r
+/*\r
+ * The installation process itself\r
+ */\r
 function doInstall() {\r
        global $mysql_usePrefix, $mysql_prefix, $weblog_ping;\r
 \r
@@ -993,6 +1008,9 @@ function doInstall() {
 <?php\r
 }\r
 \r
+/**\r
+ *  Install custom plugins\r
+ */\r
 function installCustomPlugs(&$manager) {\r
        global $aConfPlugsToInstall, $DIR_LIBS;\r
 \r
@@ -1047,6 +1065,10 @@ function installCustomPlugs(&$manager) {
        return $aErrors;\r
 }\r
 \r
+/**\r
+ *  Install custom skins\r
+ *  Prepares the installation of custom skins\r
+ */\r
 function installCustomSkins(&$manager) {\r
        global $aConfSkinsToImport, $DIR_LIBS, $DIR_SKINS;\r
 \r
@@ -1092,7 +1114,10 @@ function installCustomSkins(&$manager) {
        return $aErrors;\r
 }\r
 \r
-// give an error if one or more nucleus are not accessible\r
+/**\r
+ *  Check if some important files of the Nucleus CMS installation are available\r
+ *  Give an error if one or more files are not accessible\r
+ */\r
 function doCheckFiles() {\r
        $missingfiles = array();\r
        $files = array(\r
@@ -1127,6 +1152,14 @@ function doCheckFiles() {
        }\r
 }\r
 \r
+/**\r
+ *  Updates the configuration in the database\r
+ * \r
+ *  @param     $name\r
+ *                     name of the config var\r
+ *  @param     $val\r
+ *                     new value of the config var\r
+ */\r
 function updateConfig($name, $val) {\r
        global $MYSQL_CONN;\r
        $name = addslashes($name);\r
@@ -1140,16 +1173,31 @@ function updateConfig($name, $val) {
        return sql_insert_id($MYSQL_CONN);\r
 }\r
 \r
+/**\r
+ *  Replaces doubled backslashs\r
+ * \r
+ *  @param     $input\r
+ *                     string that could have double backslashs\r
+ */\r
 function replaceDoubleBackslash($input) {\r
        return str_replace('\\', '/', $input);\r
 }\r
 \r
+/**\r
+ * Checks if a string ends with a slash \r
+ * \r
+ *  @param     $s\r
+ *                     string\r
+ */\r
 function endsWithSlash($s) {\r
        return (strrpos($s, '/') == strlen($s) - 1);\r
 }\r
 \r
 /**\r
  * Checks if email address is valid\r
+ * \r
+ *  @param     $address\r
+ *                     address which should be tested\r
  */\r
 function _isValidMailAddress($address) {\r
        if (preg_match("#^[a-zA-Z0-9\._-]+@+[A-Za-z0-9\._-]+\.+[A-Za-z]{2,4}$#", $address) ) {\r
@@ -1159,10 +1207,16 @@ function _isValidMailAddress($address) {
        }\r
 }\r
 \r
-// returns true if the given string is a valid shortname\r
-// (to check short blog names and nicknames)\r
-// logic: starts and ends with a non space, can contain spaces in between\r
-//             min 2 chars\r
+/*\r
+ * Check if short blog names and nicknames are allowed\r
+ * Returns true if the given string is a valid shortname\r
+ * logic: only letters and numbers are allowed, no spaces allowed\r
+ * \r
+ * FIX: function eregi is deprecated since PHP 5.3.0\r
+ * \r
+ * @param      $name\r
+ *                     name which should be tested     \r
+ */\r
 function _isValidShortName($name) {\r
        if (preg_match("#^[a-zA-Z0-9]+$#", $name) ) {\r
                return 1;\r
@@ -1171,10 +1225,15 @@ function _isValidShortName($name) {
        }\r
 }\r
 \r
-\r
-\r
-// returns true if the given string is a valid display name\r
-// (to check nicknames)\r
+/*\r
+ * Check if a display name is allowed\r
+ * Returns true if the given string is a valid display name\r
+ * \r
+ * FIX: function eregi is deprecated since PHP 5.3.0\r
+ * \r
+ * @param      $name\r
+ *                     name which should be tested\r
+ */\r
 function _isValidDisplayName($name) {\r
        if (preg_match("#^[a-zA-Z0-9]+[a-zA-Z0-9 ]*[a-zA-Z0-9]+$#", $name) ) {\r
                return 1;\r
@@ -1183,6 +1242,12 @@ function _isValidDisplayName($name) {
        }\r
 }\r
 \r
+/*\r
+ * Shows error message\r
+ * \r
+ * @param      $msg\r
+ *                     error message\r
+ */\r
 function _doError($msg) {\r
        ?>\r
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
@@ -1206,6 +1271,12 @@ function _doError($msg) {
        exit;\r
 }\r
 \r
+/*\r
+ * Shows error messages\r
+ * \r
+ * @param      $errors\r
+ *                     array with error messages\r
+ */\r
 function showErrorMessages($errors) {\r
        ?>\r
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r