Hi! I am your resident Composer menace.
I am working to make WP SEO have awesome Composer support. Because Composer is what keeps developers happy and managing dependencies reliable (audience cheers).
As well as hopefully simplifying development and build processes away from Git Submodules (audience moans).
The current state
- Present
composer.json in main plugin, but broken due to submodule use
- Two submodules without Composer support
Decision points
Is it time for submodules to go?
Should the submodules be retained in parallel? Or should Composer become main and preferable mechanism with submodule structure deprecated?
How will we handle autoload?
The tricky part is to enable end result to work seamlessly with PHP 5.2 (audience moans).
While you can use Composer to build for PHP 5.2 target without issue, its autoload is inherently 5.3.
From my research so far I see two approaches:
- Ignore Composer autoload, rely on known dependency locations in tree to load files. Vendor directory can be discarded in build process. As part of the site stack the built in load should be ignored in favor of global Composer autoload.
- Use the intermediary classmap, generated by Composer. While that "magic" autoload in Composer requires 5.3, it also generates intermediary files which seem not too. One of those can provide classmap, mapping classes to their filesystem locations. This file can be used in internal autoloader, over hardcoding the locations.
- composer-php52 was brought to my attention as an option for autoload compatibility layer, h/t @coenjacobs
There might be more options to explore here as well.
Progress
Relevant pull requests
Hi! I am your resident Composer menace.
I am working to make WP SEO have awesome Composer support. Because Composer is what keeps developers happy and managing dependencies reliable (audience cheers).
As well as hopefully simplifying development and build processes away from Git Submodules (audience moans).
The current state
composer.jsonin main plugin, but broken due to submodule useDecision points
Is it time for submodules to go?
Should the submodules be retained in parallel? Or should Composer become main and preferable mechanism with submodule structure deprecated?
How will we handle autoload?
The tricky part is to enable end result to work seamlessly with PHP 5.2 (audience moans).
While you can use Composer to build for PHP 5.2 target without issue, its autoload is inherently 5.3.
From my research so far I see two approaches:
There might be more options to explore here as well.
Progress
Relevant pull requests