From: alex b. <en...@tu...> - 2001-06-30 17:28:19
|
> I think import() is not meant to handle path/fileinformation directly. What > you described is a side effect of import caus dots are translatet to / and > this way the import contains a meta info. But this might not be neccessarily > a path. (this should be fixed, disallow "/", "\" and .+). The delimiter is "." at the moment, I think Justin wants to see that changed. > The idea of import is a system to simplify including, I think (correct me if > I'm wrong): > > E.g.: import('binarycloud.pear'); > > instead of: > include_once(BC_PATH."/ext/pear/PEAR.php"); > include_once(BC_PATH."/ext/pear/cache.php"); > include_once(BC_PATH."/ext/pear/whatever.php"); > include_once(BC_PATH."/ext/pear/stuff.php"); Correct. actually: import('pear.foo') - we're going to store pear and metabase (and anything else) in the ext/ source dir. > The import() includes all neccessary files related to pear (or alle > neccesary files of pear you need to include by calling import(bc.pear), or > all files in the ext/pear/ directory or....). Imagine you have to include > all by hand and then some filenames change within pear, you have to edit all > your code where you include pear. With import, nothing changes. Exactly. > Ok, you could do it the common way. But with a growing codebase the package > thing is more flexible, clear and intuitive, in my opinion. > And imagine it's required that individual tasks have to be perfomed by > including a specific package. If so you dont have to care about this, just > import package and thats it. Again, exactly. |