You are here: Re: Streams and wrappers « PHP Programming Language « IT news, forums, messages
Re: Streams and wrappers

Posted by Julien Biezemans on 06/26/07 07:34

shimmyshack wrote:
>
> you can also use a wrapper around stream_wrapper_register()!! hee hee
>
> in the end, the usefulness of this kind of statement is surely pretty
> small - well my imagination is limited I suppose, can it really be
> called a "stream protocol"?
> fopen('mailto:u...@domain.com', 'w');
> stream_wrapper_register_even_the_fake_ones( $p, $m='r' )
> {
> //if first 7 chars are 'mailto',
> //{ replace
> //mailto: with mailto:// and do it
> //stream_wrapper_register(str_replace('mailto:','mailto://',$p, $r);
> //}
> }
>
> etc blah.
>
> stream_wrapper_register_even_the_fake_ones( 'mailto:blah@blah.com',
> 'w' );
>
> if you come up with a class that codes for the entire mailto thing
> with imap support and so on please send it along, it would be useful I
> guess
>

Thank you for your reply but I'm not quite sure I understand your idea
and my guess is that you mixed up stream_wrapper_register() and fopen()
functionality.

When I read

stream_wrapper_register_even_the_fake_ones( 'mailto:blah@blah.com',
'w' );

I think you meant

fopen('mailto:blah@blah.com', 'w');

Right?

I don't see how a wrapper around stream_wrapper_register() will help
because what is important is the scheme being actually registered and
the str_replace() trick still register "mailto://" and not "mailto:",
from PHP internals point of view.

Cheers,

Julien.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация