2
2
3
3
namespace Drupal \Console \Bootstrap ;
4
4
5
+ use Drupal \Console \ConsolePaths ;
5
6
use Symfony \Component \DependencyInjection \ContainerBuilder ;
6
7
use Symfony \Component \Config \FileLocator ;
7
8
use Symfony \Component \DependencyInjection \Loader \YamlFileLoader ;
@@ -17,8 +18,10 @@ class DrupalConsoleCore
17
18
* @var string
18
19
*/
19
20
protected $ appRoot ;
21
+
20
22
/**
21
23
* DrupalConsole constructor.
24
+ *
22
25
* @param $root
23
26
* @param $appRoot
24
27
*/
@@ -32,23 +35,23 @@ public function boot()
32
35
{
33
36
$ container = new ContainerBuilder ();
34
37
$ loader = new YamlFileLoader ($ container , new FileLocator ($ this ->root ));
35
- $ loader ->load ($ this -> root . DRUPAL_CONSOLE_CORE .'/services.yml ' );
38
+ $ loader ->load (DRUPAL_CONSOLE_CORE .'/services.yml ' );
36
39
if (file_exists ($ this ->root .'/services.yml ' )) {
37
40
$ loader ->load ('services.yml ' );
38
41
}
39
42
40
- if (file_exists ($ this -> root . DRUPAL_CONSOLE .'/services-drupal-install.yml ' )) {
43
+ if (file_exists (DRUPAL_CONSOLE .'/services-drupal-install ' )) {
41
44
$ loader ->load (
42
- $ this -> root . DRUPAL_CONSOLE . '/services-drupal-install.yml '
45
+ DRUPAL_CONSOLE . '/services-drupal-install '
43
46
);
44
47
}
45
48
46
49
$ container ->get ('console.configuration_manager ' )
47
- ->loadConfiguration ($ this -> root )
50
+ ->loadConfiguration (ConsolePaths:: consoleCore () )
48
51
->getConfiguration ();
49
52
50
53
$ container ->get ('console.translator_manager ' )
51
- ->loadCoreLanguage ('en ' , $ this -> root );
54
+ ->loadCoreLanguage ('en ' , dirname ( dirname ( dirname (ConsolePaths:: consoleCore ()))) );
52
55
53
56
$ container ->set (
54
57
'app.root ' ,
@@ -59,7 +62,7 @@ public function boot()
59
62
->setSkeletonDirs (
60
63
[
61
64
$ this ->root .'/templates/ ' ,
62
- $ this -> root . DRUPAL_CONSOLE_CORE .'/templates/ '
65
+ DRUPAL_CONSOLE_CORE .'/templates/ '
63
66
]
64
67
);
65
68
0 commit comments