Пример #1
0
 /**
  * @param $post
  */
 public function run($post)
 {
     // Check for autosetup:
     $post = $this->loadAutoConfig($post);
     $opts = $this->setupHelper->getSystemInfo();
     // convert 'abcpassword' to 'abcpass'
     if (isset($post['adminpassword'])) {
         $post['adminpass'] = $post['adminpassword'];
     }
     if (isset($post['dbpassword'])) {
         $post['dbpass'] = $post['dbpassword'];
     }
     if (isset($post['install']) and $post['install'] == 'true') {
         // We have to launch the installation process :
         $e = $this->setupHelper->install($post);
         $errors = array('errors' => $e);
         if (count($e) > 0) {
             $options = array_merge($opts, $post, $errors);
             $this->display($options);
         } else {
             $this->finishSetup();
         }
     } else {
         $options = array_merge($opts, $post);
         $this->display($options);
     }
 }
Пример #2
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     // validate the environment
     $server = \OC::$server;
     $setupHelper = new Setup($this->config, $server->getIniWrapper(), $server->getL10N('lib'), new \OC_Defaults(), $server->getLogger(), $server->getSecureRandom());
     $sysInfo = $setupHelper->getSystemInfo(true);
     $errors = $sysInfo['errors'];
     if (count($errors) > 0) {
         $this->printErrors($output, $errors);
         // ignore the OS X setup warning
         if (count($errors) !== 1 || (string) $errors[0]['error'] !== 'Mac OS X is not supported and ownCloud will not work properly on this platform. Use it at your own risk! ') {
             return 1;
         }
     }
     // validate user input
     $options = $this->validateInput($input, $output, array_keys($sysInfo['databases']));
     // perform installation
     $errors = $setupHelper->install($options);
     if (count($errors) > 0) {
         $this->printErrors($output, $errors);
         return 1;
     }
     $output->writeln("ownCloud was successfully installed");
     return 0;
 }
Пример #3
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     // validate the environment
     $setupHelper = new Setup($this->config, \OC::$server->getIniWrapper(), \OC::$server->getL10N('lib'), new \OC_Defaults());
     $sysInfo = $setupHelper->getSystemInfo(true);
     $errors = $sysInfo['errors'];
     if (count($errors) > 0) {
         $this->printErrors($output, $errors);
         return 1;
     }
     // validate user input
     $options = $this->validateInput($input, $output, array_keys($sysInfo['databases']));
     // perform installation
     $errors = $setupHelper->install($options);
     if (count($errors) > 0) {
         $this->printErrors($output, $errors);
         return 1;
     }
     $output->writeln("ownCloud was successfully installed");
     return 0;
 }