@@ -43,16 +43,17 @@ public static function getInstaller($composerCmd = null)
43
43
44
44
/**
45
45
* @param null|string $installPath
46
+ * @param bool $beVerbose
46
47
*/
47
- public function install ($ installPath = null )
48
+ public function install ($ installPath = null , $ beVerbose = false )
48
49
{
49
50
$ installPath = (null !== $ installPath ) ? $ installPath : $ this ->getInstallPath ();
50
51
if (null !== $ installPath && !$ this ->system ->validatePath ($ installPath )) {
51
52
throw new \RuntimeException ('Invalid install path. ' );
52
53
}
53
54
54
55
$ this ->system ->ensurePath ($ installPath );
55
- $ this ->executeComposerCommand ($ installPath );
56
+ $ this ->executeComposerCommand ($ installPath, $ beVerbose );
56
57
57
58
$ this ->installKernel ();
58
59
}
@@ -69,17 +70,33 @@ protected abstract function installKernel();
69
70
70
71
/**
71
72
* @param string $installPath
73
+ * @param bool $beVerbose
72
74
*/
73
- protected function executeComposerCommand ($ installPath )
75
+ protected function executeComposerCommand ($ installPath, $ beVerbose = false )
74
76
{
75
77
$ composerStatus = 0 ;
76
78
77
- echo "\n" ;
78
- passthru (
79
- 'PATH= ' .getenv ('PATH ' ).' ' .$ this ->composerCmd .' --working-dir=" ' .$ installPath .'" create-project dawehner/jupyter-php pkgs ' ,
80
- $ composerStatus
81
- );
82
- echo "\n" ;
79
+ if ($ beVerbose ) {
80
+ echo "\n" ;
81
+ passthru (
82
+ 'PATH= ' . getenv ('PATH ' ) . ' ' .
83
+ $ this ->composerCmd . ' --prefer-dist --no-interaction --working-dir=" ' .
84
+ $ installPath .'" create-project litipk/jupyter-php=dev-master pkgs ' ,
85
+
86
+ $ composerStatus
87
+ );
88
+ echo "\n" ;
89
+ } else {
90
+ $ composerOutputLines = [];
91
+ $ composerOutput = exec (
92
+ 'PATH= ' . getenv ('PATH ' ) . ' ' .
93
+ $ this ->composerCmd . ' --prefer-dist --no-interaction --no-progress --working-dir=" ' .
94
+ $ installPath .'" create-project litipk/jupyter-php=dev-master pkgs > /dev/null 2>&1 ' ,
95
+
96
+ $ composerOutputLines ,
97
+ $ composerStatus
98
+ );
99
+ }
83
100
84
101
if ($ composerStatus !== 0 ) {
85
102
throw new \RuntimeException ('Error while trying to download Jupyter-PHP dependencies with Composer. ' );
0 commit comments