public function run()
 {
     require_once JELIX_LIB_PATH . 'installer/jInstaller.class.php';
     jAppManager::close();
     if ($this->verbose()) {
         $reporter = new textInstallReporter();
     } else {
         $reporter = new textInstallReporter('error');
     }
     $installer = new jInstaller($reporter);
     $installer->installApplication();
     try {
         jAppManager::clearTemp(jApp::tempBasePath());
     } catch (Exception $e) {
         if ($e->getCode() == 2) {
             echo "Error: bad path in jApp::tempBasePath(), it is equals to '" . jApp::tempBasePath() . "' !!\n";
             echo "       Jelix cannot clear the content of the temp directory.\n";
             echo "       you must clear it your self.\n";
             echo "       Correct the path in the application.init.php or create the directory\n";
         } else {
             echo "Error: " . $e->getMessage();
         }
     }
     jAppManager::open();
 }
Example #2
0
 protected function _execute(InputInterface $input, OutputInterface $output)
 {
     require_once JELIX_LIB_PATH . 'installer/jInstaller.class.php';
     \jAppManager::close();
     $module = $input->getArgument('module');
     if ($this->verbose()) {
         $reporter = new \textInstallReporter();
     } else {
         $reporter = new \textInstallReporter('error');
     }
     $installer = new \jInstaller($reporter);
     if ($this->allEntryPoint) {
         $installer->uninstallModules(array($module));
     } else {
         $installer->uninstallModules(array($module), $this->entryPointName);
     }
     try {
         \jAppManager::clearTemp(\jApp::tempBasePath());
     } catch (\Exception $e) {
         if ($e->getCode() == 2) {
             $output->writeln("Error: bad path in jApp::tempBasePath(), it is equals to '" . jApp::tempBasePath() . "' !!");
             $output->writeln("       Jelix cannot clear the content of the temp directory.");
             $output->writeln("       you must clear it your self.");
             $output->writeln("       Correct the path in application.init.php or create the directory");
         } else {
             $output->writeln("<error>Error: " . $e->getMessage() . "</error>");
         }
     }
     \jAppManager::open();
 }
 public function run()
 {
     require_once JELIX_LIB_PATH . 'installer/jInstaller.class.php';
     jAppManager::close();
     $module = $this->getParam('module');
     $modulesList = $this->getParam('...', array());
     array_unshift($modulesList, $module);
     $parameters = $this->getOption('-p');
     if ($parameters && count($modulesList) > 1) {
         throw new Exception('Parameters are for only one module');
     }
     if ($parameters) {
         $params = explode(';', $parameters);
         $parameters = array();
         foreach ($params as $param) {
             $kp = explode("=", $param);
             if (count($kp) > 1) {
                 $parameters[$kp[0]] = $kp[1];
             } else {
                 $parameters[$kp[0]] = true;
             }
         }
     }
     if ($this->verbose()) {
         $reporter = new textInstallReporter();
     } else {
         $reporter = new textInstallReporter('error');
     }
     $installer = new jInstaller($reporter);
     if ($this->allEntryPoint) {
         if ($parameters) {
             $installer->setModuleParameters($modulesList[0], $parameters);
         }
         $installer->installModules($modulesList);
     } else {
         if ($parameters) {
             $installer->setModuleParameters($modulesList[0], $parameters, $this->entryPointName);
         }
         $installer->installModules($modulesList, $this->entryPointName);
     }
     try {
         jAppManager::clearTemp(jApp::tempBasePath());
     } catch (Exception $e) {
         if ($e->getCode() == 2) {
             echo "Error: bad path in jApp::tempBasePath(), it is equals to '" . jApp::tempBasePath() . "' !!\n";
             echo "       Jelix cannot clear the content of the temp directory.\n";
             echo "       you must clear it your self.\n";
             echo "       Correct the path in application.init.php or create the directory\n";
         } else {
             echo "Error: " . $e->getMessage();
         }
     }
     jAppManager::open();
 }
Example #4
0
<?php

/**
* @package  jelix
* @subpackage testapp
* @author   Laurent Jouanneau
* @contributor Rahal Aboulfeth
* @copyright 2009-2010 Laurent Jouanneau, 2011 Rahal Aboulfeth
* @link     http://jelix.org
* @licence  http://www.gnu.org/licenses/gpl.html GNU General Public Licence, see LICENCE file
*/
require_once dirname(__FILE__) . '/../application.init.php';
jApp::setEnv('install');
jAppManager::close();
$installer = new jInstaller(new textInstallReporter());
$installer->installApplication();
jAppManager::clearTemp();
jAppManager::open();