From 155bbb8df6332bc6a9b629f62d1725840f8d89ea Mon Sep 17 00:00:00 2001 From: alecpl Date: Tue, 7 Oct 2008 18:32:56 +0000 Subject: - added bin/killcache.php script (#1485434) - added copyrights disclaimers --- bin/dumpschema.php | 21 +++++++++++++++++++- bin/html2text.php | 19 ++++++++++++++++++ bin/killcache.php | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ bin/modcss.php | 6 +++--- bin/quotaimg.php | 6 +++--- 5 files changed, 101 insertions(+), 7 deletions(-) create mode 100644 bin/killcache.php (limited to 'bin') diff --git a/bin/dumpschema.php b/bin/dumpschema.php index 53c688c3d..9c9c7b81b 100644 --- a/bin/dumpschema.php +++ b/bin/dumpschema.php @@ -1,4 +1,23 @@ | + +-----------------------------------------------------------------------+ + + $Id$ + +*/ define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/' ); require INSTALL_PATH.'program/include/iniset.php'; @@ -44,7 +63,7 @@ else { // 'output_mode' => 'file', 'output' => 'print_schema', ); - + $definition = $schema->getDefinitionFromDatabase(); if (PEAR::isError($definition)) { $error = $definition->getMessage() . ' ' . $definition->getUserInfo(); diff --git a/bin/html2text.php b/bin/html2text.php index 478ccced9..6500d2883 100644 --- a/bin/html2text.php +++ b/bin/html2text.php @@ -1,4 +1,23 @@ | + +-----------------------------------------------------------------------+ + + $Id$ + +*/ define('INSTALL_PATH', realpath('./../') . '/'); require INSTALL_PATH.'program/include/iniset.php'; diff --git a/bin/killcache.php b/bin/killcache.php new file mode 100644 index 000000000..d933f4f2b --- /dev/null +++ b/bin/killcache.php @@ -0,0 +1,56 @@ + | + +-----------------------------------------------------------------------+ + + $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!"); +} + + +$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(); + +?> diff --git a/bin/modcss.php b/bin/modcss.php index e97b8ec9c..fc6305c81 100644 --- a/bin/modcss.php +++ b/bin/modcss.php @@ -2,10 +2,10 @@ /* +-----------------------------------------------------------------------+ - | program/bin/modcss.php | + | bin/modcss.php | | | | This file is part of the RoundCube Webmail client | - | Copyright (C) 2007, RoundCube Dev. - Switzerland | + | Copyright (C) 2007-2008, RoundCube Dev. - Switzerland | | Licensed under the GNU GPL | | | | PURPOSE: | @@ -15,7 +15,7 @@ | Author: Thomas Bruederli | +-----------------------------------------------------------------------+ - $Id: $ + $Id$ */ diff --git a/bin/quotaimg.php b/bin/quotaimg.php index 97c8b8630..ddd9b728a 100644 --- a/bin/quotaimg.php +++ b/bin/quotaimg.php @@ -1,10 +1,10 @@ | +-----------------------------------------------------------------------+ - $Id: $ + $Id$ */ -- cgit v1.2.3