示例#1
0
 public function run()
 {
     \Jelix\Core\AppManager::close($this->getParam('message', ''));
     if ($this->verbose()) {
         echo "Application is closed.\n";
     }
 }
示例#2
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     \Jelix\Core\AppManager::close($input->getArgument('message'));
     if ($output->isVerbose()) {
         $output->writeln("Application is closed.");
     }
 }
示例#3
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     \Jelix\Core\AppManager::open();
     if ($output->isVerbose()) {
         $output->writeln("Application is opened.");
     }
 }
示例#4
0
 public function run()
 {
     \Jelix\Core\AppManager::open();
     if ($this->verbose()) {
         echo "Application is opened.\n";
     }
 }
示例#5
0
 public function run()
 {
     \Jelix\Core\AppManager::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 \Jelix\Installer\Reporter\Console();
     } else {
         $reporter = new \Jelix\Installer\Reporter\Console('error');
     }
     $installer = new \Jelix\Installer\Installer($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 {
         \Jelix\Core\AppManager::clearTemp(\Jelix\Core\App::tempBasePath());
     } catch (Exception $e) {
         if ($e->getCode() == 2) {
             echo "Error: bad path in \\Jelix\\Core\\App::tempBasePath(), it is equals to '" . \Jelix\Core\App::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();
         }
     }
     \Jelix\Core\AppManager::open();
 }
示例#6
0
 protected function _execute(InputInterface $input, OutputInterface $output)
 {
     require_once JELIX_LIB_PATH . 'installer/jInstaller.class.php';
     \Jelix\Core\AppManager::close();
     $module = $input->getArgument('module');
     $parameters = $input->getOption('parameters');
     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 \Jelix\Installer\Reporter\Console();
     } else {
         $reporter = new \Jelix\Installer\Reporter\Console('error');
     }
     $installer = new \Jelix\Installer\Installer($reporter);
     if ($this->allEntryPoint) {
         if ($parameters) {
             $installer->setModuleParameters($module, $parameters);
         }
         $installer->installModules(array($module));
     } else {
         if ($parameters) {
             $installer->setModuleParameters($module, $parameters, $this->entryPointName);
         }
         $installer->installModules(array($module), $this->entryPointName);
     }
     try {
         \Jelix\Core\AppManager::clearTemp(\jApp::tempBasePath());
     } catch (\Exception $e) {
         if ($e->getCode() == 2) {
             $output->writeln("Error: bad path in \\Jelix\\Core\\App::tempBasePath(), it is equals to '" . App::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>");
         }
     }
     \Jelix\Core\AppManager::open();
 }
示例#7
0
 protected function _execute(InputInterface $input, OutputInterface $output)
 {
     \Jelix\Core\AppManager::close();
     if ($this->verbose()) {
         $reporter = new \Jelix\Installer\Reporter\Console('notice', 'Low-level migration');
     } else {
         $reporter = new \Jelix\Installer\Reporter\Console('error', 'Low-level migration');
     }
     // launch the low-level migration
     $migrator = new \Jelix\Installer\Migration($reporter);
     $migrator->migrate();
     // we can now launch the installer/updater
     if ($this->verbose()) {
         $reporter = new \Jelix\Installer\Reporter\Console();
     } else {
         $reporter = new \Jelix\Installer\Reporter\Console('error');
     }
     $installer = new \Jelix\Installer\Installer($reporter);
     if ($input->getOption('entry-point')) {
         $installer->installEntryPoint($this->entryPointId);
     } else {
         $installer->installApplication();
     }
     try {
         \Jelix\Core\AppManager::clearTemp(\Jelix\Core\App::tempBasePath());
     } catch (\Exception $e) {
         if ($e->getCode() == 2) {
             $output->writeln("<error>Error: bad path in jApp::tempBasePath(), it is equals to '" . jApp::tempBasePath() . "' !!</error>");
             $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 the application.init.php or create the directory");
         } else {
             $output->writeln("<error>Error: " . $e->getMessage() . "</error>");
         }
     }
     \Jelix\Core\AppManager::open();
 }
示例#8
0
 public function run()
 {
     \Jelix\Core\AppManager::close();
     if ($this->verbose()) {
         $reporter = new \Jelix\Installer\Reporter\Console();
     } else {
         $reporter = new \Jelix\Installer\Reporter\Console('error');
     }
     $installer = new \Jelix\Installer\Installer($reporter);
     $installer->installApplication();
     try {
         \Jelix\Core\AppManager::clearTemp(\Jelix\Core\App::tempBasePath());
     } catch (Exception $e) {
         if ($e->getCode() == 2) {
             echo "Error: bad path in use \\Jelix\\Core\\App::tempBasePath(), it is equals to '" . \Jelix\Core\App::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();
         }
     }
     \Jelix\Core\AppManager::open();
 }
示例#9
0
文件: init.php 项目: mdouchin/jelix
/**
 * @deprecated use \Jelix\Core\AppManager::isAppInstalled();
 */
function isAppInstalled()
{
    return \Jelix\Core\AppManager::isAppInstalled();
}