1919use Continuous \DeployAgent \Task \Runner \TaskRunnerManager ;
2020use League \Flysystem \Filesystem ;
2121use Zend \Config \Config ;
22- use Zend \Console \ColorInterface ;
2322use Zend \EventManager \EventInterface ;
2423use Zend \EventManager \EventManagerInterface ;
2524use Zend \EventManager \ListenerAggregateInterface ;
@@ -120,24 +119,6 @@ public function setPackageStoragePath($packageStoragePath)
120119 return $ this ;
121120 }
122121
123- /**
124- * @return ConsoleAdapter
125- */
126- public function getConsole ()
127- {
128- return $ this ->console ;
129- }
130-
131- /**
132- * @param ConsoleAdapter $console
133- * @return TaskManager
134- */
135- public function setConsole (ConsoleAdapter $ console )
136- {
137- $ this ->console = $ console ;
138- return $ this ;
139- }
140-
141122 /**
142123 * @return mixed
143124 */
@@ -246,16 +227,12 @@ public function install(EventInterface $event)
246227 $ origin = $ provider ->getSource ($ build );
247228 $ origin ->setFilename ($ build . '.tar.gz ' );
248229
249- $ this ->getLogger ()->info ('Downloading package... ' );
250- if ($ this ->getConsole ()) {
251- $ origin ->getEventManager ()->attach (
252- DeployEvent::EVENT_FETCH_PRE ,
253- function (DeployEvent $ event ) {
254- $ this ->getConsole ()
255- ->writeLine ('Downloading package... ' , ColorInterface::LIGHT_CYAN );
256- }
257- );
258- }
230+ $ origin ->getEventManager ()->attach (
231+ DeployEvent::EVENT_FETCH_PRE ,
232+ function (DeployEvent $ event ) {
233+ $ this ->getLogger ()->info ('Downloading package... ' );
234+ }
235+ );
259236
260237 $ mask = umask (0 );
261238
@@ -266,16 +243,12 @@ function (DeployEvent $event) {
266243
267244 $ resource = new Archive ($ resourcePath );
268245
269- $ this ->getLogger ()->info ('Extracting package... ' );
270- if ($ this ->getConsole ()) {
271- $ resource ->getEventManager ()->attach (
272- DeployEvent::EVENT_FETCH_PRE ,
273- function () {
274- $ this ->getConsole ()
275- ->writeLine ('Extracting package... ' , ColorInterface::LIGHT_CYAN );
276- }
277- );
278- }
246+ $ resource ->getEventManager ()->attach (
247+ DeployEvent::EVENT_FETCH_PRE ,
248+ function () {
249+ $ this ->getLogger ()->info ('Extracting package... ' );
250+ }
251+ );
279252
280253 $ destination = new Directory ($ application ->getPath () . DIRECTORY_SEPARATOR . $ build );
281254
@@ -316,13 +289,6 @@ public function activate(EventInterface $event)
316289
317290 $ message = 'Starting ' . $ application ->getName () . ' ( ' . $ build . ') ' ;
318291 $ this ->getLogger ()->info ($ message );
319- if ($ this ->getConsole ()) {
320- $ this ->getConsole ()
321- ->writeLine (
322- 'Starting ' . $ application ->getName () . ' ( ' . $ build . ') ' ,
323- ColorInterface::LIGHT_CYAN
324- );
325- }
326292
327293 symlink (
328294 $ application ->getPath () . DIRECTORY_SEPARATOR . $ build ,
@@ -333,19 +299,11 @@ public function activate(EventInterface $event)
333299
334300 $ message = $ application ->getName () . ' ( ' . $ build . ') has successfully started ' ;
335301 $ this ->getLogger ()->info ($ message );
336- if ($ this ->getConsole ()) {
337- $ this ->getConsole ()
338- ->writeLine (
339- $ application ->getName () . ' ( ' . $ build . ') has successfully started ' ,
340- ColorInterface::LIGHT_CYAN
341- );
342- }
343302 }
344303
345304 public function loadConfig ($ path )
346305 {
347306 $ this ->getLogger ()->info ('Applying config from ' . $ path );
348- $ this ->getConsole ()->writeLine ('Applying config from ' . $ path , ColorInterface::WHITE );
349307 $ configReader = new \Zend \Config \Reader \Yaml (['Symfony\Component\Yaml\Yaml ' , 'parse ' ]);
350308 $ config = $ configReader ->fromFile ($ path );
351309 $ this ->config = $ config ;
0 commit comments