From 0de85497ada04a9cb952d727e4cc4f657fc0e6b9 Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Tue, 6 Jul 2010 18:18:11 +0200 Subject: [PATCH] Bail out if caching is disabled, use 0 for exit, set better hashbang. --- imp/scripts/query-imap-cache.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/imp/scripts/query-imap-cache.php b/imp/scripts/query-imap-cache.php index bd784121b..d9b419d20 100755 --- a/imp/scripts/query-imap-cache.php +++ b/imp/scripts/query-imap-cache.php @@ -1,4 +1,4 @@ -#!@php_bin@ +#!/bin/env php cache) { $cli->fatal('Caching not setup for this server.'); } else { $driver = $ob->getParam('cache'); + if (!isset($driver['cacheob'])) { + $cli->message('Caching has been disabled for this server.', 'cli.error'); + exit; + } $cli->message('Cache driver used: ' . get_class($driver['cacheob'])); } @@ -115,7 +119,7 @@ $opts = array( 6 => 'Expire All Mailboxes', 7 => 'Expire Mailbox', 8 => 'Expire specific UIDs', - 9 => 'Exit' + 0 => 'Exit' ); while (true) { @@ -123,6 +127,9 @@ while (true) { $action = $cli->prompt('Action:', $opts); switch ($action) { + case 0: + exit; + case 1: $mbox_list = array(); $msg_cnt = $search_cnt = 0; @@ -290,8 +297,5 @@ while (true) { $cli->message('Failed deleting UIDs. Error: ' . $e->getMessage(), 'cli.error'); } break; - - case 9: - exit; } } -- 2.11.0