Skip to content
Filip Krzyżanowski edited this page Jan 31, 2022 · 3 revisions

Why .env?

It is very dangerous to store sensitive data (API keys, passwords, etc.) in your code. You should separate them from the code. Where? With help comes environment variables. Storing sensitive data in environment is one of the tenets of a Twevle-factor app. You can also store credentials that change between deployment environments.

.env file MUST be in .gitignore file!

Advantages of .env:

  • Easy way to set, change and hide sensitive data
  • 0 editing in Apacha/Ngnix files
  • Easy sharing with collaborators
  • Compatible with all PHP servers

Usage with collaborators

For the creator of the project

  1. Create .env.example (Or an otherwise named file) with template of all variables with example values
  2. Put it into repository

For the contributor

  1. Create .env file and paste template from example file
  2. Fill variables with correct values

That's all!

Contributing

  1. Fork it
  2. Create your feature branch git checkout -b my-new-feature
  3. Make your changes
  4. Run the tests, adding new ones for your own code if necessary (phpunit)
  5. Commit your changes git commit -am 'Added some feature'
  6. Push to the branch git push origin my-new-feature
  7. Create new Pull Request

Branchology

V X.X.X

Branch with specific version of project (The latest version does not necessarily include all updated)

Master

Branch with all updates of project, but it doesn't necessarily have enough features to be a new version. (Propably not stable)

feature/xxx

Branch with new feature actually adding to the project

Versionlogy

X.0

X - number of version (Big updates)

1.X

X - amout of small updates in main version

1.1.X

X - amout of bug fixes in this version

License

Project is licensed under MIT License