summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>1999-12-27 21:21:26 +0000
committerZeev Suraski <zeev@php.net>1999-12-27 21:21:26 +0000
commitb640c27a08ab24c20cb5942a396aacd73e7f8cb9 (patch)
tree9ccc9fca6af07e2ac925d2b6d8e78a1945da57d4
parentc34a062f5c4784e1b5c226dc050aa227539a886d (diff)
downloadphp-git-b640c27a08ab24c20cb5942a396aacd73e7f8cb9.tar.gz
@- Fixed -c support in the standalone CGI binary (Zeev)
Fixed -c support in the standalone CGI binary (Zeev)
-rw-r--r--sapi/cgi/cgi_main.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 99ba4858b7..264549e5ca 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -214,6 +214,8 @@ int main(int argc, char *argv[])
int behavior=PHP_MODE_STANDARD;
int no_headers=0;
int free_path_translated=0;
+ int orig_optind=optind;
+ char *orig_optarg=optarg;
#if SUPPORT_INTERACTIVE
int interactive=0;
#endif
@@ -280,6 +282,19 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine
#endif /* FORCE_CGI_REDIRECT */
}
+ if (!cgi) {
+ while ((c=getopt(argc, argv, "c:d:qvisnaeh?vf:"))!=-1) {
+ switch (c) {
+ case 'c':
+ php_ini_path = strdup(optarg); /* intentional leak */
+ break;
+ }
+ }
+ optind = orig_optind;
+ optarg = orig_optarg;
+ }
+
+
if (php_module_startup(&sapi_module)==FAILURE) {
return FAILURE;
}
@@ -351,9 +366,6 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine
case 'n':
behavior=PHP_MODE_INDENT;
break;
- case 'c':
- php_ini_path = strdup(optarg); /* intentional leak */
- break;
case 'a':
#if SUPPORT_INTERACTIVE
printf("Interactive mode enabled\n\n");