Skip to content

Commit

Permalink
- Use clisetup.php where possible, remove redundant code
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpl committed Apr 20, 2011
1 parent 61517ce commit 6cc3f58
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 22 deletions.
7 changes: 2 additions & 5 deletions bin/cleandb.sh
Expand Up @@ -20,12 +20,9 @@
*/ */


if (php_sapi_name() != 'cli') {
die('Not on the "shell" (php-cli).');
}

define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/' ); 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 // mapping for table name => primary key
$primary_keys = array( $primary_keys = array(
Expand Down
7 changes: 2 additions & 5 deletions bin/decrypt.sh
Expand Up @@ -52,12 +52,9 @@
* - you are dealing with counterfeit header data. * - 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__).'/..') . '/'); define('INSTALL_PATH', realpath(dirname(__FILE__).'/..') . '/');
require INSTALL_PATH . 'program/include/iniset.php';
require INSTALL_PATH . 'program/include/clisetup.php';


if ($argc < 2) { if ($argc < 2) {
die("Usage: " . basename($argv[0]) . " encrypted-hdr-part [encrypted-hdr-part ...]\n"); die("Usage: " . basename($argv[0]) . " encrypted-hdr-part [encrypted-hdr-part ...]\n");
Expand Down
7 changes: 2 additions & 5 deletions bin/dumpschema.sh
Expand Up @@ -20,12 +20,9 @@
*/ */


if (php_sapi_name() != 'cli') {
die('Not on the "shell" (php-cli).');
}

define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/' ); 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 **/ /** callback function for schema dump **/
function print_schema($dump) function print_schema($dump)
Expand Down
5 changes: 1 addition & 4 deletions bin/installto.sh
Expand Up @@ -19,12 +19,9 @@
*/ */


if (php_sapi_name() != 'cli') {
die('Not on the "shell" (php-cli).');
}
define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/' ); 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]); $target_dir = unslashify($_SERVER['argv'][1]);


Expand Down
3 changes: 0 additions & 3 deletions bin/update.sh
Expand Up @@ -19,9 +19,6 @@
*/ */


if (php_sapi_name() != 'cli') {
die('Not on the "shell" (php-cli).');
}
define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/' ); define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/' );


require_once INSTALL_PATH . 'program/include/clisetup.php'; require_once INSTALL_PATH . 'program/include/clisetup.php';
Expand Down

0 comments on commit 6cc3f58

Please sign in to comment.