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
magento2-base
setup
src
Magento
Setup
Module
Di
Compiler
Log
Writer
Console.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Setup\Module\Di\Compiler\Log\Writer
;
7
8
use
Magento\Setup\Module\Di\Compiler\Log\Log
;
9
use Symfony\Component\Console\Output\OutputInterface;
10
11
class
Console
12
{
18
protected
$_messages
= [
19
Log::GENERATION_SUCCESS
=>
'Generated classes:'
,
20
Log::GENERATION_ERROR
=>
'Errors during class generation:'
,
21
Log::COMPILATION_ERROR
=>
'Errors during compilation:'
,
22
Log::CONFIGURATION_ERROR
=>
'Errors during configuration scanning:'
,
23
];
24
30
protected
$console
;
31
35
public
function
__construct
(OutputInterface
$output
)
36
{
37
$this->console =
$output
;
38
}
39
46
public
function
write
(array
$data
)
47
{
48
$errorsCount = 0;
49
foreach
(
$data
as
$type
=> $classes) {
50
if
(!count($classes)) {
51
continue
;
52
}
53
$this->console->writeln($this->getStartTag(
$type
) . $this->_messages[
$type
] . $this->getEndTag(
$type
));
54
foreach
($classes as
$className
=> $messages) {
55
if
(count($messages)) {
56
$this->console->writeln($this->getStartTag(
$type
) .
"\t"
.
$className
. $this->getEndTag(
$type
));
57
foreach
($messages as
$message
) {
58
if
(
$message
) {
59
$this->console->writeln(
60
$this->getStartTag(
$type
) .
"\t\t"
.
$message
. $this->getEndTag(
$type
)
61
);
62
if
(
$type
!=
Log::GENERATION_SUCCESS
) {
63
$errorsCount++;
64
}
65
}
66
}
67
}
68
}
69
}
70
71
if
($errorsCount) {
72
$this->console->writeln(
'<error>'
.
'Total Errors Count: '
. $errorsCount .
'</error>'
);
73
}
74
}
75
82
private
function
getStartTag(
$type
)
83
{
84
if
(
$type
===
Log::GENERATION_SUCCESS
) {
85
return
'<info>'
;
86
}
else
{
87
return
'<error>'
;
88
}
89
}
90
97
private
function
getEndTag(
$type
)
98
{
99
if
(
$type
===
Log::GENERATION_SUCCESS
) {
100
return
'</info>'
;
101
}
else
{
102
return
'</error>'
;
103
}
104
}
105
}
Magento\Setup\Module\Di\Compiler\Log\Log\CONFIGURATION_ERROR
const CONFIGURATION_ERROR
Definition:
Log.php:16
Magento\Setup\Module\Di\Compiler\Log\Log\GENERATION_ERROR
const GENERATION_ERROR
Definition:
Log.php:10
Magento\Setup\Module\Di\Compiler\Log\Log
Definition:
Log.php:8
Magento\Setup\Module\Di\Compiler\Log\Writer\Console\$_messages
$_messages
Definition:
Console.php:18
$message
$message
Definition:
notifications.php:7
$type
$type
Definition:
item.phtml:13
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Magento\Setup\Module\Di\Compiler\Log\Writer\Console\__construct
__construct(OutputInterface $output)
Definition:
Console.php:35
$output
$output
Definition:
classmap_generator.php:100
Magento\Setup\Module\Di\Compiler\Log\Log\COMPILATION_ERROR
const COMPILATION_ERROR
Definition:
Log.php:14
Magento\Setup\Module\Di\Compiler\Log\Log\GENERATION_SUCCESS
const GENERATION_SUCCESS
Definition:
Log.php:12
Magento\Setup\Module\Di\Compiler\Log\Writer
Definition:
Console.php:6
Magento\Setup\Module\Di\Compiler\Log\Writer\Console
Definition:
Console.php:11
Magento\Setup\Module\Di\Compiler\Log\Writer\Console\write
write(array $data)
Definition:
Console.php:46
$className
if($currentSelectedMethod==$_code) $className
Definition:
form.phtml:31
Magento\Setup\Module\Di\Compiler\Log\Writer\Console\$console
$console
Definition:
Console.php:30