Permalink
Browse files

- Use clisetup.php where possible, remove redundant code

  • Loading branch information...
1 parent 61517ce commit 6cc3f5887d7af3ad3b505a6f0fa62752314be1fe @alecpl alecpl committed Apr 20, 2011
Showing with 7 additions and 22 deletions.
  1. +2 −5 bin/cleandb.sh
  2. +2 −5 bin/decrypt.sh
  3. +2 −5 bin/dumpschema.sh
  4. +1 −4 bin/installto.sh
  5. +0 −3 bin/update.sh
View
@@ -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(
View
@@ -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");
View
@@ -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)
View
@@ -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]);
View
@@ -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';

0 comments on commit 6cc3f58

Please sign in to comment.