This is a repository intended to serve as a starting point if you want to bootstrap a project in PHP. This repository has been explained in the CodelyTV video "IntroducciΓ³n a PHP: CΓ³mo configurar tu entorno de desarrollo π" (Spanish).
It could be useful if you want to start from scratch a kata or a little exercise or project. The idea is that you don't
have to worry about the boilerplate, just run composer create-project codelytv/php-bootstrap your-project-name
and
there you go:
- Latest versions of PHP and PHPUnit
- Best practices applied:
- Some useful resources to start coding
You have 2 different alternatives: Using our Packagist project with Composer, or manually cloning this repo:
Start completely from scratch without having to delete this bootstrap project Git history:
- If you don't have it already, install Composer.
- Create your project based on the Packagist project. This
will also download the project dependencies:
composer create-project codelytv/php-bootstrap your-project-name
. - Move to the project directory:
cd your-project-name
- Run all the checks:
composer test
. This will do some checks that you can perform with isolated commands:- Codely Style:
composer lint
. - Easy coding standard:
composer style
. If you want to fix style issues automatically:composer lint:fix
. - Static Analysis:
composer static-analysis
. - PHP Unit:
composer phpunit
.
- Codely Style:
- Create your own repository:
- Initialize your own Git repository:
git init
- Add the bootstrap files:
git add .
- Commit:
git commit -m "Initial commit with project boilerplate based on https://github.com/CodelyTV/php-bootstrap"
- Add your remote repository:
git remote add origin git@github.com:your-username/your-project-name
- Upload your local commits to the new remote repo:
git push -u origin master
- Initialize your own Git repository:
- Start coding!
Just in case you prefer to avoid dealing with composer create-project
, you can also clone this repository. We
recommend to follow the next step-by-step process in order to avoid adding the bootstrap project commits to your project
Git history:
- Use this repository template
- Clone your project
- Move to the project directory:
cd your-project-name
- If you don't have it already, install Composer.
- Install the project dependencies:
composer install
- Run the tests:
composer test
. - Start coding!
This very same basic skeleton philosophy implemented in other programming languages: