support more more depth in the namespaces

This commit is contained in:
Matthias Pfefferle 2023-05-11 14:38:57 +02:00
parent b85b0167c0
commit cfa8974ffa

View file

@ -65,7 +65,9 @@ spl_autoload_register(
$class = str_replace( 'activitypub\\', '', $class );
if ( false !== strpos( $class, '\\' ) ) {
list( $sub_dir, $class ) = explode( '\\', $class );
$parts = explode( '\\', $class );
$class = array_pop( $parts );
$sub_dir = implode( '/', $parts );
$base_dir = $base_dir . $sub_dir . '/';
}