You could possibly get something similar to what you're after by using __autoload(). Then you could just use whatever class you want, without requireing it, and so long as its file is in your include_path it will be loaded without trouble.
(This of course assumes that the file you're trying to include has a class in it, and that the class and its file are named according to some convention. Probably that's not actually the case.)
This is a pretty standard autoloader, that works with Zend- and Pear-style naming conventions:
<?php
/**
* Load (include the file of) a given PHP class.
*
* @param string $class The name of the class to load.
*
* @return void
*/
function __autoload($class)
{
$files = array(
$class . '.php',
str_replace('_', '/', $class) . '.php',
);
foreach (explode(PATH_SEPARATOR, ini_get('include_path')) as $base_path) {
foreach ($files as $file) {
$path = "$base_path/$file";
if (file_exists($path) && is_readable($path)) {
include_once $path;
$finalPath = $path;
}
}
}
if (isset($finalPath)) {
return;
} else {
die("Unable to load class '$class'.");
}
}
?>