Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:24115 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12681 invoked by uid 1010); 13 Jun 2006 17:00:38 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 12665 invoked from network); 13 Jun 2006 17:00:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Jun 2006 17:00:38 -0000 X-PHP-List-Original-Sender: steph@zend.com X-Host-Fingerprint: 192.38.9.232 gw2.emini.dk Linux 2.4/2.6 Received: from ([192.38.9.232:7200] helo=gw2.emini.dk) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id A0/A6-00253-33FEE844 for ; Tue, 13 Jun 2006 13:00:36 -0400 Received: from foxbox (IGLD-84-229-192-204.inter.net.il [84.229.192.204]) by gw2.emini.dk (Postfix) with ESMTP id 55931B6316; Tue, 13 Jun 2006 19:00:31 +0200 (CEST) Message-ID: <20f901c68f0a$7aa386e0$6602a8c0@foxbox> Reply-To: "Steph Fox" To: "Michael B Allen" Cc: , References: <20060610143446.7d8f1919.mba2000@ioplex.com><7.0.1.0.2.20060612203355.03d5ad80@zend.com><1fc501c68e9b$cf98cad0$6602a8c0@foxbox> <20060613030823.6957782e.mba2000@ioplex.com> Date: Tue, 13 Jun 2006 18:57:36 +0200 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_20F6_01C68F1B.3C607080" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Subject: Re: [PHP-DEV] Mod Deinit Not Called if Bad Cmdline Option [PATCH] From: steph@zend.com ("Steph Fox") ------=_NextPart_000_20F6_01C68F1B.3C607080 Content-Type: text/plain; format=flowed; charset="Windows-1252"; reply-type=original Content-Transfer-Encoding: 7bit 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 > > 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 > > ------=_NextPart_000_20F6_01C68F1B.3C607080 Content-Type: text/plain; format=flowed; name="CLI_fix.txt"; reply-type=original Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="CLI_fix.txt" Index: sapi/cli/php_cli.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /repository/php-src/sapi/cli/php_cli.c,v=0A= retrieving revision 1.129.2.13.2.3=0A= diff -u -r1.129.2.13.2.3 php_cli.c=0A= --- sapi/cli/php_cli.c 3 Jun 2006 22:02:02 -0000 1.129.2.13.2.3=0A= +++ sapi/cli/php_cli.c 13 Jun 2006 16:21:00 -0000=0A= @@ -639,7 +639,14 @@=0A= =0A= while ((c =3D php_getopt(argc, argv, OPTIONS, &php_optarg, = &php_optind, 0))!=3D-1) {=0A= switch (c) {=0A= + case 'r':=0A= + break;=0A= case 'c':=0A= + if (!script_file) {=0A= + printf("You need to give the path to php.ini after -c.\n");=0A= + exit_status =3D 1;=0A= + goto out_err;=0A= + }=0A= cli_sapi_module.php_ini_path_override =3D strdup(php_optarg);=0A= break;=0A= case 'n':=0A= ------=_NextPart_000_20F6_01C68F1B.3C607080--