Skip to content

Instantly share code, notes, and snippets.

@Aaron3
Created February 21, 2016 19:40
Show Gist options
  • Save Aaron3/f4d52fe10acbebf2207c to your computer and use it in GitHub Desktop.
Save Aaron3/f4d52fe10acbebf2207c to your computer and use it in GitHub Desktop.
<?php
$namespace = 'aBase\\';
$classes = get_declared_classes();
$keys = preg_grep('/ComposerAutoloaderInit*/', $classes);
foreach ($keys as $composerLoader) {
if (method_exists($composerLoader, 'getLoader')) {
$composer = $composerLoader::getLoader();
if($composer && $composer->getPrefixesPsr4()){
if(array_key_exists($namespace, $composer->getPrefixesPsr4())){
$abase_composer = $composerLoader::getLoader();
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment