Use config as service.
This commit is contained in:
parent
455f9a59a8
commit
86de54b658
|
@ -9,7 +9,7 @@
|
|||
|
||||
namespace PHPCI\Command;
|
||||
|
||||
use b8\Config;
|
||||
use PHPCI\Config;
|
||||
use Monolog\Logger;
|
||||
use PHPCI\Helper\Lang;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
|
@ -29,11 +29,17 @@ class UpdateCommand extends Command
|
|||
*/
|
||||
protected $logger;
|
||||
|
||||
public function __construct(Logger $logger)
|
||||
/**
|
||||
* @var Config
|
||||
*/
|
||||
protected $config;
|
||||
|
||||
public function __construct(Logger $logger, Config $config)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->logger = $logger;
|
||||
$this->config = $config;
|
||||
}
|
||||
|
||||
protected function configure()
|
||||
|
@ -61,8 +67,7 @@ class UpdateCommand extends Command
|
|||
|
||||
protected function verifyInstalled(OutputInterface $output)
|
||||
{
|
||||
$config = Config::getInstance();
|
||||
$phpciUrl = $config->get('phpci.url');
|
||||
$phpciUrl = $this->config->get('phpci.url');
|
||||
|
||||
return !empty($phpciUrl);
|
||||
}
|
||||
|
|
|
@ -76,6 +76,7 @@ services:
|
|||
class: PHPCI\Command\UpdateCommand
|
||||
arguments:
|
||||
- @console.logger
|
||||
- @config
|
||||
console.command.daemon:
|
||||
class: PHPCI\Command\DaemonCommand
|
||||
arguments:
|
||||
|
|
Loading…
Reference in a new issue