author | Giulio 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) |
commit | 96d01919d3ff42c3fdd7f6186a0500caccd3c140 (patch) (side-by-side diff) | |
tree | fd7b52d56d818dcca5605766e728ac004847aede | |
parent | b312e037ebba7c94abea9661bcf62c52b7d73fbf (diff) | |
parent | aa25544e0ab8a1b9dcc3c47d5953a9a2afc5f77c (diff) | |
download | clipperz-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
-rw-r--r-- | backend/php/src/setup/index.php | 2 |
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 @@ -71,193 +71,193 @@ if(count($_POST) > 0 && $_SESSION['diagnosticsSuccessful']==false) { $errors++; AddError('Database wrapper (class.database.php) is missing.'); } else { include "../objects/class.database.php"; } if(!file_exists("../objects/class.pog_base.php")) { $errors++; AddError('POG Base class (class.pog_base.php) is missing.'); } else { include "../objects/class.pog_base.php"; } if (!file_exists("../configuration.php")) { $errors++; AddError('Configuration file (configuration.php) is missing'); } if ($GLOBALS['configuration']['plugins_path'] == '') { $errors++; AddError('Path to plugin folder has not been specified in configuration.php'); } else { if (!file_exists($GLOBALS['configuration']['plugins_path']."/plugin.base64.php")) { $errors++; AddError('Base64 plugin file (plugins/plugin.base64.php) is missing'); } else { include_once($GLOBALS['configuration']['plugins_path']."/plugin.base64.php"); } } //load object names to be ignored $ignoreObjects = file("../objects/ignore_objects.txt"); foreach ($ignoreObjects as $key=>$ignoreObject){ $ignoreObjects[$key] = trim($ignoreObject); } $dir = opendir('../objects/'); $objects = array(); while(($file = readdir($dir)) !== false) { if(strlen($file) > 4 && substr(strtolower($file), strlen($file) - 4) === '.php' && !is_dir($file) && $file != "class.database.php" && $file != "class.pog_base.php") { $objects[] = $file; include_once("../objects/{$file}"); } } closedir($dir); if (sizeof($objects) == 0) { $errors++; AddError("[objects] folder does not contain any POG object."); } if ($errors == 0) { $dir = opendir($GLOBALS['configuration']['plugins_path']); $plugins = array(); while(($file = readdir($dir)) !== false) { if(file_exists($GLOBALS['configuration']['plugins_path']."/IPlugin.php")) { include_once($GLOBALS['configuration']['plugins_path']."/IPlugin.php"); } if(strlen($file) > 4 && substr(strtolower($file), strlen($file) - 4) === '.php' && !is_dir($file) && strtolower(substr($file, 0, 6)) == 'plugin') { include_once($GLOBALS['configuration']['plugins_path']."/{$file}"); $pluginName = GetPluginName($file); if ($pluginName != '') { $plugins[] = $file; } } } closedir($dir); } /** * verify configuration info */ if ($errors == 0) { AddTrace('File Structure....OK!'); - if (!@mysql_connect ($GLOBALS['configuration']['host'].":".$GLOBALS['configuration']['port'], $GLOBALS['configuration']['user'], $GLOBALS['configuration']['pass'])) + if (!mysql_connect ($GLOBALS['configuration']['host'].":".$GLOBALS['configuration']['port'], $GLOBALS['configuration']['user'], $GLOBALS['configuration']['pass'])) { $errors++; AddError('Cannot connect to the specified database server. Edit configuration.php'); } if (isset($GLOBALS['configuration']['db_encoding']) && $GLOBALS['configuration']['db_encoding'] == 1 && !Base64::IsBase64FunctionInstalled()) { $errors++; 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'); } if ($errors == 0) { if (!@mysql_select_db ($GLOBALS['configuration']['db'])) { $errors++; AddError('Cannot find the specified database "'.$GLOBALS['configuration']['db'].'". Edit configuration.php'); } } } /** * verify storage status */ if ($errors == 0) { AddTrace("Configuration Info....OK!\n"); AddTrace("Storage Status"); foreach($objects as $object) { $objectName = GetObjectName("../objects/".$object); eval ('$instance = new '.$objectName.'();'); if (TestStorageExists($objectName, "mysql")) { if (isset($_POST['pog_table']) && ($_POST['pog_table'] == "recreate" || $_POST['pog_table'] == "recreate_import")) { if (!TestDeleteStorage($instance)) { $errors++; AddError("Dropping table '".strtolower($objectName)."' failed. Drop and recreate the table manually."); } else { if (!TestCreateStorage("../objects/".$object)) { $errors++; AddError("Creating table [".strtolower($objectName)."] failed. Create the table manually using the generated SQL query in the object header."); } else { AddTrace("\tDropping & Recreating table [".strtolower($objectName)."]....OK!"); } } } else { if (!TestAlterStorage($instance)) { $errors++; AddError("Aligning [$objectName] with table '".strtolower($objectName)."' failed. Alter the table manually so that object attributes and table columns match."); } else { AddTrace("\tAligning [$objectName] with table '".strtolower($objectName)."'....OK!"); } } } else { if (!TestCreateStorage("../objects/".$object)) { $errors++; AddError("Creating table [".strtolower($objectName)."] failed. Create the table manually using the generated SQL query in the object header."); } else { AddTrace("\tCreating table [".strtolower($objectName)."]....OK!"); } } } } $objectNameList = array(); /** * Initialize test data? */ if (isset($_POST['pog_table']) && $_POST['pog_table'] == 'recreate_import') { $initialData = file_get_contents('data_initialization/data_initialization.sql'); PMA_splitSqlFile($statements, $initialData, 4); if (sizeof($statements) > 0) { foreach ($statements as $statement) { if (!TestExecuteQuery($statement['query'])) |