Skip to content

Commit

Permalink
MAGETWO-31850: [GITHUB] install.log can not be created with open_base…
Browse files Browse the repository at this point in the history
…dir restriction #796

- CR changes
  • Loading branch information
mazhalai authored and eddielau committed Jan 9, 2015
1 parent 999d538 commit 40148b3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
14 changes: 12 additions & 2 deletions setup/module/Magento/Setup/src/Controller/DatabaseCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Magento\Setup\Controller;

use Magento\Setup\Model\InstallerFactory;
use Magento\Setup\Model\WebLogger;
use Zend\Json\Json;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\JsonModel;
Expand All @@ -18,14 +19,23 @@ class DatabaseCheck extends AbstractActionController
*/
private $installerFactory;

/**
* WebLogger to access log
*
* @var WebLogger
*/
private $webLogger;

/**
* Constructor
*
* @param InstallerFactory $installerFactory
* @param WebLogger $webLogger
*/
public function __construct(InstallerFactory $installerFactory)
public function __construct(InstallerFactory $installerFactory, WebLogger $webLogger)
{
$this->installerFactory = $installerFactory;
$this->webLogger = $webLogger;
}

/**
Expand All @@ -37,7 +47,7 @@ public function indexAction()
{
$params = Json::decode($this->getRequest()->getContent(), Json::TYPE_ARRAY);
try {
$installer = $this->installerFactory->create();
$installer = $this->installerFactory->create($this->webLogger);
$password = isset($params['password']) ? $params['password'] : '';
$installer->checkDatabaseConnection($params['name'], $params['host'], $params['user'], $password);
return new JsonModel(['success' => true]);
Expand Down
5 changes: 3 additions & 2 deletions setup/module/Magento/Setup/src/Model/InstallerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ public function __construct(ServiceLocatorInterface $serviceLocator)
/**
* Factory method for installer object
*
* @param LoggerInterface $log
* @return Installer
*/
public function create()
public function create(LoggerInterface $log)
{
return new Installer(
$this->serviceLocator->get('Magento\Setup\Model\FilePermissions'),
Expand All @@ -42,7 +43,7 @@ public function create()
$this->serviceLocator->get('Magento\Framework\Module\ModuleList\Loader'),
$this->serviceLocator->get('Magento\Framework\App\Filesystem\DirectoryList'),
$this->serviceLocator->get('Magento\Setup\Model\AdminAccountFactory'),
new WebLogger($this->serviceLocator->get('Magento\Framework\Filesystem')),
$log,
$this->serviceLocator->get('Magento\Framework\Math\Random'),
$this->serviceLocator->get('Magento\Setup\Module\ConnectionFactory'),
$this->serviceLocator->get('Magento\Framework\App\MaintenanceMode'),
Expand Down

0 comments on commit 40148b3

Please sign in to comment.