Ejemplo n.º 1
0
 /**
 * Prepare and process config form
 *
 * @access public
 * @param void
 * @return boolean
 */
 function execute() {
   if(!$this->installer->isExecutedStep(ACI_SYSTEM_CONFIG)) {
     $this->goToStep(ACI_SYSTEM_CONFIG);
   } // if
   
   $installation = new acInstallation(new Output_Html());
   $installation->setDatabaseType((string) trim($this->getFromStorage('database_type')));
   $installation->setDatabaseHost((string) trim($this->getFromStorage('database_host')));
   $installation->setDatabaseUsername((string) trim($this->getFromStorage('database_user')));
   $installation->setDatabasePassword((string) $this->getFromStorage('database_pass'));
   $installation->setDatabaseName((string) trim($this->getFromStorage('database_name')));
   $installation->setTablePrefix((string) trim($this->getFromStorage('database_prefix')));
   $installation->setDatabaseEngine((string) trim($this->getFromStorage('database_engine')));
   $installation->setAbsoluteUrl((string) trim($this->getFromStorage('absolute_url')));
   $installation->setPlugins($this->getFromStorage('plugins'));
   
   
   ob_start();
   if($installation->execute()) {
     $all_ok = true;
     $this->installer->clearStorage(); // lets clear data from session... its a DB pass we are talking about here
   } else {
     $all_ok = false;
   } // if
   
   tpl_assign('all_ok', $all_ok);
   tpl_assign('status_messages', explode("\n", trim(ob_get_clean())));
   
   $this->setContentFromTemplate('finish.php');
   return false;
 } // excute
Ejemplo n.º 2
0
<?php

require_once dirname(__FILE__) . '/include.php';
if (!isset($argv) || !is_array($argv)) {
    die('There is no input arguments');
}
// if
$installation = new acInstallation(new Output_Console());
$installation->setDatabaseType((string) trim(array_var($argv, 1)));
$installation->setDatabaseHost((string) trim(array_var($argv, 2)));
$installation->setDatabaseUsername((string) trim(array_var($argv, 3)));
$installation->setDatabasePassword((string) array_var($argv, 4));
$installation->setDatabaseName((string) trim(array_var($argv, 5)));
$installation->setTablePrefix((string) trim(array_var($argv, 6)));
$installation->setAbsoluteUrl((string) trim(array_var($argv, 7)));
$installation->setDefaultLocalization((string) trim(array_var($argv, 8, 'en_us')));
$installation->execute();