Re: [PHP-DEV] Returning a string from an executed script?

2001-08-29 Thread Rasmus Lerdorf

> >That would work perfectly.  Think this could be done sooner rather than
> >later?  ie. in the current engine?
>
> Yup, it should be doable.  I added it to my TODO.

Thanks


-- 
PHP Development Mailing List 
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] Returning a string from an executed script?

2001-08-29 Thread Zeev Suraski

At 19:01 29-08-01, Rasmus Lerdorf wrote:
> > We could improve zend_execute_scripts() to take an optional zval * to hold
> > the return value, it's already quite ready for this kind of thing.
>
>That would work perfectly.  Think this could be done sooner rather than
>later?  ie. in the current engine?

Yup, it should be doable.  I added it to my TODO.

Zeev


-- 
PHP Development Mailing List 
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] Returning a string from an executed script?

2001-08-29 Thread Rasmus Lerdorf

> We could improve zend_execute_scripts() to take an optional zval * to hold
> the return value, it's already quite ready for this kind of thing.

That would work perfectly.  Think this could be done sooner rather than
later?  ie. in the current engine?  It shouldn't affect anything else, and
it would let us write nice and clean handlers for all the request_rec
phases.

-Rasmus


-- 
PHP Development Mailing List 
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] Returning a string from an executed script?

2001-08-29 Thread Andrei Zmievski

On Wed, 29 Aug 2001, Zeev Suraski wrote:
> We could improve zend_execute_scripts() to take an optional zval * to hold 
> the return value, it's already quite ready for this kind of thing.

Good idea.

-Andrei
* If it's never finished, you can't prove it doesn't work. *

-- 
PHP Development Mailing List 
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] Returning a string from an executed script?

2001-08-29 Thread Zeev Suraski

We could improve zend_execute_scripts() to take an optional zval * to hold 
the return value, it's already quite ready for this kind of thing.

At 10:00 29-08-01, Rasmus Lerdorf wrote:
>Mostly a Zend question I guess, but I am playing with having PHP handle
>other phases of the Apache request_rec and currently have working code
>that lets a PHP script get run during the uri translation hook.  This is a
>nice one to start with because it can really open up some cool things that
>can otherwise only be done through an ErrorDocument handler, and even then
>you are somewhat limited in what you can do there.
>
>What I am not sure of is how to communicate the new translated uri back to
>the calling handler function in mod_php4.c.  Right now I have:
>
>php_admin_value uri_handler /full/path/uri.php
>
>And I have some code that takes that uri_handler script filename and
>trickles it down to a call to:
>
>   zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, 1, primary_file);
>
>Where primary_file is:
>
> primary_file.type = ZEND_HANDLE_FILENAME;
> primary_file.handle.fd = 0;
> primary_file.filename = uri_handler;
> primary_file.opened_path = NULL;
> primary_file.free_filename = 0;
>
>That all seems to work fine and the PHP executes at the required stage
>during the request handling.  But what should uri.php look like?
>I think something like this would be nice:
>
>  return '/foo'.$REQUEST_URI;
>   ?>
>
>Obviously a simple handler, but it would take a request like
>http://php.net/blah.php and actually cause http://php.net/foo/blah.php to
>be opened up during the content parsing request_rec phase.
>
>I don't see a way to currently do such a return and get at the returned
>value after the call to zend_execute_scripts().  Any suggestions?
>
>-Rasmus
>
>
>--
>PHP Development Mailing List 
>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 
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] Returning a string from an executed script?

2001-08-29 Thread Rasmus Lerdorf

> > I don't see a way to currently do such a return and get at the returned
> > value after the call to zend_execute_scripts().  Any suggestions?
>
> Print a header and catch it from the Apache module, or use
> apache_note()?

Yeah, I considered apache_note() but it seemed a rather roundabout
approach.  The header is even more obscure.

I think being able to call an execute_script() function and pass it the
address of a char * to stick the return value in would be nice.

-Rasmus


-- 
PHP Development Mailing List 
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] Returning a string from an executed script?

2001-08-29 Thread Stig Sæther Bakken

[Rasmus Lerdorf <[EMAIL PROTECTED]>]
> Mostly a Zend question I guess, but I am playing with having PHP handle
> other phases of the Apache request_rec and currently have working code
> that lets a PHP script get run during the uri translation hook.  This is a
> nice one to start with because it can really open up some cool things that
> can otherwise only be done through an ErrorDocument handler, and even then
> you are somewhat limited in what you can do there.
> 
> What I am not sure of is how to communicate the new translated uri back to
> the calling handler function in mod_php4.c.  Right now I have:
> 
> php_admin_value uri_handler /full/path/uri.php
> 
> And I have some code that takes that uri_handler script filename and
> trickles it down to a call to:
> 
>   zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, 1, primary_file);
> 
> Where primary_file is:
> 
> primary_file.type = ZEND_HANDLE_FILENAME;
> primary_file.handle.fd = 0;
> primary_file.filename = uri_handler;
> primary_file.opened_path = NULL;
> primary_file.free_filename = 0;
> 
> That all seems to work fine and the PHP executes at the required stage
> during the request handling.  But what should uri.php look like?
> I think something like this would be nice:
> 
>  return '/foo'.$REQUEST_URI;
>   ?>
> 
> Obviously a simple handler, but it would take a request like
> http://php.net/blah.php and actually cause http://php.net/foo/blah.php to
> be opened up during the content parsing request_rec phase.
> 
> I don't see a way to currently do such a return and get at the returned
> value after the call to zend_execute_scripts().  Any suggestions?

Print a header and catch it from the Apache module, or use
apache_note()?

 - Stig

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

-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]