public function updateDatabaseAction()
    {
        // Check if a console is used.
        $request = $this->getRequest();
        if (!$request instanceof ConsoleRequest) {
            throw new \Zend\Console\Exception\RuntimeException('You can only access this function through a console');
        }
        // Gather the variables.
        /* @var $mode string */
        if ((bool) $request->getParam('help', false) || $request->getParam('h', false)) {
            $mode = 'help';
        } else {
            $mode = $request->getParam('clean-install', false) ? 'clean-install' : false;
            if (!$mode) {
                $mode = $request->getParam('update', false) ? 'update' : false;
            }
            if (!$mode) {
                $mode = 'help';
            }
        }
        /* @var $verbose boolean */
        $verbose = (bool) $request->getParam('verbose', false) || $request->getParam('v', false);

        /* @var $result string */
        $result = '';
        if ($verbose) {
            print_r('Processing mode: ');
            print_r($mode . "\n");
        }
        // Test the mode.
        switch ($mode) {
            case 'clean-install':
                $email = $request->getParam('email', null);
                if (!$email) {
                    throw new \Zend\Console\Exception\RuntimeException('No e-mail parameter was received.');
                }
                $result = $this->getService()->installDatabase($email, $verbose);
                break;
            case 'update':
                $result = $this->getService()->updateDatabase($verbose);
                break;
            case 'help':
                $result = $this->getHelpOutput();
                break;
        }
        return $result;
    }