Skip to content

Commit df1b40a

Browse files
authored
Add settings namespace (#11)
* [setting:debug] Add command. * [setting:debug] Update DebugCommand. * [setting:debug] Update DebugCommand. * [setting:debug] Update DebugCommand. * [console] Add/Register NestedArray service. * [console] Update NestedArray class. * [console] Update NestedArray class. * [setting:debug] Update DebugCommand. * [setting:set] Update SetCommand. * [setting:set] Update SetCommand. * [translator] Update TranslatorManager. * [translator] Update TranslatorManager and SettingsSet. * [translator] Update SettingsSet. * [translator] Update TranslatorManager. * [translator] Update TranslatorManager. * [translator] Update TranslatorManager. * [translator] Update TranslatorManager. * [translator] Update TranslatorManager. * [translator] Update TranslatorManager. * [translator] Update TranslatorManager. * [translator] Update TranslatorManager. * [translator] Update TranslatorManager. * [translator] Update TranslatorManager. * [translator] Update TranslatorManager. * [translator] Update TranslatorManager. * [console] Update readme file.
1 parent 58c8434 commit df1b40a

8 files changed

+1516
-4
lines changed

README.md

+30-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,32 @@
11
# Drupal Console Core
22

3-
Drupal Console Core
3+
Drupal Console Core, this project contains commands and features to be shared across projects.
4+
5+
### Relocate commands:
6+
#### Completed
7+
```
8+
* about Display basic information about project.
9+
* check System requirement checker
10+
* help Displays help for a command.
11+
* list Lists all available commands.
12+
* settings:debug List user Drupal Console settings.
13+
* settings:set Change a specific setting value in DrupalConsole config file
14+
```
15+
16+
#### Pending
17+
```
18+
* init Copy configuration files.
19+
* settings:debug List user Drupal Console settings.
20+
* settings:set Change a specific setting value in DrupalConsole config file
21+
* site:debug List all known local and remote sites.
22+
* site:import:local Import/Configure an existing local Drupal project
23+
* translation:cleanup Clean up translation files
24+
* translation:pending Determine pending translation string in a language or a specific file in a language
25+
* translation:stats Generate translate stats
26+
* translation:sync Sync translation files
27+
* yaml:diff Compare two YAML files in order to find differences between them.
28+
* yaml:merge Merge two or more YAML files in a new YAML file. Latest values are preserved.
29+
* yaml:split Split a YAML file using indent as separator criteria
30+
* yaml:update:key Replace a YAML key in a YAML file.
31+
* yaml:update:value Update a value for a specific key in a YAML file.
32+
```

services.yml

+17
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ services:
1010
class: Drupal\Console\Utils\RequirementChecker
1111
console.chain_queue:
1212
class: Drupal\Console\Utils\ChainQueue
13+
console.nested_array:
14+
class: Drupal\Console\Utils\NestedArray
1315
# DrupalConsoleCore Commands
1416
console.about:
1517
class: Drupal\Console\Command\AboutCommand
@@ -32,3 +34,18 @@ services:
3234
arguments: ['@console.requirement_checker', '@console.chain_queue', '@console.configuration_manager']
3335
tags:
3436
- { name: console.command }
37+
console.check:
38+
class: Drupal\Console\Command\CheckCommand
39+
arguments: ['@console.requirement_checker', '@console.chain_queue', '@console.configuration_manager']
40+
tags:
41+
- { name: console.command }
42+
console.settings_debug:
43+
class: Drupal\Console\Command\Settings\DebugCommand
44+
arguments: ['@console.configuration_manager', '@console.nested_array']
45+
tags:
46+
- { name: console.command }
47+
console.settings_set:
48+
class: Drupal\Console\Command\Settings\SetCommand
49+
arguments: ['@console.configuration_manager', '@console.nested_array']
50+
tags:
51+
- { name: console.command }

src/Command/Command.php

+110
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
<?php
2+
3+
namespace Drupal\Console\Command;
4+
5+
use Symfony\Component\Console\Command\Command as BaseCommand;
6+
use Symfony\Component\Console\Helper\HelperSet;
7+
use Drupal\Console\Helper\HelperTrait;
8+
9+
/**
10+
* Class Command
11+
* @package Drupal\Console\Command
12+
*
13+
* @deprecated
14+
*/
15+
abstract class Command extends BaseCommand
16+
{
17+
use HelperTrait;
18+
19+
/**
20+
* @var string
21+
*/
22+
protected $module;
23+
24+
/**
25+
* @var string
26+
*/
27+
protected $theme;
28+
29+
/**
30+
* @var array
31+
*/
32+
protected $dependencies;
33+
34+
/**
35+
* @param HelperSet $helperSet
36+
*/
37+
public function __construct(HelperSet $helperSet)
38+
{
39+
$this->setHelperSet($helperSet);
40+
parent::__construct();
41+
}
42+
43+
/**
44+
* @return string
45+
*/
46+
public function getModule()
47+
{
48+
return $this->module;
49+
}
50+
51+
/**
52+
* @param string $module
53+
*/
54+
public function setModule($module)
55+
{
56+
$this->module = $module;
57+
}
58+
59+
/**
60+
* @return string
61+
*/
62+
public function getTheme()
63+
{
64+
return $this->theme;
65+
}
66+
67+
/**
68+
* @param string $theme
69+
*/
70+
public function setTheme($theme)
71+
{
72+
$this->theme = $theme;
73+
}
74+
75+
/**
76+
* @param $key string
77+
*
78+
* @return string
79+
*/
80+
public function trans($key)
81+
{
82+
return $this->getTranslator()->trans($key);
83+
}
84+
85+
/**
86+
* @param $sourceName string
87+
*
88+
* @param $sourceName
89+
*/
90+
public function addDependency($sourceName)
91+
{
92+
$this->dependencies[] = $sourceName;
93+
}
94+
95+
/**
96+
* @return array
97+
*/
98+
public function getDependencies()
99+
{
100+
return $this->dependencies;
101+
}
102+
103+
/**
104+
* @return \Drupal\Console\Application;
105+
*/
106+
public function getApplication()
107+
{
108+
return parent::getApplication();
109+
}
110+
}

0 commit comments

Comments
 (0)