100000 ) { continue; } $pathinfo = pathinfo( $real_path ); // An empty filename wouldn't be a good idea. if ( empty( $pathinfo['filename'] ) ) { continue; } // Sorry, need an extension. if ( empty( $pathinfo['extension'] ) ) { continue; } // Actually, we want just a PHP extension!. if ( 'php' !== $pathinfo['extension'] ) { continue; } // Only for files that really exist. if ( true !== file_exists( $real_path ) ) { continue; } if ( true !== is_readable( $real_path ) ) { continue; } // Require the file. require_once $real_path; } } } endif;