Re: include *.php

From: Date: Thu, 12 Jul 2001 19:31:25 +0000
Subject: Re: include *.php
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-674@lists.php.net to get a copy of this message
> This is not the right topic for PEAR, but what people think about adding > regular expressions to include() or require() constructions or even > making new language consruction import() what can handle reg. exp. file > includes. > > From this feature the package management could obtain great benefit !? > > or if somebody is so kind and wirtes special .so which contains function > import() .... ? function import($_file) { global $sImportMap; if ($sImportMap[$_file]) { return true; } global $gImportPaths; // at some point we should extend this to enable a list of import paths $gImportPaths = array(BC_PATH); $path = strtr($_file, '.', '/') . '.php'; foreach ($gImportPaths as $prefix) { if (include_once("$prefix/$path")) { $sImportMap[$_file] = true; return true; } } return false; }

« previous php.pear.dev (#674) next »