You want to contribute to this project? Well thank you! That's very much appreciated! 🥰
In this page, we'll see how to setup the project so you can edit it in your IDE.
If you have doubts, questions or suggestions, you can contact us on Matrix at #mesamatrix:matrix.org.
Mesamatrix requires the following software:
Clone the Mesamatrix repository:
git clone git@github.com:MightyCreak/mesamatrix.gitJump into the directory and install all the dependencies with Composer:
cd mesamatrix
composer installThere is a default config file in config/config.default.php.
It provides default values for the application, but is overridden by the
optional config/config.php.
For instance, to change the log level: create a config/config.php file and
copy this contents:
<?php
use Monolog\Level;
$CONFIG = array(
"info" => array(
"log_level" => Level::Debug,
),
);For the initial setup, run the mesamatrixctl tool to clone the Mesa Git
repository and generate the XML file:
./mesamatrixctl setupOnce setup is done, you can run the two commands that are needed to get the latest information from Mesa:
./mesamatrixctl fetch
./mesamatrixctl parseThese commands can be put into a crontab or similar scheduling facility, for automated operation of your Mesamatrix installation.
As a developer, an easy way to spawn up a PHP server is by running this command:
php -S 0.0.0.0:8080 -t publicThe mesamatrixctl tool can be used to administer your Mesamatrix
installation. It outputs very little by default, but can become more verbose
when passed -v, -vv or -vvv for normal output, verbose output or debug
output respectively.
Run ./mesamatrixctl list to see the available commands, or
./mesamatrixctl help <command_name> for more detailed help.
Initializes Mesamatrix: clones the mesa repository. Must be called once.
Pulls the latest commits from the Mesa git repository. Call it regularly to always be up to date.
Parses the latest commits and generates the XML used by the website.
Options:
-f/--force: Force to parse all the commits again-r/--regenerate-xml: Regenerate the XML based on the already parsed commits
Following the coding style of a project is important. It allows to have a more readable and maintainable code base. It's also useful for code reviews since there is no preference here, you simply have to follow the guidelines. And remember, you control your IDE and not the other way around! 😉
For PHP the project follows the PSR-12 coding style (except for the line limit, which was too constraining).
- Always use
varfor your variables - Use
'for strings
- Use
"for attributes
- Don’t bind your CSS too much to your HTML structure and try to avoid IDs
The recommended extensions for this project are in .vscode/extensions.json.
You don't have to install them all, it's simply recommended.
List of recommended extensions:
- EditorConfig for Visual Studio Code: the base to respect some common standards across the whole project
- Linters:
- PHP: phpcs
- Markdown: markdownlint
- Shell script: ShellCheck
- Code Spell Checker: spelling checker to check for typos, even in the source code
- Markdown All in One: several extensions for Markdown, especially useful for the table of contents generation