Thanks for your interest in helping out! In order to be able to contribute, you will need an environment in which to develop. A detailed setup is provided below.
You're free to contribute to any open issue that's not being tackled by anyone at the moment. However, if there's not a specific issue for the thing you want to make, make sure to open an issue or create a thread in the forums first to verify it's something that the community is interested in! Also, when contributing, please follow the contribution rules:
- Format the code using php-cs-fixer before creating a pull request. The rules are shipped with the code, on the
php-cs.dist
file that PHP-CS-Fixer will automatically pick up. - The whole codebase is in english: please use english variable names/comments/commit messages and whatnot.
- Clone the repo locally
- Copy the
.env.example
file on the project root to.env
- If needed, modify its contents to the ones correct for your usecase. The defaults should work fine.
- Install Docker, if you don't have it (https://www.docker.com/get-started)
- Install NodeJS 12.x, if you don't have it (https://nodejs.org/download/release/latest-v12.x/)
- Higher versions might work, too
- Run
npm install
from the directorysrc/subtitulamos
- Execute
./dev.sh
on the repository root from a Linux shell (if you're on Windows, Git Bash should be available if you installed Git). This command will- build & start all the necessary Docker containers
- start a webpack watcher that builds all the CSS/JS in the page any time it changes
- You're done!! You can access a subtitulamos instance at http://localhost:8080.
- You can log in as user
root
, with passwordroot
After this first setup, any time you want to start subtitulamos, just run ./dev.sh
!
With the basic setup above, you will be able to run a local server of subtitulamos, including all of its dependencies.
If you would like proper code intelligence in your IDE, you will need to either run your IDE inside the Docker container (for example, VSCode's "Developing inside a Container"), or install PHP & Composer locally.
The 2nd option might be easier:
- Install PHP
- On Windows, an easy install can be achieved using XAMPP. However, it'll install a bunch more things you might not want (like a local MySQL server). For a plain PHP install, just head over to the PHP Windows Downloads, download a compiled version (e.g VC15 x64 Thread Safe), extract it and add it to your PATH.
- Install Composer
- After that, run
composer install
on thesrc/subtitulamos
directory. Done!
- PHP 7.4
- MariaDB 10.4
- nginx + php7.4-fpm
- Redis
- MeiliSearch
Steps:
- To add new columns to a table, simply edit the model files inside
[src/subtitulamos/]app/Entities
, adding new private field(s) with the@ORM
annotation (see the Doctrine docs for details on the annotations).- If what you'd like is to create a new one, you can also just create a new file in that directory, following the correct annotations (look at other files for reference)
- Create any necessary functions to read from/update the fields
- Create a databse migration for this change:
docker container exec -it subs_phpsv ./vendor/bin/doctrine-migrations diff
. - Open the autogenerated file under
app/Migrations/
and tweak it as necessary. - Restart your PHP container to get the migration executed and applied to your database (e.g docker-compose down & docker-compose up), or run
docker container exec -it subs_phpsv ./vendor/bin/doctrine-migrations migrate --no-interaction
.
If you're not running on DEBUG mode, you will need to clear the Twig cache for the server to pick up changes to templates.
Run docker container exec -it subs_phpsv ./app/console app:twig:clear-cache