Setting up Contao workspace on c9.io
by Thomas Urban
c9.io is an online service providing IDE including virtual machines for developing software. This short tutorial tries to explain how to set up a workspace with Contao e.g. for developing patches to the Contao core hosted at Github.
Preparing on github.com
If you want to change code of Contao in preparation for a pull request for merging your changes into master branch of Contao core, you might need to fork the latter one on github.com first. When you have linked your account at c9.io with your account at github.com, then forking the repository on github.com will make it available for select to clone on dashboard at c9.io.
- Log into github.com.
- Open Contao core repository at https://github.com/contao/core.
- Click on "Fork" button in upper-right corner.
This will create a repository core in your account at github. So if your account is johndoe there, the forked repository will be available at https://github.com/johndoe/core.
When on c9 dashboard ...
- Log into your account at c9.io and make sure it is linked it with your account at github.com.
- When both accounts are linked with each other all your repositories at github are listed as projects in a selector in left-hand panel on dashboard.
- Next create a new workspace:
- If you have forked contao/core on github.com before: click on the forked project listed in that selector.
- If you haven't forked contao/core and want to start new workspace from that original repository: click on upper-left button "create new workspace" to be cloned from URL https://github.com/contao/core.git.
- In either case start editing the new workspace when it's creation has been finished.
When in workspace ...
- Enter these commands in shell prompt at bottom of window:
curl -sS https://getcomposer.org/installer | php
php composer.phar install --prefer-dist
- Right-click on file core/contao/install.php and select "Run".
- Apache is started in workspace opening another tab in shell panel at bottom of workspace view.
- Copy link listed in that tab into clipboard and open another tab of your browser for requesting that URL.
- This will open Contao installer. Process it as usual, but ensure to use the following values on setting up database:
- The database driver might be MySQLi.
- The hostname must be 127.0.0.1 ... the default localhost isn't working.
- The username is equivalent to your username at c9.io
- Keep the password empty!
- The database is always named c9.
After that, you're finished and may start adjusting Contao to your needs.