Hi All,
I was wondering if anyone uses Composer for things? I do plenty on other projects but it doesn't look like there's much support in Zencart. In trying to make life easier, I started dabbling in a composer-based solution to install/update Zencart but I've simply hit too many obstacles to continue without posting on the forum!
* There are packages within Zencart that are not in the composer.json file!
Since aura/autoload, ircmaxell/password-compat, square/connect, and PHPMailer/PHPMailer are in Zen Cart core couldn't they be added as Composer dependencies? They live in includes/classes/vendor but could be moved under Composer to live outside of the web root in a vendor/ folder managed by Composer. Thus not requiring developers to update those projects manually and subsequently the parent Zen Cart branch independently.
Which would lead up to my other suggestion of having a "web root" within the project to serve files from. Currently it is the root of the project. Catering to Composer and adjusting for a "web root" things might look like this, with a web folder:
And then the web/ folder would be where you point your website root:
This folder structure would probably be the first order of business in working toward a Composer plugin. But are there specific reasons why Composer support is minimal? Maybe something else is in the works? Would a composer plugin or composer branch be of any use to the community such that "composer create-project zencart" installs this format? (which would obviously require some core edits, eg. filepaths.php)
On the future-future wishlist is plugins (for Composer and Zen Cart) such that this would be possible:
Code:
composer install zencart/usu
Code:
composer update zencart/edit_orders
Since downloaded plugins don't have a common structure, this is a long way off. A ZC plugin can contain multiple folders of itself representing different tweaks for different versions of Zen Cart. And these folders can live in sub-folders of the author's choosing, like "common_files" or "zencart_files".
Thoughts and comments welcome! Do you use/like/think Composer is worth it?
Bookmarks