<?php
/**
 * @package linea21\externals\Installer
 * @author $Author$ - Simon Georget <simon@linea21.com>
 * @version $Id$
 * @license http://opensource.org/licenses/gpl-3.0.html
 */
$SQL = sql_dump2array('./scripts_sql/buildDB.'.$this->_options['dbtype'].'.sql');
$SQL = sql_dump2array('./scripts_sql/input.sql', $SQL);

// check whether there is user defined SQL files to execute on install
$userfiles = glob("./scripts_sql/user/*.sql");

if(count($userfiles)> 0) {
    
    sort($userfiles, SORT_REGULAR ); // sort on name
    foreach ($userfiles as $filename)	{
        $SQL = sql_dump2array($filename, $SQL);
    }
}

$SQL = placeholderReplace($SQL, $db_input);