Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Axel\Module namespace not found #9

Open
IamSAB opened this issue Mar 21, 2019 · 0 comments
Open

Axel\Module namespace not found #9

IamSAB opened this issue Mar 21, 2019 · 0 comments

Comments

@IamSAB
Copy link

IamSAB commented Mar 21, 2019

It's about the PSR4 module you add in the axel.php constructor:

$this->modules[] = new Module\PSR4(ltrim(str_replace(getcwd(), '', __DIR__), DIRECTORY_SEPARATOR) . '/module', 'Axel\\Module');

It will have the wrong base path as the ltrim makes the path relative, cause it to be prepended again with a getcwd() issued in the PSR4 class as without a leading '/' it will enter the 'else'

if ($baseDir[0] == '/' || $baseDir[1] == ':') $this->baseDir = $baseDir;
else $this->baseDir = getcwd() . DIRECTORY_SEPARATOR . str_replace(['./'], '', $baseDir);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant