Hi All,

What do you guys think of a import feauture for php. This allows developers
to use packages and a package trees for including files. We're using a php
written import for the binarycloud app framework with grat success. It's
extremly handy, easy to use, clear and straight forward.

We currently have the following syntax if we want to "include" a file.


The import method now does the following:

Look up global import map,

if package already included




Set "binarycloud.core.Request" => true in the global

import map.

The benefits are outstanding. You don't have to mess around with path names
and the package-path's can be logically structured. Ok, you can achive this
with include too, but import seems more flexibe and abstracted from the
filesystem. So somehting like "binarycloud.db.Template" could be something
within a database or ldap or whatever in the future.

I don't know the interna of php but I think a native and basic
implementation in C will be a matter of some hours because this is based on

I thought of also having a php.ini setting like:


or something like that. The syntax itself should be the same as with

import "package.File"; and


This might also be interesting for PEAR to have a more clear structure:

import php.pear.PEAR

import php.pear.Cache


The only "drawback" I currently see is that you can't use dots in filenames.
But that's also useful for people who love it clear ;-)

For the binarycloud implementation of import see:


What do you think?





PHP General 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]

Reply via email to