Skip to content

Commit 21d353e

Browse files
committed
Merge remote-tracking branch 'cloud/develop' into MAGECLOUD-2895
2 parents 9ba89c8 + ef43872 commit 21d353e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2711
-588
lines changed

.travis.yml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,11 @@ addons:
1717
update: true
1818

1919
env:
20-
global:
21-
- DIR_TOOLS="/var/www/ece-tools"
2220
matrix:
2321
- TEST_SUITE=static-unit XDEBUG=true
2422
- TEST_SUITE=integration
2523
- TEST_SUITE=docker-integration
2624

27-
matrix:
28-
exclude:
29-
- php: '7.0'
30-
env: TEST_SUITE=docker-integration
31-
- php: '7.1'
32-
env: TEST_SUITE=docker-integration
33-
3425
cache:
3526
apt: true
3627
directories:
@@ -41,9 +32,7 @@ before_install:
4132
- echo "COMPOSER_MAGENTO_PASSWORD=${REPO_PASSWORD}" >> ./docker/composer.env
4233
- if [ $XDEBUG == "true" ]; then echo "PHP_ENABLE_XDEBUG=true" >> ./docker/global.env; fi;
4334

44-
install:
45-
- composer update -n --no-suggest
46-
- ./bin/ece-tools docker:build:integration ${TRAVIS_PHP_VERSION} 10.0 latest
35+
install: composer update -n --no-suggest
4736

4837
script: ./tests/travis/script.sh
4938

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/ece-tools",
33
"description": "Provides tools to build and deploy Magento 2 Enterprise Edition",
44
"type": "magento2-component",
5-
"version": "2002.0.15",
5+
"version": "2002.0.16",
66
"license": "OSL-3.0",
77
"require": {
88
"php": "^7.0",

dist/docker/global.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
return [
44
'PHP_MEMORY_LIMIT' => '2048M',
5-
'PHP_ENABLE_XDEBUG' => 'false',
65
'DEBUG' => 'false',
76
'ENABLE_SENDMAIL' => 'false',
87
'UPLOAD_MAX_FILESIZE' => '64M',
98
'MAGENTO_ROOT' => '/var/www/magento',
9+
'PHP_ENABLE_XDEBUG' => 'false',
10+
'PHP_IDE_CONFIG' => 'serverName=magento_cloud_docker', #name of your server in IDE
11+
'XDEBUG_CONFIG' => 'remote_host=host.docker.internal', #docker host for developer environments, can be different for your OS
1012
];

patches.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"~2.1.4": "MAGETWO-57413__move_vendor_path_autoloader__2.1.4.patch"
2121
},
2222
"Allow static assets to be loaded without URL rewrites": {
23-
"~2.1.4": "MAGETWO-57414__load_static_assets_without_rewrites__2.1.4.patch"
23+
"2.1.4 - 2.1.16": "MAGETWO-57414__load_static_assets_without_rewrites__2.1.4.patch",
24+
"~2.1.17": "MAGETWO-57414__load_static_assets_without_rewrites__2.1.17.patch"
2425
},
2526
"Don't attempt to use non-existent setup areas": {
2627
"~2.1.4": "MAGETWO-45357__avoid_nonexistent_setup_area__2.1.4.patch"
@@ -138,6 +139,17 @@
138139
"Add the possibility to install Magento without admin creation" : {
139140
"2.1.4 - 2.2.1": "MAGECLOUD-2573__installation_without_admin_creation__2.1.4.patch",
140141
"2.2.2 - 2.2.7": "MAGECLOUD-2573__installation_without_admin_creation__2.2.2.patch"
142+
},
143+
"Suppress PDO warnings to work around PHP bugs #63812, #74401": {
144+
"2.1.4": "MAGECLOUD-2820__implement_isolated_connections_mechanism__2.1.4.patch",
145+
"2.1.5 - 2.1.12": "MAGECLOUD-2820__implement_isolated_connections_mechanism__2.1.5.patch",
146+
"2.1.13 - 2.1.17": "MAGECLOUD-2820__implement_isolated_connections_mechanism__2.1.13.patch",
147+
"2.2.0 - 2.2.8 || 2.3.0 - 2.3.1": "MAGECLOUD-2820__implement_isolated_connections_mechanism__2.2.0.patch"
148+
}
149+
},
150+
"monolog/monolog": {
151+
"Fix monolog Slack Handler bug for magento 2.1.x": {
152+
"1.16.0": "MAGECLOUD-2793__fix_monolog_slack_handler_2.1.x.patch"
141153
}
142154
}
143155
}
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
diff -Nuar a/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php
2+
index 643b003..ac2af02 100644
3+
--- a/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php
4+
+++ b/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php
5+
@@ -70,15 +70,16 @@ class SlackHandler extends SocketHandler
6+
private $lineFormatter;
7+
8+
/**
9+
- * @param string $token Slack API token
10+
- * @param string $channel Slack channel (encoded ID or name)
11+
- * @param string $username Name of a bot
12+
- * @param bool $useAttachment Whether the message should be added to Slack as attachment (plain text otherwise)
13+
- * @param string|null $iconEmoji The emoji name to use (or null)
14+
- * @param int $level The minimum logging level at which this handler will be triggered
15+
- * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
16+
- * @param bool $useShortAttachment Whether the the context/extra messages added to Slack as attachments are in a short style
17+
- * @param bool $includeContextAndExtra Whether the attachment should include context and extra data
18+
+ * @param string $token Slack API token
19+
+ * @param string $channel Slack channel (encoded ID or name)
20+
+ * @param string $username Name of a bot
21+
+ * @param bool $useAttachment Whether the message should be added to Slack as attachment (plain text otherwise)
22+
+ * @param string|null $iconEmoji The emoji name to use (or null)
23+
+ * @param int $level The minimum logging level at which this handler will be triggered
24+
+ * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
25+
+ * @param bool $useShortAttachment Whether the the context/extra messages added to Slack as attachments are in a short style
26+
+ * @param bool $includeContextAndExtra Whether the attachment should include context and extra data
27+
+ * @throws MissingExtensionException If no OpenSSL PHP extension configured
28+
*/
29+
public function __construct($token, $channel, $username = 'Monolog', $useAttachment = true, $iconEmoji = null, $level = Logger::CRITICAL, $bubble = true, $useShortAttachment = false, $includeContextAndExtra = false)
30+
{
31+
@@ -95,7 +96,8 @@ class SlackHandler extends SocketHandler
32+
$this->useAttachment = $useAttachment;
33+
$this->useShortAttachment = $useShortAttachment;
34+
$this->includeContextAndExtra = $includeContextAndExtra;
35+
- if ($this->includeContextAndExtra) {
36+
+
37+
+ if ($this->includeContextAndExtra && $this->useShortAttachment) {
38+
$this->lineFormatter = new LineFormatter;
39+
}
40+
}
41+
@@ -139,35 +141,26 @@ class SlackHandler extends SocketHandler
42+
'channel' => $this->channel,
43+
'username' => $this->username,
44+
'text' => '',
45+
- 'attachments' => array()
46+
+ 'attachments' => array(),
47+
);
48+
49+
if ($this->useAttachment) {
50+
$attachment = array(
51+
'fallback' => $record['message'],
52+
- 'color' => $this->getAttachmentColor($record['level'])
53+
+ 'color' => $this->getAttachmentColor($record['level']),
54+
+ 'fields' => array(),
55+
);
56+
57+
if ($this->useShortAttachment) {
58+
- $attachment['fields'] = array(
59+
- array(
60+
- 'title' => $record['level_name'],
61+
- 'value' => $record['message'],
62+
- 'short' => false
63+
- )
64+
- );
65+
+ $attachment['title'] = $record['level_name'];
66+
+ $attachment['text'] = $record['message'];
67+
} else {
68+
- $attachment['fields'] = array(
69+
- array(
70+
- 'title' => 'Message',
71+
- 'value' => $record['message'],
72+
- 'short' => false
73+
- ),
74+
- array(
75+
- 'title' => 'Level',
76+
- 'value' => $record['level_name'],
77+
- 'short' => true
78+
- )
79+
+ $attachment['title'] = 'Message';
80+
+ $attachment['text'] = $record['message'];
81+
+ $attachment['fields'][] = array(
82+
+ 'title' => 'Level',
83+
+ 'value' => $record['level_name'],
84+
+ 'short' => true,
85+
);
86+
}
87+
88+
@@ -177,7 +170,7 @@ class SlackHandler extends SocketHandler
89+
$attachment['fields'][] = array(
90+
'title' => "Extra",
91+
'value' => $this->stringify($record['extra']),
92+
- 'short' => $this->useShortAttachment
93+
+ 'short' => $this->useShortAttachment,
94+
);
95+
} else {
96+
// Add all extra fields as individual fields in attachment
97+
@@ -185,7 +178,7 @@ class SlackHandler extends SocketHandler
98+
$attachment['fields'][] = array(
99+
'title' => $var,
100+
'value' => $val,
101+
- 'short' => $this->useShortAttachment
102+
+ 'short' => $this->useShortAttachment,
103+
);
104+
}
105+
}
106+
@@ -196,7 +189,7 @@ class SlackHandler extends SocketHandler
107+
$attachment['fields'][] = array(
108+
'title' => "Context",
109+
'value' => $this->stringify($record['context']),
110+
- 'short' => $this->useShortAttachment
111+
+ 'short' => $this->useShortAttachment,
112+
);
113+
} else {
114+
// Add all context fields as individual fields in attachment
115+
@@ -204,7 +197,7 @@ class SlackHandler extends SocketHandler
116+
$attachment['fields'][] = array(
117+
'title' => $var,
118+
'value' => $val,
119+
- 'short' => $this->useShortAttachment
120+
+ 'short' => $this->useShortAttachment,
121+
);
122+
}
123+
}
124+
@@ -248,6 +241,10 @@ class SlackHandler extends SocketHandler
125+
protected function write(array $record)
126+
{
127+
parent::write($record);
128+
+ $res = $this->getResource();
129+
+ if (is_resource($res)) {
130+
+ @fread($res, 2048);
131+
+ }
132+
$this->closeSocket();
133+
}
134+
135+
@@ -275,8 +272,7 @@ class SlackHandler extends SocketHandler
136+
/**
137+
* Stringifies an array of key/value pairs to be used in attachment fields
138+
*
139+
- * @param array $fields
140+
- * @access protected
141+
+ * @param array $fields
142+
* @return string
143+
*/
144+
protected function stringify($fields)
145+
diff -Nuar a/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php
146+
index a3e7252e..e4c3c37f 100644
147+
--- a/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php
148+
+++ b/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php
149+
@@ -41,6 +41,15 @@ class SocketHandler extends AbstractProcessingHandler
150+
$this->connectionTimeout = (float) ini_get('default_socket_timeout');
151+
}
152+
153+
+ /**
154+
+ * @return resource|null
155+
+ */
156+
+ protected function getResource()
157+
+ {
158+
+ return $this->resource;
159+
+ }
160+
+
161+
+
162+
/**
163+
* Connect (if necessary) and write to the socket
164+
*

0 commit comments

Comments
 (0)