| | |
| | | +-----------------------------------------------------------------------+ |
| | | | bin/cleandb.sh | |
| | | | | |
| | | | This file is part of the RoundCube Webmail client | |
| | | | Copyright (C) 2010, RoundCube Dev. - Switzerland | |
| | | | This file is part of the Roundcube Webmail client | |
| | | | Copyright (C) 2010, The Roundcube Dev Team | |
| | | | Licensed under the GNU GPL | |
| | | | | |
| | | | PURPOSE: | |
| | |
| | | |
| | | */ |
| | | |
| | | if (php_sapi_name() != 'cli') { |
| | | die('Not on the "shell" (php-cli).'); |
| | | } |
| | | |
| | | define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/' ); |
| | | require INSTALL_PATH.'program/include/iniset.php'; |
| | | |
| | | require INSTALL_PATH.'program/include/clisetup.php'; |
| | | |
| | | // mapping for table name => primary key |
| | | $primary_keys = array( |
| | |
| | | // connect to DB |
| | | $RCMAIL = rcmail::get_instance(); |
| | | $db = $RCMAIL->get_dbh(); |
| | | $db->db_connect('w'); |
| | | |
| | | if (!$db->is_connected() || $db->is_error) |
| | | die("No DB connection"); |
| | | if (!$db->is_connected() || $db->is_error()) |
| | | die("No DB connection\n"); |
| | | |
| | | if (!empty($_SERVER['argv'][1])) |
| | | $days = intval($_SERVER['argv'][1]); |