Console command to test for database connectivity

XMLWordPrintable

      The PE container image needs a command/script that the container entrypoint script can run to determine if the database configuration is good and the database is up and ready to receive connections.

      In the version 4.x image the entrypoint script creates a Console command on the fly that has contents

      App::import('Model', 'ConnectionManager');
       
      class DatabaseTestShell extends AppShell {
        function main() {
          try {
            $db = ConnectionManager::getDataSource('default');
          } catch (Exception $e) {
            $this->error("Unable to connect to datasource");
          }
          $this->out("Connected to datasource");
        }
      } 

      We need something similar for PE. Preferably it would be part of the application and not need to be generated on the fly.

            Assignee:
            Benn Oshrin (internet2.edu)
            Reporter:
            Scott Koranda
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: