cvs: /php4 ChangeLog cgi_main.c
| From: | Zeev Suraski | Date: | Sat, 28 Aug 1999 23:06:08 +0000 |
| Subject: | cvs: /php4 ChangeLog cgi_main.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-3822@lists.php.net to get a copy of this message | ||
zeev Sat Aug 28 19:06:08 1999 EDT
Modified files:
/php4 ChangeLog cgi_main.c
Log:
Add -d switch
Index: php4/ChangeLog
diff -u php4/ChangeLog:1.73 php4/ChangeLog:1.74
--- php4/ChangeLog:1.73 Sat Aug 28 06:31:54 1999
+++ php4/ChangeLog Sat Aug 28 19:06:07 1999
@@ -2,6 +2,8 @@
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ?? 1999, Version 4.0 Beta 3
+- Added -d switch to the CGI binary that allows overriding php.ini values
+ from the command line (Zeev)
- Fixed a crash that would occur if wddx_deserialize did not receive
a valid packet (Andrey)
- Fixed a bugglet when redefining a class at run-time (Andi, Zend library)
@@ -11,7 +13,7 @@
- Fixed bug in ISAPI header sending function (Charles)
- Fixed memory leak when using undefined values (Andi & Zeev, Zend library)
- Added output_buffering directive to php.ini, to enable output buffering
- for all PHP scripts (default is off).
+ for all PHP scripts - default is off (Zeev).
- Fixed some more class inheritance issues (Zeev, Zend library)
- Fixed Apache build wrt to shared modules on FreeBSD/Linux (Sascha)
- Added session.extern_referer_chk which checks whether session ids were
Index: php4/cgi_main.c
diff -u php4/cgi_main.c:1.25 php4/cgi_main.c:1.26
--- php4/cgi_main.c:1.25 Mon Aug 2 15:16:34 1999
+++ php4/cgi_main.c Sat Aug 28 19:06:07 1999
@@ -162,17 +162,18 @@
" [-s]"
" [-v] [-i] [-f <file>] | "
"{<file> [args...]}\n"
- " -q Quiet-mode. Suppress HTTP Header output.\n"
- " -s Display colour syntax highlighted source.\n"
- " -f<file> Parse <file>. Implies `-q'\n"
- " -v Version number\n"
- " -c<path> Look for php.ini file in this directory\n"
+ " -q Quiet-mode. Suppress HTTP Header output.\n"
+ " -s Display colour syntax highlighted source.\n"
+ " -f<file> Parse <file>. Implies `-q'\n"
+ " -v Version number\n"
+ " -c<path> Look for php.ini file in this directory\n"
#if SUPPORT_INTERACTIVE
- " -a Run interactively\n"
+ " -a Run interactively\n"
#endif
- " -e Generate extended information for debugger/profiler\n"
- " -i PHP information\n"
- " -h This help\n", prog);
+ " -d foo[=bar] Define INI entry foo with value 'bar'\n"
+ " -e Generate extended information for debugger/profiler\n"
+ " -i PHP information\n"
+ " -h This help\n", prog);
}
@@ -193,6 +194,22 @@
}
+void define_command_line_ini_entry(char *arg)
+{
+ char *name, *value;
+
+ name = arg;
+ value = strchr(arg, '=');
+ if (value) {
+ *value = 0;
+ value++;
+ } else {
+ value = "1";
+ }
+ php_alter_ini_entry(name, strlen(name), value, strlen(value), PHP_INI_SYSTEM);
+}
+
+
int main(int argc, char *argv[])
{
int cgi = 0, c, i, len;
@@ -288,7 +305,7 @@
if (!cgi) { /* never execute the arguments if you are a CGI */
request_info.php_argv0 = NULL;
- while ((c = getopt(argc, argv, "c:qvisnaeh?vf:")) != -1) {
+ while ((c = getopt(argc, argv, "cd:qvisnaeh?vf:")) != -1) {
switch (c) {
case 'f':
if (!cgi_started){
@@ -360,6 +377,9 @@
SG(headers_sent) = 1;
php_cgi_usage(argv[0]);
exit(1);
+ break;
+ case 'd':
+ define_command_line_ini_entry(optarg);
break;
default:
break;