Hi Michael,

Actually it's not true either... what made you think that, Michael? Care to
describe what you're seeing?

Consider the following php script:

 #!/usr/bin/php -q -c foo
 <?php ...

Apparently -c is a bad option because the script just prints usage and
exits. Now, I have an extension that writes a message to a log file when
it initializes and when it deinitializes. When the said script runs the
initialization message is logged. When the script runs normally (no bad
option) the deinitialization message is logged. When the script exits
prematurely due to a bad command option, the deinitialization routine
is not logged. This leads me to believe the deinitialization routine is
not running.

Perhaps it is or perhaps the script is being killed.

No, the script is reached OK - it's just that Zend thinks your php.ini filepath is 'foo' as well as your file, so it hangs when it's trying to work with them both :) You're supposed to put a path after the -c switch... but PHP really shouldn't hang when you don't.

Patch for CLI sapi (5_2 branch) attached, if someone'd like to check it for misdemeanours/apply it?

- Steph


Mike

--
Michael B Allen
PHP Extension for SSO w/ Windows Group Authorization
http://www.ioplex.com/

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php


__________ NOD32 1.1380 (20060125) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com


Index: sapi/cli/php_cli.c
===================================================================
RCS file: /repository/php-src/sapi/cli/php_cli.c,v
retrieving revision 1.129.2.13.2.3
diff -u -r1.129.2.13.2.3 php_cli.c
--- sapi/cli/php_cli.c  3 Jun 2006 22:02:02 -0000       1.129.2.13.2.3
+++ sapi/cli/php_cli.c  13 Jun 2006 16:21:00 -0000
@@ -639,7 +639,14 @@

        while ((c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 
0))!=-1) {
                switch (c) {
+               case 'r':
+                       break;
                case 'c':
+                       if (!script_file) {
+                               printf("You need to give the path to php.ini after 
-c.\n");
+                               exit_status = 1;
+                               goto out_err;
+                       }
                        cli_sapi_module.php_ini_path_override = 
strdup(php_optarg);
                        break;
                case 'n':

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to