Make a Lasting Impression
ImpressCMS Blog > Full Composer integration in ImpressCMS

Full Composer integration in ImpressCMS

I'm very proud to announce that I have been able to continue my work on integrating composer into the ImpressCMS core, and that I've been able to adapt ImpressCMS so it uses the composer autoloader completely!

What are the benefits and what does it imply? Lots of benefits, on different levels

industry standard

When it comes to PHP package management, composer is fast becoming the industry standard. It is easy to integrate in your library or project, and most development tools have some measure of integration with it. That includes phpStorm, for which we received an open source license for the team developers from the cool people at JetBrains.

DRY

(Don't repeat yourself) Composer is a PHP implementation of the zyyp package manager created for OpenSUSE Linux, which is considered the most advanced of the linux package managers out there. Instead of building our own, almost certainly more limited, implementation of a package manager, let's just re-use something that is widely considered a very good option.

Oh yeah, and it saves us loads of development time as well

Easy use of external libraries

If the core integrates composer, making use of external libraries is just adding a library to the 'requires' section in the appropriate composer.json file (module or core). Creation of the correct autoloading code, updating when a new version is available : it's all there.

This will make it immensely more easy to start using composer-enabled API libraries, so you can focus on integrating those Google or facebook services, without having to take care on how to plug it into ImpressCMS.

Simpler and leaner ImpressCMS code

Using composer and its autoloader means that we can drop some fairly complex chunks of code from the core. Less and simpler code to support? I'd say yes

But...

Unfortunately, I did the changes on the impresscms_2.0 branch, which contains a rather old version of the code. The most current code resides in the 'retro' branch.

There have been quite a bit of changes to get composer autoloader working, so I'm painstakingly trying to replicate all those changes (mostly removing the autoloader functions from the IPF library) into an up-to-date branch of code.

Once that's done, I'll create a merge request to get this still included in 2.0.0.

All posts by fiammybe
Subscribe to latest posts
The comments are owned by the poster. We aren't responsible for their content.
Poster Thread
david
Posted: 2014/10/11 23:27  Updated: 2014/10/11 23:27
Home away from home
Joined: 2008/2/12
From:
Posts: 1493
 Re: Full Composer integration in ImpressCMS
Nice work indeed, a lot of possibilities for this.
63RD
Posted: 2015/6/11 20:21  Updated: 2015/6/11 20:21
Home away from home
Joined: 2009/3/6
From:
Posts: 254
 Re: Full Composer integration in ImpressCMS
yes this sounds very good. autoupdates where you maybe could sign up to a preferred release cycle like in debian linux. it sounds awesome and im sure i havent grasped it all yet.
fiammybe
Posted: 2015/6/11 21:00  Updated: 2015/6/11 21:02
Home away from home
Joined: 2009/3/3
From: Belgium
Posts: 1942
 Re: Full Composer integration in ImpressCMS
Hi 63RD, long time you've been around Nice work on the ImpressCMS planet background image, even though it isn't my style I can see quite a bit of skill going into that one.

I've gotten quite far already integrating composer in the current codebase. The only thing at the moment that is stopping me from adding it to a new alpha release is that the changes are breaking the installer. That's quite a big problem, so we'll have to wait a bit more until I've figured out how to fix the installer, or how to write a new one

It's not 100% transparent, I tried upgrading Smarty2 -> Smarty 3 and it sadly didn't work But that specific change isn't high on the priorities list, getting ImpressCMS 2.0 out is.