summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authortill <till@php.net>2009-01-09 21:13:00 +0000
committertill <till@php.net>2009-01-09 21:13:00 +0000
commitd4847048a18b0f51107a078add14563ecadf4701 (patch)
tree0b0680bee439cc0ce2f55d995655f737bd42fc05 /bin
parent64c52c63ad42301ece004f51c1dc6abc4c84ce97 (diff)
* let's not discriminate unix :) (= generalized paths)
* added checks so all scripts are only executable from CLI
Diffstat (limited to 'bin')
-rw-r--r--bin/dumpschema.php6
-rwxr-xr-xbin/msgexport.sh7
-rwxr-xr-xbin/msgimport.sh7
-rwxr-xr-xbin/update.sh8
4 files changed, 20 insertions, 8 deletions
diff --git a/bin/dumpschema.php b/bin/dumpschema.php
index cbadb00f6..9557c4b15 100644
--- a/bin/dumpschema.php
+++ b/bin/dumpschema.php
@@ -1,6 +1,6 @@
+#!/usr/bin/env php
<?php
/*
- #!/usr/bin/php
+-----------------------------------------------------------------------+
| bin/dumpschema.php |
@@ -20,6 +20,10 @@
*/
+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';
diff --git a/bin/msgexport.sh b/bin/msgexport.sh
index b15da1feb..7dd56e9ea 100755
--- a/bin/msgexport.sh
+++ b/bin/msgexport.sh
@@ -1,5 +1,8 @@
-#!/usr/bin/php
+#!/usr/bin/env php
<?php
+if (php_sapi_name() != 'cli') {
+ die('Not on the "shell" (php-cli).');
+}
define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/' );
ini_set('memory_limit', -1);
@@ -169,4 +172,4 @@ else
vputs("IMAP login failed.\n");
}
-?> \ No newline at end of file
+?>
diff --git a/bin/msgimport.sh b/bin/msgimport.sh
index fa5678cec..a5161e026 100755
--- a/bin/msgimport.sh
+++ b/bin/msgimport.sh
@@ -1,5 +1,8 @@
-#!/usr/bin/php
+#!/usr/bin/env php
<?php
+if (php_sapi_name() != 'cli') {
+ die('Not on the "shell" (php-cli).');
+}
define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/' );
ini_set('memory_limit', -1);
@@ -146,4 +149,4 @@ else
print "IMAP login failed.\n";
}
-?> \ No newline at end of file
+?>
diff --git a/bin/update.sh b/bin/update.sh
index a9a917c8c..c93d92dec 100755
--- a/bin/update.sh
+++ b/bin/update.sh
@@ -1,6 +1,8 @@
-#!/usr/bin/php
+#!/usr/bin/env php
<?php
-
+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';
@@ -112,4 +114,4 @@ else {
echo "\n";
-?> \ No newline at end of file
+?>