mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Setup/DBCs
* vastly improved memory usage when handling DBCs * DBCs are no longer read entirely into memory, instead appropriate file handles are used. * read data is written to DB in reasonable intervals instead of all at once * DBC-class can no longer read from DB, but that wasn't used anyway CLISetup * can now interpret the HOME-shorthand (~) in paths
This commit is contained in:
@@ -164,15 +164,11 @@ class SqlGen
|
||||
$tbl = self::$tables[$tableName]; // shorthand
|
||||
CLISetup::log('SqlGen::generate() - copying '.$tbl[0].'.dbc into aowow_'.$tableName);
|
||||
|
||||
$dbc = new DBC($tbl[0], CLISetup::$tmpDBC);
|
||||
$dbc = new DBC($tbl[0], ['temporary' => CLISetup::$tmpDBC, 'tableName' => 'aowow_'.$tableName]);
|
||||
if ($dbc->error)
|
||||
return false;
|
||||
|
||||
$dbcData = $dbc->readArbitrary($tbl[1]);
|
||||
foreach ($dbcData as $row)
|
||||
DB::Aowow()->query('REPLACE INTO ?_'.$tableName.' (?#) VALUES (?a)', array_keys($row), array_values($row));
|
||||
|
||||
return !!$dbcData;
|
||||
return !!$dbc->readFile();
|
||||
}
|
||||
else if (file_exists('setup/tools/sqlgen/'.$tableName.'.func.php'))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user