-
Notifications
You must be signed in to change notification settings - Fork 13
Home
Welcome to the joomlatools-composer wiki!
Before you can make changes and test your development work, you need to make sure Composer will actually install your branch when running it. The following steps show you our preferred way of working on this codebase:
-
Install the Joomlatools Vagrant box
-
Fork this repository, then clone your fork and the sample joomlatools/com_helloworld code into the
Projectsdirectory:cd Projects git clone [email protected]:yourname/joomlatools-composer.git git clone [email protected]:joomlatools/joomlatools-composer-helloworld.git -
Create a new branch in the Composer installer project:
cd joomlatools-composer git checkout -b feature/mynewbranch -
In the sample extension's repository, also create a new branch:
cd ../joomlatools-composer-helloworld git checkout -b feature/mynewbranch -
The Hello World extension requires the
joomlatools/composerpackage to be able to install. We must change this dependency incomposer.jsonto require our new development branch. Edit therequiresection so it looks like this:"require": { "joomlatools/composer": "dev-feature/mynewbranch" } -
Commit these changes into your test branch:
git commit -m "Change dependency for testing" -- composer.json -
Now, SSH into the Vagrant box and create a new Joomla installation:
cd .. vagrant ssh joomla site:create composer -
Go to the new site's root directory:
cd /var/www/composer -
Finally, we need to tell Composer where to find the new branches before we can install and test them. Edit
composer.jsonand overwrite its contents with this:{ "repositories": [ { "type": "vcs", "url": "file:////home/vagrant/Projects/joomlatools-composer" }, { "type": "vcs", "url": "file:////home/vagrant/Projects/joomlatools-composer-helloworld" } ], "minimum-stability": "dev" } -
You can now install and test your code changes by installing the
feature/mynewbranchbranch of your localjoomlatools/com_helloworldclone:composer require joomlatools/composer-helloworld:dev-feature/mynewbranchThis will pull in your local branch of the sample extension
com_helloworld, which in turn requires thedev-feature/mynewbranchbranch of the Composer plugin.
Happy coding!