diff --git a/includes/autoload.php b/includes/autoload.php index 359a8b0..a7d2bb6 100644 --- a/includes/autoload.php +++ b/includes/autoload.php @@ -1,26 +1,30 @@ . // autoload local classes spl_autoload_register( function( $name ) { $prefix = substr( $name, 0, 13 ); if( 'itwikidelbot\\' === $prefix ) { $name = substr( $name, 13 ); + $path = __DIR__ . DIRECTORY_SEPARATOR . "class-$name.php"; + if( ! file_exists( $path ) ) { + throw new Exception( "missing class $name" ); + } require __DIR__ . DIRECTORY_SEPARATOR . "class-$name.php"; } } ); // autoload boz-mw classes require __DIR__ . DIRECTORY_SEPARATOR . 'boz-mw' . DIRECTORY_SEPARATOR . 'autoload.php';