summaryrefslogtreecommitdiff
path: root/roundcubemail/bin/killcache.php
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-05-18 10:25:29 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-05-18 10:25:29 +0000
commitb065ddd7ed6a888e3d34f138a766ffdfd55ecb4d (patch)
treef26c5a9b53edefa72cf7c13d1ba460b520d13f66 /roundcubemail/bin/killcache.php
parent6fb230ba8217450733ef7f1aa69b9c0f855666d7 (diff)
- Some files from /bin + spellchecking actions moved to the new 'utils' task
git-svn-id: https://svn.roundcube.net/trunk@3627 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/bin/killcache.php')
-rw-r--r--roundcubemail/bin/killcache.php65
1 files changed, 0 insertions, 65 deletions
diff --git a/roundcubemail/bin/killcache.php b/roundcubemail/bin/killcache.php
deleted file mode 100644
index 7bce676fb..000000000
--- a/roundcubemail/bin/killcache.php
+++ /dev/null
@@ -1,65 +0,0 @@
-<?php
-/*
-
- +-----------------------------------------------------------------------+
- | bin/killcache.php |
- | |
- | This file is part of the RoundCube Webmail client |
- | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
- | Licensed under the GNU GPL |
- | |
- | PURPOSE: |
- | Delete rows from cache and messages tables |
- | |
- +-----------------------------------------------------------------------+
- | Author: Dennis P. Nikolaenko <dennis@nikolaenko.ru> |
- +-----------------------------------------------------------------------+
-
- $Id$
-
-*/
-
-define('INSTALL_PATH', realpath(dirname(__FILE__).'/..') . '/');
-require INSTALL_PATH . 'program/include/iniset.php';
-
-$config = new rcube_config();
-
-// don't allow public access if not in devel_mode
-if (!$config->get('devel_mode') && $_SERVER['REMOTE_ADDR']) {
- header("HTTP/1.0 401 Access denied");
- die("Access denied!");
-}
-
-$options = array(
- 'use_transactions' => false,
- 'log_line_break' => "\n",
- 'idxname_format' => '%s',
- 'debug' => false,
- 'quote_identifier' => true,
- 'force_defaults' => false,
- 'portability' => true
-);
-
-$dbh = MDB2::factory($config->get('db_dsnw'), $options);
-if (PEAR::isError($dbh)) {
- exit($mdb2->getMessage());
-}
-
-//TODO: transaction here (if supported by DB) would be a good thing
-$res =& $dbh->exec("DELETE FROM cache");
-if (PEAR::isError($res)) {
- $dbh->disconnect();
- exit($res->getMessage());
-}
-
-$res =& $dbh->exec("DELETE FROM messages");
-if (PEAR::isError($res)) {
- $dbh->disconnect();
- exit($res->getMessage());
-}
-
-echo "Cache cleared\n";
-
-$dbh->disconnect();
-
-?>