function install()
{
if (empty($this->args)) {
return $this->main();
}
$args = $this->args;
if (!empty($args[0]) && $args[0] == 'all') {
$this->_getFiles();
$args = $this->files;
}
if (!empty($this->params['f'])) {
$this->args = $args;
$this->uninstall();
}
foreach ($args as $arg) {
if ($sql = $this->_getFile($arg)) {
$sql = String::insert($sql, array('prefix' => $this->Db->tablePrefix), array('before' => '{', 'after' => '}', 'clean' => true));
$this->Db->query($sql);
$this->out('OK: ' . $arg . ' created');
} else {
$this->out($arg . ' not found');
}
}
$this->out('... done');
}