Skip to content

WIP: Use composers autoloader for path retrieval#2750

Open
webflo wants to merge 1 commit into
hechoendrupal:masterfrom
webflo:master
Open

WIP: Use composers autoloader for path retrieval#2750
webflo wants to merge 1 commit into
hechoendrupal:masterfrom
webflo:master

Conversation

@webflo

@webflo webflo commented Oct 1, 2016

Copy link
Copy Markdown
Contributor

No description provided.

@Saphyel

Saphyel commented Oct 1, 2016

Copy link
Copy Markdown
Contributor

I like the idea!

@webflo

webflo commented Oct 2, 2016

Copy link
Copy Markdown
Contributor Author

This is blocked by the facet that DrupalConsole, drupal-console-core and drupal-console-launcher use the same PSR-4 namespace. They have to use different namespaces.

@jmolivas Can we change drupal-console-core to Drupal\ConsoleCore and drupal-console-launcher to Drupal\ConsoleLauncher?

@enzolutions

Copy link
Copy Markdown
Contributor

I like the idea @webflo

@jmolivas

jmolivas commented Oct 5, 2016

Copy link
Copy Markdown
Member

@webflo What is the reason for renaming the namespace, if this is the case we will need to change code in core and contrib commands, may we search for another option?

@webflo

webflo commented Oct 7, 2016

Copy link
Copy Markdown
Contributor Author

Composer uses the namespace as array key in its PRS-4 autoload (look at an composer/autoload_psr4.php). It will only use DrupalConsole or drupal-console-core. You can't have both in one project. It fails if you try to pull both as dependency in your project.

@webflo

webflo commented Oct 7, 2016

Copy link
Copy Markdown
Contributor Author

I think its safe to start with the launcher. This component is separate, the change is easy. We have to do more planning for the other ones.

@jmolivas

Copy link
Copy Markdown
Member

@jmolivas

jmolivas commented Jun 6, 2017

Copy link
Copy Markdown
Member

@webflo We changed the constant definition extending DrupalFinder and using the getVendorDir value from DrupalFinder class.

https://github.com/hechoendrupal/drupal-console-core/blob/master/src/Utils/DrupalFinder.php#L26-L40

Do you think his fixes the reported issue?

@enzolutions

Copy link
Copy Markdown
Contributor

@webflo this idea is still valid, thanks in advance for any comment in regards to it.

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.

4 participants