...or else you can use one of PHP's magic __autoload
in your scripts to prevent this kind of behavior.
Save this file as config.php
function __autoload( $class ) {
if( file_exists( $class . '.php' ) ) {
require_once $class . '.php';
} else {
die( 'No such file.' );
}
}
Now, include/require config.php
in all your files and you don't need to include/require the class files.
Only caveat is that the class names must match the file name.