Check back often to see new posts on Web Development on the IBMi.
In the meantime, here are some good articles from friends and colleagues:
Composer on the IBM i... or anywhere
April 19, 2016
What is composer?
If you are not familiar with composer, I would strongly encourage you to read this:
It allows you to declare your dependecies in a JSON file, and installs/updates them for you.
Say I'm using Zend Framework 2 in my application. My application depends on Zend Framework 2. Zend Framework 2 might depend on something else being installed. Once you define that dependency in the Composer.JSON file, and run the "composer install" command, Composer will download what you will need to the vendor folder.
Composer allows you to choose bits and pieces from various frameworks or libaries. It creates an autoloader for you so that you can point your application to it's autoloader, and you are set to go. It really saves you time and headaches once you get used to using it.
How? (IBM i specific)
We will be using QP2TERM by running CALL QP2TERM from the command line.
Steps In Brief:
1. Add PHP to classpath
2. Run Composer installer
3. Copy it to php bin library
4. Use it!
Step 1 - Add PHP to classpath
You can simply run the following commands on the QP2TERM command line (you need to do this each time you go into QP2TERM):
$ export PATH
$ export LIBPATH
Or you can create/modify a file called .profile with those exact commands in /home/YOURUSERPROFILEHERE/