Another possibility is to go around the problem in case of simple name collitions. You may change the include_path at runtime.
Here is an example:
config.php
<?php
/*
ini_set Sets the value of the given configuration option. Returns the old value on success, FALSE on
failure. The configuration option will keep this new value during the script's execution, and will be
restored at the script's ENDING.
Note: magic_quotes_runtime is not the same as magic_quotes_gpc.
See the PHP manual Appendix G. php.ini directives for more information.
http://www.php.net/manual/en/ini.php#ini.list
*/
ini_set('include_path',ini_get('include_path') . '/SPLIB:' . '/pear:');
ini_set('display_errors', "1"); // Changeable PHP_INI_ALL
ini_set('magic_quotes_runtime', "0"); // Changeable PHP_INI_ALL
// ini_set('magic_quotes_gpc', "0"); Changeable PHP_INI_PERDIR Entry can be set in php.ini, .htaccess or httpd.conf
// ini_set('short_open_tag', "0"); Changeable PHP_INI_PERDIR Entry can be set in php.ini, .htaccess or httpd.conf
?>
You can change include path when and where you want at run time.
You can test configurating settings with a file like this:
configtest.php
<?php
echo ( '<pre>' );
echo 'Include_path = ' . ini_get('include_path') . "\n";
echo ( '</pre>' );
echo ( '<pre>' );
echo 'Magic_quotes = ' . ini_get('magic_quotes_gpc') . "\n";
echo ( '</pre>' );
echo ( '<pre>' );
echo 'Short_open_tag = ' . ini_get('short_open_tag') . "\n";
echo ( '</pre>' );
echo ( '<pre>' );
echo 'register_globals = ' . ini_get('register_globals') . "\n";
echo ( '</pre>' );
echo ( '<pre>' );
echo 'post_max_size = ' . ini_get('post_max_size') . "\n";
echo ( '</pre>' );
echo ( '<pre>' );
echo 'display_errors = ' . ini_get('display_errors') . "\n";
echo ( '</pre>' );
echo ( '<pre>' );
echo 'post_max_size+1 = ' . (ini_get('post_max_size')+1) . "\n";
echo ( '</pre>' );
require_once ('config.php'); //
Note the difference for include path.
echo ( '<pre>' );
echo 'Include_path = ' . ini_get('include_path') . "\n";
echo ( '</pre>' );
echo ( '<pre>' );
echo 'Magic_quotes_runtime = ' . ini_get('magic_quotes_runtime') . "\n";
echo ( '</pre>' );
//$inis = ini_get_all();
//print_r($inis);
?>
So if you have a standard include path, you may change that at run time for some applications. May be this confuses more than it clears. And it does not solve the general problem with name conflicts.