Support #1799
closedWho uses the CLI_INSTALLATION constant in main/install/install_db.inc.php?
Description
Need some feedback about this constants...
Updated by Julio Montoya about 13 years ago
- Subject changed from Who uses the CLI_INSTALLATION constant in main/install/isntal_db.inc.php? to Who uses the CLI_INSTALLATION constant in main/install/install_db.inc.php?
Updated by Yannick Warnier about 13 years ago
I guess somehow that must have been me (I'm not aware of anybody else using CLI installation), but you can probably trace it easily here http://code.google.com/p/chamilo/source/list?path=/main/install/install_db.inc.php&repo=classic&r=7ce7939222b0127bd16b4469058d7bc7ac5c25e7 (check all versions until you find one that doesn't have the constant, then look who added it).
Apparently Ivan introduced or changed a constant called SYSTEM_INSTALLATION at some point.
Updated by Ivan Tcholakov about 13 years ago
I don't use the constant CLI_INSTALLATION.
I think, I renamed a constant: DOKEOS_INSTALL -----> SYSTEM_INSTALLATION.
Updated by Julio Montoya about 13 years ago
It seems that Guillaume added it here:
I wish to add more conditions because when using a script for BNPanel, I dont want that the install_db.inc.php create the databases.
I wish to add this install_db.inc.php +31
if(!defined('CLI_INSTALLATION')) { $dbPrefixForm = preg_replace('/[^a-zA-Z0-9_\-]/', '', $dbPrefixForm); $dbNameForm = preg_replace('/[^a-zA-Z0-9_\-]/', '', $dbNameForm); if (!empty($dbPrefixForm) && strpos($dbNameForm, $dbPrefixForm) !== 0) { $dbNameForm = $dbPrefixForm.$dbNameForm; } $dbStatsForm = preg_replace('/[^a-zA-Z0-9_\-]/', '', $dbStatsForm); if (!empty($dbPrefixForm) && strpos($dbStatsForm, $dbPrefixForm) !== 0) { $dbStatsForm = $dbPrefixForm.$dbStatsForm; } $dbUserForm = preg_replace('/[^a-zA-Z0-9_\-]/', '', $dbUserForm); if (!empty($dbPrefixForm) && strpos($dbUserForm, $dbPrefixForm) !== 0) { $dbUserForm = $dbPrefixForm.$dbUserForm; } $mysqlMainDb = $dbNameForm; if (empty($mysqlMainDb) || $mysqlMainDb == 'mysql' || $mysqlMainDb == $dbPrefixForm) { $mysqlMainDb = $dbPrefixForm.'main'; } $mysqlStatsDb = $dbStatsForm; if (empty($mysqlStatsDb) || $mysqlStatsDb == 'mysql' || $mysqlStatsDb == $dbPrefixForm) { $mysqlStatsDb = $dbPrefixForm.'stats'; } $mysqlUserDb = $dbUserForm; if (empty($mysqlUserDb) || $mysqlUserDb == 'mysql' || $mysqlUserDb == $dbPrefixForm) { $mysqlUserDb = $dbPrefixForm.'user'; } $result = Database::query("SHOW VARIABLES LIKE 'datadir'") or die(Database::error()); $mysqlRepositorySys = Database::fetch_array($result); $mysqlRepositorySys = $mysqlRepositorySys['Value']; if (!$singleDbForm) { Database::query("DROP DATABASE IF EXISTS `$mysqlMainDb`") or die(Database::error()); } Database::query("CREATE DATABASE IF NOT EXISTS `$mysqlMainDb`") or die(Database::error()); }
Updated by Julio Montoya about 13 years ago
- Status changed from New to Needs more info
- % Done changed from 10 to 90
Ok I'm adding this validation:
I hope this does not break the phing process. Waiting feedback.
Updated by Yannick Warnier over 12 years ago
- Status changed from Needs more info to Bug resolved
Apparently it doesn't (break the phing process). OK for me.