Re: [PHP-DEV] Better shell scripting

2001-09-07 Thread Stig Sæther Bakken

What if we introduced a -p option to PHP that starts the Zend parser
in PHP mode?  For any other files (include/require), it starts in
HTML mode though.

 - Stig

[[EMAIL PROTECTED]]
 Yeah, I agree. However, it might make things a bit muddled
 for people using it as cgi? How would PHP tell if the following
 was PHP code or if its supposed to be echoed to the web browser?
 
 I would rather see a -shell option which does what you describe.
 
 Mike (long-time listener, first-time poster ;)
 
  Original Message 
 
 On 9/7/01, 11:27:30 AM, Edin Kadribasic wrote 
 regarding Re: [PHP-DEV] patch to make for better shell scripting:
 
 
  Almost forgot. IMO -q swich should make starting ?php optional so 
 instead
  of writing:
 
  #!/usr/bin/php -q
  ?php
  print Hello, world!\n;
  ?
 
  I could simply say:
 
  #!/usr/bin/php -q
  print Hello, world!\n;
 
 
 
  Edin
 
 
  --
  PHP Development Mailing List http://www.php.net/
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
 
 -- 
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
  Stig Sæther Bakken [EMAIL PROTECTED]
  Fast Search  Transfer ASA, Trondheim, Norway

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Better shell scripting

2001-09-07 Thread Zeev Suraski

At 17:51 07-09-01, Boian Bonev wrote:
+1 :))

and a

#!/bin/php -p
echo some string here\n;
?some html here ;)))
? echo 'some more php';?

although this requires a patch in Zend/zend_language_scanner.l line 279 :)))
for plain c, and i didn't look where for c++.

We no longer have a C++ scanner.

Zeev


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Better shell scripting

2001-09-07 Thread Andrei Zmievski

On Fri, 07 Sep 2001, Stig Sæther Bakken wrote:
 What if we introduced a -p option to PHP that starts the Zend parser
 in PHP mode?  For any other files (include/require), it starts in
 HTML mode though.

How about we have a separate sapi backend that really does all this
stuff properly without relying on command-line options (which I hate)?
This suggestion has been made long ago, so what's stopping us?

-Andrei

Everything should be made as simple
as possible, but not simpler.
  -- Albert Einstein

--
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Better shell scripting

2001-09-07 Thread Boian Bonev

i can see just one reason - most people use the same php binary both for cgi
and shell scripting. if this change is to be introduced in php then at least
three builds will be performed - for shell, cgi and web server module. btw
what happened with the change to the build system to allow simultaneous
building of both cgi-sapi and another one?

b.

- Original Message -
From: Andrei Zmievski [EMAIL PROTECTED]
To: Stig Sæther Bakken [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, September 07, 2001 6:00 PM
Subject: Re: [PHP-DEV] Better shell scripting


On Fri, 07 Sep 2001, Stig Sæther Bakken wrote:
 What if we introduced a -p option to PHP that starts the Zend parser
 in PHP mode?  For any other files (include/require), it starts in
 HTML mode though.

How about we have a separate sapi backend that really does all this
stuff properly without relying on command-line options (which I hate)?
This suggestion has been made long ago, so what's stopping us?

-Andrei

Everything should be made as simple
as possible, but not simpler.
  -- Albert Einstein

--
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Better shell scripting

2001-09-07 Thread Brian Moon

All the -S option does now is call zend functions to set up runtime
settings.  This would just be another function to call.

I would think that include would use the current method.

Also, is it possible to make PHP ignore an opening tag if it is there?  If
not then I don't like this idea because it breaks all my code that I want
the -S option for.

Brian Moon
--
dealnews.com, Inc.
Makers of dealnews  dealmac
http://dealnews.com/ | http://dealmac.com/


- Original Message -
From: Boian Bonev [EMAIL PROTECTED]
To: Brian Moon [EMAIL PROTECTED]; [EMAIL PROTECTED]; Stig
Sæther Bakken [EMAIL PROTECTED]; Zeev Suraski [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, September 07, 2001 10:11 AM
Subject: Re: [PHP-DEV] Better shell scripting


 sure it will be ok. but this is change in zend, not php.

 to make this working zend people must export a
call/option/global/something
 to change the flex scanner initial state.

 and a question of design - shall this be a permanent or first execute
 change? i mean if a script run with -S includes another php script, then
 what shall be the initial state for the included script?

 to Zeev: then why not remove 1/3 of the code ifdefed __cpluplus?

 b.
 - Original Message -
 From: Brian Moon [EMAIL PROTECTED]
 To: Boian Bonev [EMAIL PROTECTED]; [EMAIL PROTECTED]; Stig
 Sæther Bakken [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Friday, September 07, 2001 5:41 PM
 Subject: Re: [PHP-DEV] Better shell scripting


  We could make this part of the -S option that I have just submitted a
 patch
  for.
 
  Brian Moon
  --
  dealnews.com, Inc.
  Makers of dealnews  dealmac
  http://dealnews.com/ | http://dealmac.com/
 
 
  - Original Message -
  From: Boian Bonev [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]; Stig Sæther Bakken
 [EMAIL PROTECTED]
  Cc: [EMAIL PROTECTED]
  Sent: Friday, September 07, 2001 9:51 AM
  Subject: Re: [PHP-DEV] Better shell scripting
 
 
   +1 :))
  
   and a
  
   #!/bin/php -p
   echo some string here\n;
   ?some html here ;)))
   ? echo 'some more php';?
  
   although this requires a patch in Zend/zend_language_scanner.l line
279
  :)))
   for plain c, and i didn't look where for c++.
  
   b.
   - Original Message -
   From: Stig Sæther Bakken [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   Cc: [EMAIL PROTECTED]
   Sent: Friday, September 07, 2001 12:28 PM
   Subject: Re: [PHP-DEV] Better shell scripting
  
  
What if we introduced a -p option to PHP that starts the Zend parser
in PHP mode?  For any other files (include/require), it starts in
HTML mode though.
   
 - Stig
   
[[EMAIL PROTECTED]]
 Yeah, I agree. However, it might make things a bit muddled
 for people using it as cgi? How would PHP tell if the following
 was PHP code or if its supposed to be echoed to the web browser?

 I would rather see a -shell option which does what you describe.

 Mike (long-time listener, first-time poster ;)

  Original Message 

 On 9/7/01, 11:27:30 AM, Edin Kadribasic wrote
 regarding Re: [PHP-DEV] patch to make for better shell scripting:


  Almost forgot. IMO -q swich should make starting ?php optional
so
 instead
  of writing:

  #!/usr/bin/php -q
  ?php
  print Hello, world!\n;
  ?

  I could simply say:

  #!/usr/bin/php -q
  print Hello, world!\n;



  Edin


  --
  PHP Development Mailing List http://www.php.net/
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail:
   [EMAIL PROTECTED]



 --
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail:
  [EMAIL PROTECTED]
   
--
  Stig Sæther Bakken [EMAIL PROTECTED]
  Fast Search  Transfer ASA, Trondheim, Norway
   
--
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail:
 [EMAIL PROTECTED]
   
   
  
  
   --
   PHP Development Mailing List http://www.php.net/
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   To contact the list administrators, e-mail:
[EMAIL PROTECTED]
  
  
  
 
 
  --
  PHP Development Mailing List http://www.php.net/
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 





-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list

Re: [PHP-DEV] Better shell scripting

2001-09-07 Thread Andrei Zmievski

On Fri, 07 Sep 2001, Boian Bonev wrote:
 i can see just one reason - most people use the same php binary both for cgi
 and shell scripting. if this change is to be introduced in php then at least
 three builds will be performed - for shell, cgi and web server module. btw
 what happened with the change to the build system to allow simultaneous
 building of both cgi-sapi and another one?

Why would you build all 3? It seems to me that at most only 2 would be
built: web-server + shell, or cgi + shell.

-Andrei
* Marriage is not a word. It's a sentence. Life-long sentence. *

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]