Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » PHP
  • » [PHP-DEV] RE: [PATCH] adding stream wrappers to include_path [RSS Feed]

#1 March 13, 2008 12:12:42

Pierre J.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] RE: [PATCH] adding stream wrappers to include_path


On Thu, Mar 13, 2008 at 11:55 AM, Dmitry Stogov <> wrote:
> Hi Greg,
>
> In general include_path cannot contain pathes with ':' character,
> because it is the POSIX path separator.
> So I don't see a way to use stream wrappers in include_path. :(

What's about quotes or escape? Quotes are somehow more readable and
are already used in many places (generally not specifically in PHP). I
can imagine a:

set_include_path('"foo://something/bar"' . PATH_SEPARATOR . get_incude_path());

It may add some complexity in the parser but it can be really useful
(well, for phar-like applications at least as I would not recommend
too use that in normal apps :).

Cheers,
--
Pierrehttp://blog.thepimp.net|http://www.libgd.org--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#2 March 13, 2008 12:25:35

Dmitry S.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] RE: [PATCH] adding stream wrappers to include_path


It is too difficult for extension that is not in the core distribution
yet.
For now I think it is simple to override zend_stream_open_function() and
zend_resolve_path_function() callbacks by ext/phar and provide something
like phar.include_path directive.

Thanks. Dmitry.

> -----Original Message-----
> From: Pierre Joye
> Sent: Thursday, March 13, 2008 2:12 PM
> To: Dmitry Stogov
> Cc: Gregory Beaver; internals Mailing List
> Subject: Re: RE: adding stream wrappers to
> include_path
>
>
> On Thu, Mar 13, 2008 at 11:55 AM, Dmitry Stogov
> <> wrote:
> > Hi Greg,
> >
> > In general include_path cannot contain pathes with ':' character,
> > because it is the POSIX path separator. So I don't see a
> way to use
> > stream wrappers in include_path. :(
>
> What's about quotes or escape? Quotes are somehow more
> readable and are already used in many places (generally not
> specifically in PHP). I can imagine a:
>
> set_include_path('"foo://something/bar"' . PATH_SEPARATOR .
> get_incude_path());
>
> It may add some complexity in the parser but it can be really
> useful (well, for phar-like applications at least as I would
> not recommend too use that in normal apps :).
>
> Cheers,
> --
> Pierre
>http://blog.thepimp.net|http://www.libgd.org>

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

Offline

#3 March 13, 2008 12:35:14

Pierre J.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] RE: [PATCH] adding stream wrappers to include_path


Hi Dmitry,

On Thu, Mar 13, 2008 at 12:25 PM, Dmitry Stogov <> wrote:
> It is too difficult for extension that is not in the core distribution
> yet.
> For now I think it is simple to override zend_stream_open_function() and
> zend_resolve_path_function() callbacks by ext/phar and provide something
> like phar.include_path directive.

It is indeed a solution. But my point was to support quotes in the
include_path, no matter if an extension needs it or not. However it is
not that critical and nobody has complained about this problem before
:)

--
Pierrehttp://blog.thepimp.net|http://www.libgd.org--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#4 March 14, 2008 03:40:37

Greg B.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] RE: [PATCH] adding stream wrappers to include_path


Pierre Joye wrote:Hi Dmitry,

On Thu, Mar 13, 2008 at 12:25 PM, Dmitry Stogov <> wrote:It is too difficult for extension that is not in the core distribution
yet.
For now I think it is simple to override zend_stream_open_function() and
zend_resolve_path_function() callbacks by ext/phar and provide something
like phar.include_path directive.It is indeed a solution. But my point was to support quotes in the
include_path, no matter if an extension needs it or not. However it is
not that critical and nobody has complained about this problem beforeActually, this feature was requested several times (and immediatelydismissed) about 2 years ago, first by Francois Laupretre, I think, butI've heard it requested many times. Until I realized how easy it is toimplement, I was actually against this kind of thing. I stronglyencourage those who have the impulse to dismiss the patch to actuallytry it. For no performance hit, it adds big functionality to PHP.To be ultra-clear, the patch is not phar-specific.

Greg

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

Offline

  • Root
  • » PHP
  • » [PHP-DEV] RE: [PATCH] adding stream wrappers to include_path [RSS Feed]

Board footer

Moderator control

Enjoy the 16th of December
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support