function configure($config_files, $schema_files, $db_ids, $psa_modify_hash, $db_modify_hash, $settings_modify_hash, $crypt_settings_modify_hash, $settings_enum_modify_hash, $additional_modify_hash, $wriable_configs = array()) { // -- Creating inital DB -- import_sql_scripts_to_databases($schema_files, $db_ids, $psa_modify_hash, $db_modify_hash, $settings_modify_hash, $crypt_settings_modify_hash, $settings_enum_modify_hash, $additional_modify_hash); // -- Writing config file -- write_config_files($config_files, $psa_modify_hash, $db_modify_hash, $settings_modify_hash, $crypt_settings_modify_hash, $settings_enum_modify_hash, $additional_modify_hash, $wriable_configs); }
function install($options) { $check = check_requirements(); if ($check[0]) { setup_db($options); write_config_files($options); dir_permissions(); } else { echo 'FAILED! Pre-installation check failed: ' . $check[1] . "\n\n"; exit(1); } }
define('TEST_ROOT', __DIR__); foreach (glob(__DIR__ . "/../src/lib/*.php") as $file) { require_once $file; } $loader = (require_once __DIR__ . '/../vendor/autoload.php'); echo "* Reading config...\n"; $config = json_decode(file_get_contents("./config.json")); if (empty($config)) { $err = "\nYou are missing or have misconfigured your config.json file, "; $err .= "\nwhich specifies your testing databases. Please see config.example.json "; $err .= "\nfor example usage\n\n"; $err .= "If this is not a development environment, you may disregard this message.\n\n"; die($err); } else { write_config_files($config); } if (!getenv("GR_SKIP_DB")) { echo "* Loading Drupal DB..."; $cnf = $config->databases->drupal; $cmd = "mysql -u {$cnf->username} -p{$cnf->password} {$cnf->database} < ./files/sql/drupal.sql"; $s = \GR\Shell::command($cmd); echo $s[0]; echo "done.\n\n"; } else { echo "* Skipping DB Setup...\n\n"; } function write_config_files($config) { // Wordpress $db = $config->databases->wordpress;