Contributing

Getting Started


Getting setup

  • Fork the AsgardCMS/Platform,
  • Clone your fork,
  • Run composer install
  • Run ./travis.sh
  • Make your changes
  • Run ./vendor/bin/phpunit
  • Send in the pull request if all is green

Which branch should I make my PR form and send it to?

  • Current default branch (2.0) if you're sending something for version 2.0,
  • Next major release: master branch.

Style guide

Please note AsgardCMS follows PSR-1 and PSR-2. Please make sure your code follows those standards.

You can use a great tool : PHP-CS-Fixer to make sure everything is following the correct coding style.

$ # in your Platform root directory
$ php-cs-fixer fix --verbose

To avoid having to type this every time, I have this command aliased to pcf, like so:

pcf="php-cs-fixer fix --verbose"

Now I can type pcf in the root directory of the module, and it'll just work, giving that there's a .php_cs file.

Making changes

Once you have your copy of AsgardCMS installed and configured for contributing purposes, you're ready to make changes.

AsgardCMS follows a workflow similar to Git Flow branching model.

This means:

  • For a new feature:
    • On master branch,
    • Create a branch feature/your-new-feature-name,
    • Add you changes,
    • Make sure the test suite for the module still passes,
    • Squash commits if necessary to create a nice history,
    • Send a pull request to the master branch of the module/theme your modifying.
  • For a hotfix:
    • On master branch,
    • Create a branch hotfix/your-hotfix-name,
    • Add a failing test that reproduces the found bug,
    • Add you changes by making the test pass,
    • Squash commits if necessary to create a nice history,
    • Send a pull request to the master branch of the module/theme your modifying.

Adding or updating translations

Adding new translations or updating existing translations to core modules is very easy in AsgardCms. All translations are centralised in the Translation module.

All you need to do is fork that module, and add and/or update existing translations.

The translations are located in the Resources/lang folder, each module has its own subfolder, with under that the different locales.

If you want to add a new language, duplicate the en folder of each module and renaming it to your desired locale. The English translations will usually the more complete ones, that's why it's best to use those as a starting point.

Additional resources

Mobile Analytics