summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-04-20 13:10:45 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-04-20 13:10:45 +0000
commitf511cf2acaa930100b121d70831fc6bd8d8cd699 (patch)
treea86087f3b10adceb4f78aeb0bcd0096157a14dcc
parent59d664c96d744dd56d9c9e32a796c0e7f756f31f (diff)
- Use clisetup.php where possible, remove redundant code
git-svn-id: https://svn.roundcube.net/trunk@4677 208e9e7b-5314-0410-a742-e7e81cd9613c
-rwxr-xr-xroundcubemail/bin/cleandb.sh7
-rwxr-xr-xroundcubemail/bin/decrypt.sh7
-rwxr-xr-xroundcubemail/bin/dumpschema.sh7
-rwxr-xr-xroundcubemail/bin/installto.sh5
-rwxr-xr-xroundcubemail/bin/update.sh3
5 files changed, 7 insertions, 22 deletions
diff --git a/roundcubemail/bin/cleandb.sh b/roundcubemail/bin/cleandb.sh
index 98f52d0cf..978b17dfa 100755
--- a/roundcubemail/bin/cleandb.sh
+++ b/roundcubemail/bin/cleandb.sh
@@ -20,12 +20,9 @@
*/
-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(
diff --git a/roundcubemail/bin/decrypt.sh b/roundcubemail/bin/decrypt.sh
index e19da82c3..c1ddd1cf2 100755
--- a/roundcubemail/bin/decrypt.sh
+++ b/roundcubemail/bin/decrypt.sh
@@ -52,12 +52,9 @@
* - you are dealing with counterfeit header data.
*/
-if (php_sapi_name() != 'cli') {
- die("Not on the 'shell' (php-cli).\n");
-}
-
define('INSTALL_PATH', realpath(dirname(__FILE__).'/..') . '/');
-require INSTALL_PATH . 'program/include/iniset.php';
+
+require INSTALL_PATH . 'program/include/clisetup.php';
if ($argc < 2) {
die("Usage: " . basename($argv[0]) . " encrypted-hdr-part [encrypted-hdr-part ...]\n");
diff --git a/roundcubemail/bin/dumpschema.sh b/roundcubemail/bin/dumpschema.sh
index 2f323ea1c..da1dffa72 100755
--- a/roundcubemail/bin/dumpschema.sh
+++ b/roundcubemail/bin/dumpschema.sh
@@ -20,12 +20,9 @@
*/
-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';
/** callback function for schema dump **/
function print_schema($dump)
diff --git a/roundcubemail/bin/installto.sh b/roundcubemail/bin/installto.sh
index f953419ce..b1e2956a1 100755
--- a/roundcubemail/bin/installto.sh
+++ b/roundcubemail/bin/installto.sh
@@ -19,12 +19,9 @@
*/
-if (php_sapi_name() != 'cli') {
- die('Not on the "shell" (php-cli).');
-}
define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/' );
-require_once INSTALL_PATH . 'program/include/iniset.php';
+require_once INSTALL_PATH . 'program/include/clisetup.php';
$target_dir = unslashify($_SERVER['argv'][1]);
diff --git a/roundcubemail/bin/update.sh b/roundcubemail/bin/update.sh
index 094e5b72b..9f91c8ecd 100755
--- a/roundcubemail/bin/update.sh
+++ b/roundcubemail/bin/update.sh
@@ -19,9 +19,6 @@
*/
-if (php_sapi_name() != 'cli') {
- die('Not on the "shell" (php-cli).');
-}
define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/' );
require_once INSTALL_PATH . 'program/include/clisetup.php';