Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit fefb3f6

Browse files
author
Oleksii Korshenko
committed
MAGETWO-84764: NewRelic: Disables Module Deployments, Creates new Deploy Marker Command #12477
- fixed code style - added copyright - fixed di configuration
1 parent 97735bb commit fefb3f6

File tree

3 files changed

+39
-6
lines changed

3 files changed

+39
-6
lines changed

app/code/Magento/NewRelicReporting/Console/Command/DeployMarker.php

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,36 @@
11
<?php
2-
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
36
namespace Magento\NewRelicReporting\Console\Command;
47

58
use Symfony\Component\Console\Command\Command;
69
use Symfony\Component\Console\Input\InputInterface;
710
use Symfony\Component\Console\Output\OutputInterface;
811
use Symfony\Component\Console\Input\InputArgument;
9-
1012
use Magento\NewRelicReporting\Model\Apm\DeploymentsFactory;
1113
use Magento\NewRelicReporting\Model\ServiceShellUser;
1214

1315
class DeployMarker extends Command
1416
{
17+
/**
18+
* @var DeploymentsFactory
19+
*/
1520
protected $deploymentsFactory;
21+
22+
/**
23+
* @var ServiceShellUser
24+
*/
1625
protected $serviceShellUser;
1726

27+
/**
28+
* Initialize dependencies.
29+
*
30+
* @param DeploymentsFactory $deploymentsFactory
31+
* @param ServiceShellUser $serviceShellUser
32+
* @param null $name
33+
*/
1834
public function __construct(
1935
DeploymentsFactory $deploymentsFactory,
2036
ServiceShellUser $serviceShellUser,
@@ -25,6 +41,9 @@ public function __construct(
2541
parent::__construct($name);
2642
}
2743

44+
/**
45+
* {@inheritdoc}
46+
*/
2847
protected function configure()
2948
{
3049
$this->setName("newrelic:create:deploy-marker");
@@ -47,6 +66,9 @@ protected function configure()
4766
parent::configure();
4867
}
4968

69+
/**
70+
* {@inheritdoc}
71+
*/
5072
protected function execute(InputInterface $input, OutputInterface $output)
5173
{
5274
$this->deploymentsFactory->create()->setDeployment(

app/code/Magento/NewRelicReporting/Model/ServiceShellUser.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
11
<?php
2-
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
36
namespace Magento\NewRelicReporting\Model;
47

58
class ServiceShellUser
69
{
10+
/**
11+
* Default user name;
12+
*/
713
const DEFAULT_USER = 'cron';
814

15+
/**
16+
* Get use name.
17+
*
18+
* @param bool $userFromArgument
19+
* @return string
20+
*/
921
public function get($userFromArgument = false)
1022
{
1123
if ($userFromArgument) {

app/code/Magento/NewRelicReporting/etc/di.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@
3030
<type name="Magento\Framework\App\Http">
3131
<plugin name="framework-http-newrelic" type="Magento\NewRelicReporting\Plugin\HttpPlugin"/>
3232
</type>
33-
<type name="Magento\Framework\Console\CommandList">
33+
<type name="Magento\Framework\Console\CommandListInterface">
3434
<arguments>
3535
<argument name="commands" xsi:type="array">
36-
<item name="magento_new_relic_reporting_command_deploy_marker"
37-
xsi:type="object">Magento\NewRelicReporting\Console\Command\DeployMarker</item>
36+
<item name="newrelicreporting_deploy_marker" xsi:type="object">Magento\NewRelicReporting\Console\Command\DeployMarker</item>
3837
</argument>
3938
</arguments>
4039
</type>

0 commit comments

Comments
 (0)