This repository was archived by the owner on Nov 14, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -60,15 +60,18 @@ protected function configure()
60
60
;
61
61
}
62
62
63
- protected function execute (InputInterface $ input , OutputInterface $ output )
63
+ protected function initialize (InputInterface $ input , OutputInterface $ output )
64
64
{
65
65
$ this ->fs = new Filesystem ();
66
66
$ directory = rtrim (trim ($ input ->getArgument ('directory ' )), DIRECTORY_SEPARATOR );
67
67
$ this ->projectDir = $ this ->fs ->isAbsolutePath ($ directory ) ? $ directory : getcwd ().DIRECTORY_SEPARATOR .$ directory ;
68
68
$ this ->projectName = basename ($ directory );
69
69
$ this ->version = trim ($ input ->getArgument ('version ' ));
70
70
$ this ->output = $ output ;
71
+ }
71
72
73
+ protected function execute (InputInterface $ input , OutputInterface $ output )
74
+ {
72
75
try {
73
76
$ this
74
77
->checkProjectName ()
Original file line number Diff line number Diff line change @@ -37,6 +37,14 @@ protected function configure()
37
37
;
38
38
}
39
39
40
+ /**
41
+ * The self-update command is only available when using the installer via the PHAR file.
42
+ */
43
+ public function isEnabled ()
44
+ {
45
+ return 'phar:// ' === substr (__DIR__ , 0 , 7 );
46
+ }
47
+
40
48
protected function execute (InputInterface $ input , OutputInterface $ output )
41
49
{
42
50
$ fs = new Filesystem ();
Original file line number Diff line number Diff line change @@ -23,11 +23,7 @@ $appVersion = '0.6.0-DEV';
23
23
$ app = new Symfony \Component \Console \Application ('Symfony Installer ' , $ appVersion );
24
24
$ app ->add (new Symfony \Installer \AboutCommand ($ appVersion ));
25
25
$ app ->add (new Symfony \Installer \NewCommand ());
26
-
27
- // enable the self-update command only when using the PHAR file
28
- if ('phar:// ' === substr (__DIR__ , 0 , 7 )) {
29
- $ app ->add (new Symfony \Installer \SelfUpdateCommand ());
30
- }
26
+ $ app ->add (new Symfony \Installer \SelfUpdateCommand ());
31
27
32
28
$ app ->setDefaultCommand ('about ' );
33
29
You can’t perform that action at this time.
0 commit comments