Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
framework
App
EnvironmentFactory.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Framework\App
;
7
8
use
Magento\Framework\App\ObjectManager\Environment\Compiled
;
9
use
Magento\Framework\App\ObjectManager\Environment\Developer
;
10
use
Magento\Framework\App\ObjectManager\ConfigLoader
;
11
use
Magento\Framework\ObjectManager\RelationsInterface
;
12
use
Magento\Framework\ObjectManager\DefinitionInterface
;
13
14
class
EnvironmentFactory
15
{
19
private
$relations;
20
24
private
$definitions;
25
30
public
function
__construct
(
31
RelationsInterface
$relations,
32
DefinitionInterface
$definitions
33
) {
34
$this->relations = $relations;
35
$this->definitions = $definitions;
36
}
37
43
public
function
createEnvironment
()
44
{
45
switch
($this->getMode()) {
46
case
Compiled::MODE
:
47
return
new
Compiled
($this);
48
break
;
49
default
:
50
return
new
Developer
($this);
51
}
52
}
53
59
private
function
getMode()
60
{
61
if
(file_exists(
ConfigLoader
\Compiled::getFilePath(
Area::AREA_GLOBAL
))) {
62
return
Compiled::MODE
;
63
}
64
65
return
Developer::MODE
;
66
}
67
73
public
function
getDefinitions
()
74
{
75
return
$this->definitions;
76
}
77
83
public
function
getRelations
()
84
{
85
return
$this->relations;
86
}
87
}
Magento\Framework\App\EnvironmentFactory\getRelations
getRelations()
Definition:
EnvironmentFactory.php:83
Magento\Framework\App
Magento\Framework\App\ObjectManager\Environment\Compiled
Definition:
Compiled.php:19
Magento\Framework\App\ObjectManager\ConfigLoader
Definition:
ConfigLoader.php:14
Magento\Framework\App\ObjectManager\Environment\Developer
Definition:
Developer.php:14
Magento\Framework\App\EnvironmentFactory
Definition:
EnvironmentFactory.php:14
Magento\Framework\App\ObjectManager\Environment\Developer\MODE
const MODE
Definition:
Developer.php:19
Magento\Framework\App\Area\AREA_GLOBAL
const AREA_GLOBAL
Definition:
Area.php:18
Magento\Framework\ObjectManager\DefinitionInterface
Definition:
DefinitionInterface.php:14
Magento\Framework\App\EnvironmentFactory\createEnvironment
createEnvironment()
Definition:
EnvironmentFactory.php:43
Magento\Framework\App\ObjectManager\Environment\Compiled\MODE
const MODE
Definition:
Compiled.php:24
Magento\Framework\App\ObjectManager\ConfigLoader\Compiled
Definition:
Compiled.php:14
Magento\Framework\ObjectManager\RelationsInterface
Definition:
RelationsInterface.php:12
Magento\Framework\App\ObjectManager\ConfigLoader
Definition:
Compiled.php:7
Magento\Framework\App\EnvironmentFactory\getDefinitions
getDefinitions()
Definition:
EnvironmentFactory.php:73
Magento\Framework\App\EnvironmentFactory\__construct
__construct(RelationsInterface $relations, DefinitionInterface $definitions)
Definition:
EnvironmentFactory.php:30