/**
  * Displays web configuration form
  *
  * @return array|ViewModel
  */
 public function indexAction()
 {
     $setupInfo = new SetupInfo($_SERVER);
     $view = new ViewModel(['autoBaseUrl' => $setupInfo->getProjectUrl(), 'autoAdminPath' => $setupInfo->getProjectAdminPath()]);
     $view->setTerminal(true);
     return $view;
 }
 /**
  * Displays web configuration form
  *
  * @return array|ViewModel
  */
 public function indexAction()
 {
     $setupInfo = new SetupInfo($_SERVER);
     $view = new ViewModel(['autoBaseUrl' => $setupInfo->getProjectUrl(), 'autoAdminPath' => $setupInfo->getProjectAdminPath(), 'sessionSave' => [ConfigOptionsListConstants::SESSION_SAVE_FILES, ConfigOptionsListConstants::SESSION_SAVE_DB]]);
     $view->setTerminal(true);
     return $view;
 }
 /**
  * @param array $server
  * @param bool $expected
  * @dataProvider isAvailableDataProvider
  */
 public function testIsAvailable($server, $expected)
 {
     $info = new SetupInfo($server);
     $this->assertEquals($expected, $info->isAvailable());
 }
Beispiel #4
0
 /**
  * If not installed, try to redirect to installation wizard
  *
  * @param Bootstrap $bootstrap
  * @param \Exception $exception
  * @return void
  * @throws \Exception
  */
 private function redirectToSetup(Bootstrap $bootstrap, \Exception $exception)
 {
     $setupInfo = new SetupInfo($bootstrap->getParams());
     $projectRoot = $this->_filesystem->getDirectoryRead(DirectoryList::ROOT)->getAbsolutePath();
     if ($setupInfo->isAvailable()) {
         $this->_response->setRedirect($setupInfo->getUrl());
         $this->_response->sendHeaders();
     } else {
         $newMessage = $exception->getMessage() . "\nNOTE: You cannot install Magento using the Setup Wizard " . "because the Magento setup directory cannot be accessed. \n" . 'You can install Magento using either the command line or you must restore access ' . 'to the following directory: ' . $setupInfo->getDir($projectRoot) . "\n";
         $newMessage .= 'If you are using the sample nginx configuration, please go to ' . $this->_request->getScheme() . '://' . $this->_request->getHttpHost() . $setupInfo->getUrl();
         throw new \Exception($newMessage, 0, $exception);
     }
 }
Beispiel #5
0
 /**
  * If not installed, try to redirect to installation wizard
  *
  * @param Bootstrap $bootstrap
  * @param \Exception $exception
  * @return void
  * @throws \Exception
  */
 private function redirectToSetup(Bootstrap $bootstrap, \Exception $exception)
 {
     $setupInfo = new SetupInfo($bootstrap->getParams());
     $projectRoot = $this->_filesystem->getDirectoryRead(DirectoryList::ROOT)->getAbsolutePath();
     if ($setupInfo->isAvailable()) {
         $this->_response->setRedirect($setupInfo->getUrl());
         $this->_response->sendHeaders();
     } else {
         $newMessage = $exception->getMessage() . "\nNOTE: web setup wizard is not accessible.\n" . 'In order to install, use Magento Setup CLI or configure web access to the following directory: ' . $setupInfo->getDir($projectRoot);
         throw new \Exception($newMessage, 0, $exception);
     }
 }