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

Fix autoload path for custom composer vendor-dir #44

Merged
merged 1 commit into from
May 19, 2016

Conversation

SmetDenis
Copy link
Contributor

@SmetDenis SmetDenis commented May 13, 2016

Hi,

I have to config my composer.json like that

    "config"            : {
        "bin-dir" : "../../bin",
        "vendor-dir" : "libraries",
   }

And it's located here <MY_PROJECT_ROOT>/src/cck/composer.json
My binaries here <MY_PROJECT_ROOT>/bin

And than a I tried to call joomlatools, fatal error apperied

$ ./bin/joomla

Warning: require(<MY_PROJECT_ROOT>/src/cck/libraries/joomlatools/console/bin/../../../../vendor/autoload.php): failed to open stream: No such file or directory in <MY_PROJECT_ROOT>/src/cck/libraries/joomlatools/console/bin/joomla on line 13

Fatal error: require(): Failed opening required '<MY_PROJECT_ROOT>/src/cck/libraries/joomlatools/console/bin/../../../../vendor/autoload.php' (include_path='.') in <MY_PROJECT_ROOT>/src/cck/libraries/joomlatools/console/bin/joomla on line 13

I think you should remove hardcode vendor and get location form config or accept my pull request

For example, PHPUnit works fine with my config and with default vendor-dir
https://github.com/sebastianbergmann/phpunit/blob/master/phpunit#L25

Now I just create symlink vendor -> libraries

Thanks and best regards, Denis.

@SmetDenis
Copy link
Contributor Author

Hi

Well what do you think?

@johanjanssens
Copy link
Member

Hello Dennis, at first sight this is looking good. The developer in charge of the console is on holiday at the moment, he will review your PR on his return and get back to you. Thanks for this! Very much appreciated.

@stevenrombauts stevenrombauts merged commit 0d2103e into joomlatools:master May 19, 2016
@stevenrombauts
Copy link
Member

@SmetDenis Thanks for this, this will do just fine. Tested and merged.

The current solution however still hardcodes every path, there are just more of them now. Not sure yet how we could improve this. I'll create a separate ticket in backlog to see if we can figure something out.

@stevenrombauts stevenrombauts added this to the Current milestone May 19, 2016
@stevenrombauts stevenrombauts modified the milestones: 1.4.7, 1.5.0 Jan 13, 2017
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

Successfully merging this pull request may close these issues.

3 participants