summaryrefslogtreecommitdiff
authorGiulio Cesare Solaroli <giulio.cesare@clipperz.com>2012-02-06 10:09:26 (UTC)
committer Giulio Cesare Solaroli <giulio.cesare@clipperz.com>2012-02-06 10:09:26 (UTC)
commit96d01919d3ff42c3fdd7f6186a0500caccd3c140 (patch) (unidiff)
treefd7b52d56d818dcca5605766e728ac004847aede
parentb312e037ebba7c94abea9661bcf62c52b7d73fbf (diff)
parentaa25544e0ab8a1b9dcc3c47d5953a9a2afc5f77c (diff)
downloadclipperz-96d01919d3ff42c3fdd7f6186a0500caccd3c140.zip
clipperz-96d01919d3ff42c3fdd7f6186a0500caccd3c140.tar.gz
clipperz-96d01919d3ff42c3fdd7f6186a0500caccd3c140.tar.bz2
Merge pull request #24 from acozzette/master
Trivial change to setup/index.php in the PHP backend
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--backend/php/src/setup/index.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/backend/php/src/setup/index.php b/backend/php/src/setup/index.php
index 4087961..93dea6f 100644
--- a/backend/php/src/setup/index.php
+++ b/backend/php/src/setup/index.php
@@ -119,97 +119,97 @@ if(count($_POST) > 0 && $_SESSION['diagnosticsSuccessful']==false)
119 $dir = opendir('../objects/'); 119 $dir = opendir('../objects/');
120 $objects = array(); 120 $objects = array();
121 while(($file = readdir($dir)) !== false) 121 while(($file = readdir($dir)) !== false)
122 { 122 {
123 if(strlen($file) > 4 && substr(strtolower($file), strlen($file) - 4) === '.php' && !is_dir($file) && $file != "class.database.php" && $file != "class.pog_base.php") 123 if(strlen($file) > 4 && substr(strtolower($file), strlen($file) - 4) === '.php' && !is_dir($file) && $file != "class.database.php" && $file != "class.pog_base.php")
124 { 124 {
125 $objects[] = $file; 125 $objects[] = $file;
126 include_once("../objects/{$file}"); 126 include_once("../objects/{$file}");
127 } 127 }
128 } 128 }
129 closedir($dir); 129 closedir($dir);
130 if (sizeof($objects) == 0) 130 if (sizeof($objects) == 0)
131 { 131 {
132 $errors++; 132 $errors++;
133 AddError("[objects] folder does not contain any POG object."); 133 AddError("[objects] folder does not contain any POG object.");
134 } 134 }
135 135
136 if ($errors == 0) 136 if ($errors == 0)
137 { 137 {
138 $dir = opendir($GLOBALS['configuration']['plugins_path']); 138 $dir = opendir($GLOBALS['configuration']['plugins_path']);
139 $plugins = array(); 139 $plugins = array();
140 140
141 while(($file = readdir($dir)) !== false) 141 while(($file = readdir($dir)) !== false)
142 { 142 {
143 if(file_exists($GLOBALS['configuration']['plugins_path']."/IPlugin.php")) 143 if(file_exists($GLOBALS['configuration']['plugins_path']."/IPlugin.php"))
144 { 144 {
145 include_once($GLOBALS['configuration']['plugins_path']."/IPlugin.php"); 145 include_once($GLOBALS['configuration']['plugins_path']."/IPlugin.php");
146 } 146 }
147 if(strlen($file) > 4 && substr(strtolower($file), strlen($file) - 4) === '.php' && !is_dir($file) && strtolower(substr($file, 0, 6)) == 'plugin') 147 if(strlen($file) > 4 && substr(strtolower($file), strlen($file) - 4) === '.php' && !is_dir($file) && strtolower(substr($file, 0, 6)) == 'plugin')
148 { 148 {
149 include_once($GLOBALS['configuration']['plugins_path']."/{$file}"); 149 include_once($GLOBALS['configuration']['plugins_path']."/{$file}");
150 $pluginName = GetPluginName($file); 150 $pluginName = GetPluginName($file);
151 if ($pluginName != '') 151 if ($pluginName != '')
152 { 152 {
153 $plugins[] = $file; 153 $plugins[] = $file;
154 } 154 }
155 155
156 } 156 }
157 } 157 }
158 closedir($dir); 158 closedir($dir);
159 } 159 }
160 160
161 /** 161 /**
162 * verify configuration info 162 * verify configuration info
163 */ 163 */
164 if ($errors == 0) 164 if ($errors == 0)
165 { 165 {
166 AddTrace('File Structure....OK!'); 166 AddTrace('File Structure....OK!');
167 if (!@mysql_connect ($GLOBALS['configuration']['host'].":".$GLOBALS['configuration']['port'], $GLOBALS['configuration']['user'], $GLOBALS['configuration']['pass'])) 167 if (!mysql_connect ($GLOBALS['configuration']['host'].":".$GLOBALS['configuration']['port'], $GLOBALS['configuration']['user'], $GLOBALS['configuration']['pass']))
168 { 168 {
169 $errors++; 169 $errors++;
170 AddError('Cannot connect to the specified database server. Edit configuration.php'); 170 AddError('Cannot connect to the specified database server. Edit configuration.php');
171 } 171 }
172 if (isset($GLOBALS['configuration']['db_encoding']) && $GLOBALS['configuration']['db_encoding'] == 1 && !Base64::IsBase64FunctionInstalled()) 172 if (isset($GLOBALS['configuration']['db_encoding']) && $GLOBALS['configuration']['db_encoding'] == 1 && !Base64::IsBase64FunctionInstalled())
173 { 173 {
174 $errors++; 174 $errors++;
175 AddError('$configuration[db_encoding] needs to be set to 0 until you install the base64 plugin. Set db_encoding to 0 by editing configuration.php, run setup again and go to the "Manage Plugins" tab. Install the base64 plugin. Then you can set db_encoding = 1'); 175 AddError('$configuration[db_encoding] needs to be set to 0 until you install the base64 plugin. Set db_encoding to 0 by editing configuration.php, run setup again and go to the "Manage Plugins" tab. Install the base64 plugin. Then you can set db_encoding = 1');
176 } 176 }
177 if ($errors == 0) 177 if ($errors == 0)
178 { 178 {
179 if (!@mysql_select_db ($GLOBALS['configuration']['db'])) 179 if (!@mysql_select_db ($GLOBALS['configuration']['db']))
180 { 180 {
181 $errors++; 181 $errors++;
182 AddError('Cannot find the specified database "'.$GLOBALS['configuration']['db'].'". Edit configuration.php'); 182 AddError('Cannot find the specified database "'.$GLOBALS['configuration']['db'].'". Edit configuration.php');
183 } 183 }
184 } 184 }
185 } 185 }
186 186
187 /** 187 /**
188 * verify storage status 188 * verify storage status
189 */ 189 */
190 190
191 if ($errors == 0) 191 if ($errors == 0)
192 { 192 {
193 AddTrace("Configuration Info....OK!\n"); 193 AddTrace("Configuration Info....OK!\n");
194 AddTrace("Storage Status"); 194 AddTrace("Storage Status");
195 foreach($objects as $object) 195 foreach($objects as $object)
196 { 196 {
197 $objectName = GetObjectName("../objects/".$object); 197 $objectName = GetObjectName("../objects/".$object);
198 eval ('$instance = new '.$objectName.'();'); 198 eval ('$instance = new '.$objectName.'();');
199 if (TestStorageExists($objectName, "mysql")) 199 if (TestStorageExists($objectName, "mysql"))
200 { 200 {
201 if (isset($_POST['pog_table']) && ($_POST['pog_table'] == "recreate" || $_POST['pog_table'] == "recreate_import")) 201 if (isset($_POST['pog_table']) && ($_POST['pog_table'] == "recreate" || $_POST['pog_table'] == "recreate_import"))
202 { 202 {
203 if (!TestDeleteStorage($instance)) 203 if (!TestDeleteStorage($instance))
204 { 204 {
205 $errors++; 205 $errors++;
206 AddError("Dropping table '".strtolower($objectName)."' failed. Drop and recreate the table manually."); 206 AddError("Dropping table '".strtolower($objectName)."' failed. Drop and recreate the table manually.");
207 } 207 }
208 else 208 else
209 { 209 {
210 if (!TestCreateStorage("../objects/".$object)) 210 if (!TestCreateStorage("../objects/".$object))
211 { 211 {
212 $errors++; 212 $errors++;
213 AddError("Creating table [".strtolower($objectName)."] failed. Create the table manually using the generated SQL query in the object header."); 213 AddError("Creating table [".strtolower($objectName)."] failed. Create the table manually using the generated SQL query in the object header.");
214 } 214 }
215 else 215 else