Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
InstallerFactory.php
Go to the documentation of this file.
1 <?php
7 namespace Magento\Setup\Model;
8 
9 use Zend\ServiceManager\ServiceLocatorInterface;
13 
18 {
24  protected $serviceLocator;
25 
29  private $resourceFactory;
30 
37  public function __construct(
38  ServiceLocatorInterface $serviceLocator,
39  ResourceFactory $resourceFactory
40  ) {
41  $this->serviceLocator = $serviceLocator;
42  $this->resourceFactory = $resourceFactory;
43  // For Setup Wizard we are using our customized error handler
44  $handler = new ErrorHandler();
45  set_error_handler([$handler, 'handler']);
46  }
47 
54  public function create(LoggerInterface $log)
55  {
56  return new Installer(
57  $this->serviceLocator->get(\Magento\Framework\Setup\FilePermissions::class),
58  $this->serviceLocator->get(\Magento\Framework\App\DeploymentConfig\Writer::class),
59  $this->serviceLocator->get(\Magento\Framework\App\DeploymentConfig\Reader::class),
60  $this->serviceLocator->get(\Magento\Framework\App\DeploymentConfig::class),
61  $this->serviceLocator->get(\Magento\Framework\Module\ModuleList::class),
62  $this->serviceLocator->get(\Magento\Framework\Module\ModuleList\Loader::class),
63  $this->serviceLocator->get(\Magento\Setup\Model\AdminAccountFactory::class),
64  $log,
65  $this->serviceLocator->get(\Magento\Setup\Module\ConnectionFactory::class),
66  $this->serviceLocator->get(\Magento\Framework\App\MaintenanceMode::class),
67  $this->serviceLocator->get(\Magento\Framework\Filesystem::class),
68  $this->serviceLocator->get(\Magento\Setup\Model\ObjectManagerProvider::class),
69  new \Magento\Framework\Model\ResourceModel\Db\Context(
70  $this->getResource(),
71  $this->serviceLocator->get(\Magento\Framework\Model\ResourceModel\Db\TransactionManager::class),
72  $this->serviceLocator->get(\Magento\Framework\Model\ResourceModel\Db\ObjectRelationProcessor::class)
73  ),
74  $this->serviceLocator->get(\Magento\Setup\Model\ConfigModel::class),
75  $this->serviceLocator->get(\Magento\Framework\App\State\CleanupFiles::class),
76  $this->serviceLocator->get(\Magento\Setup\Validator\DbValidator::class),
77  $this->serviceLocator->get(\Magento\Setup\Module\SetupFactory::class),
78  $this->serviceLocator->get(\Magento\Setup\Module\DataSetupFactory::class),
79  $this->serviceLocator->get(\Magento\Framework\Setup\SampleData\State::class),
80  new \Magento\Framework\Component\ComponentRegistrar(),
81  $this->serviceLocator->get(\Magento\Setup\Model\PhpReadinessCheck::class)
82  );
83  }
84 
90  private function getResource()
91  {
92  $deploymentConfig = $this->serviceLocator->get(\Magento\Framework\App\DeploymentConfig::class);
93  return $this->resourceFactory->create($deploymentConfig);
94  }
95 }
__construct(ServiceLocatorInterface $serviceLocator, ResourceFactory $resourceFactory)
$deploymentConfig
catch(\Exception $e) $handler
Definition: index.php:30