[TYPO3-dev] streamline wrapper
Kasper Skårhøj
kasper2006 at typo3.com
Fri Feb 10 01:49:18 CET 2006
Hi Sven,
Very interesting idea. I am looking forward to hear how it feels to
use in your project (meaning real life).
My own idea was to follow the auto-loading feature in php 5.0 which
would be possible with a new file structure in the core for that
version. In such a case any "new [object name]" would include the
class if not included based on a pattern around the object name. That
would be nice.
Just thoughts.
- kasper
"A contribution a day keeps the fork away"
-------------------------------
kasper2006 at typo3.com | +45 20 999 115 | skype: kasperskaarhoej |
gizmo: kasper_typo3
On Feb 9, 2006, at 20:44 , Sven Wilhelm wrote:
> Hi,
>
> just as an idea of improvement and for all that didn't know this
> feature.
>
> Starting with PHP 4.3.2 it's possible to register custom stream
> wrappers. A stream wrapper is just a class that knows how to get data
> from it's specified data source. A stream wrapper has to implement
> some
> methods that PHP will call.
>
> So nothing new till there.
>
> Fine, it also works for include, include_once, require,
> require_once :)
>
> A steam in PHP has the following style:
>
> schema://schema-specific-form
>
> If one like to have a statement like:
>
> typo3://package_name/path/to/class.php
>
> it will be possible if you register a class that handles the
> schema-specifica under the scheme-name typo3.
>
> No more statements like:
>
> * require_once (PATH_t3lib. .....
> * require_once(t3lib_extMgm::extPath('ext_key').'path/to/file.php');
> * ...
>
> Advantages?
> I think so. You have just one class that has to know how to access
> data.
> It's not necessary to have several PATH constants spread around the
> system and ".... FILL IN THE ADVANTAGES YOU FIND ....".
>
> I decided to use this style for a projects I started working on named
> PHP Foundation classes. I just have to implement one class, my
> classpath
> class, that nows where to find and how to access the data.
>
>
>
> So, it was just a note.
>
> Kind regards
>
> Sven
>
> _______________________________________________
> TYPO3-dev mailing list
> TYPO3-dev at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev
More information about the TYPO3-dev
mailing list