From bbc31f8c9068fba58a91bb43b8c48aeb4e751068 Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Mon, 30 Jan 2017 16:42:51 -0500
Subject: [PATCH] Added banner to console output.

---
 composer.json                   |  1 +
 module/VuFindConsole/Module.php | 21 ++++++++++++++++++++-
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/composer.json b/composer.json
index 75b907bf613..5afed282a65 100644
--- a/composer.json
+++ b/composer.json
@@ -52,6 +52,7 @@
         "zendframework/zend-session": "2.7.3",
         "zendframework/zend-soap": "2.6.0",
         "zendframework/zend-stdlib": "2.7.7",
+        "zendframework/zend-text": "2.6.0",
         "zendframework/zend-validator": "2.8.2",
         "zendframework/zend-view": "2.8.1",
         "zendframework/zendrest": "2.0.2",
diff --git a/module/VuFindConsole/Module.php b/module/VuFindConsole/Module.php
index 43442287f61..25daa33b94d 100644
--- a/module/VuFindConsole/Module.php
+++ b/module/VuFindConsole/Module.php
@@ -37,7 +37,8 @@ use Zend\Console\Adapter\AdapterInterface as Console;
  * @license  http://opensource.org/licenses/gpl-2.0.php GNU General Public License
  * @link     https://vufind.org/wiki/development
  */
-class Module implements \Zend\ModuleManager\Feature\ConsoleUsageProviderInterface
+class Module implements \Zend\ModuleManager\Feature\ConsoleUsageProviderInterface,
+    \Zend\ModuleManager\Feature\ConsoleBannerProviderInterface
 {
     /**
      * Get module configuration
@@ -65,6 +66,24 @@ class Module implements \Zend\ModuleManager\Feature\ConsoleUsageProviderInterfac
         ];
     }
 
+    /**
+     * Returns a string containing a banner text, that describes the module and/or
+     * the application.
+     * The banner is shown in the console window, when the user supplies invalid
+     * command-line parameters or invokes the application with no parameters.
+     *
+     * The method is called with active Zend\Console\Adapter\AdapterInterface that
+     * can be used to directly access Console and send output.
+     *
+     * @param Console $console Console adapter
+     *
+     * @return string|null
+     */
+    public function getConsoleBanner(Console $console)
+    {
+        return 'VuFind';
+    }
+
     /**
      * Return usage information
      *
-- 
GitLab