function read_file($file_path)
{
    $confObj = array("vars" => array(), "steps" => array(), "collects" => array());
    $config = new Config($file_path);
    $config->parse();
    foreach ($config->varibles as $var) {
        array_push($confObj["vars"], array($var->name, $var->value));
    }
    $confObj = read_element("step", $config, $confObj);
    $confObj = read_element("collect", $config, $confObj);
    return $confObj;
}
예제 #2
0
     console_write('databasename', 'install');
     $INSTALL['dbname'] = read();
     //'moodletest3';
 }
 if ($interactive == CLI_FULL || $interactive == CLI_SEMI && !isset($INSTALL['dbtype'])) {
     $dbtypes = array('mysql', 'oci8po', 'postgres7', 'mssql', 'mssql_n', 'odbc_mssql');
     console_write("\n", '', false);
     console_write('availabledbtypes', 'install');
     console_write("\n", '', false);
     foreach ($dbtypes as $dbtype) {
         console_write("\t", '', false);
         console_write($dbtype, 'install');
         console_write("\n", '', false);
     }
     console_write('yourchoice', 'install');
     $INSTALL['dbtype'] = read_element($dbtypes);
     //'mysql';//
 }
 if ($interactive == CLI_FULL || $interactive == CLI_SEMI && !isset($INSTALL['dbuser'])) {
     console_write('databaseuser', 'install');
     $INSTALL['dbuser'] = read();
     //'root';
 }
 if ($interactive == CLI_FULL || $interactive == CLI_SEMI && !isset($INSTALL['dbpass'])) {
     console_write('databasepass', 'install');
     $INSTALL['dbpass'] = read();
     //'';
 }
 if ($interactive == CLI_FULL || $interactive == CLI_SEMI && !isset($INSTALL['prefix'])) {
     console_write('tableprefix', 'install');
     $INSTALL['prefix'] = read();