Skip to content

Commit 941594f

Browse files
committed
Improve Readme.md including step by step guides on how to start developing
1 parent e7de500 commit 941594f

File tree

1 file changed

+41
-7
lines changed

1 file changed

+41
-7
lines changed

README.md

Lines changed: 41 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88

99
## Introduction
1010

11-
This is a repository intended to serve as a starting point if you want to bootstrap a project in PHP.
11+
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)](https://www.youtube.com/watch?v=v2IjMrpZog4).
1212

13-
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-kata-name` and there you go:
14-
* Latest versions of PHP and PHPUnit in order to practice with them
13+
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:
14+
* Latest versions of PHP and PHPUnit
1515
* Best practices applied:
1616
* [`README.md`][link-readme] (badges included)
1717
* [`LICENSE`][link-license]
@@ -25,13 +25,47 @@ It could be useful if you want to start from scratch a kata or a little exercise
2525

2626
## How To Start
2727

28+
You have 2 different alternatives: Using our [Packagist project](https://packagist.org/packages/codelytv/php-bootstrap) with Composer, or manually cloning [this repo](https://github.com/CodelyTV/php-bootstrap/):
29+
30+
### Using Composer
31+
32+
Start completely from scratch without having to delete this bootstrap project Git history:
33+
2834
1. If you don't have it already, [install Composer](https://getcomposer.org/download/).
29-
2. Create your project based on this bootstrap repo: `composer create-project codelytv/php-bootstrap your-kata-name`.
30-
3. Run all the checks: `composer test`. This will do some checks that you can perform with isolated commands:
35+
2. Create your project based on the [Packagist project](https://packagist.org/packages/codelytv/php-bootstrap). This will also download the project dependencies: `composer create-project codelytv/php-bootstrap your-project-name`.
36+
3. Move to the project directory: `cd your-project-name`
37+
4. Run all the checks: `composer test`. This will do some checks that you can perform with isolated commands:
38+
1. [PHP Parallel Lint](https://github.com/JakubOnderka/PHP-Parallel-Lint): `composer lint`.
39+
2. [PHP Style Check](https://github.com/squizlabs/PHP_CodeSniffer): `composer style`. If you want to fix style issues automatically: `composer fix-style`.
40+
3. [PHP Unit](https://phpunit.de/): `composer phpunit`.
41+
5. Create your own repository:
42+
1. Initialize your own Git repository: `git init`
43+
2. Add the bootstrap files: `git add .`
44+
3. Commit: `git commit -m "Initial commit with project boilerplate based on https://github.com/CodelyTV/php-bootstrap"`
45+
4. Add your remote repository: `git remote add origin [email protected]:your-username/your-project-name`
46+
5. Upload your local commits to the new remote repo: `git push -u origin master`
47+
6. Start coding!
48+
49+
### Cloning the repository
50+
51+
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:
52+
53+
1. Clone this repository: `git clone https://github.com/CodelyTV/php-bootstrap your-project-name`
54+
2. Move to the project directory: `cd your-project-name`
55+
3. If you don't have it already, [install Composer](https://getcomposer.org/download/).
56+
4. Install the project dependencies: `composer install`
57+
5. Run all the checks: `composer test`. This will do some checks that you can perform with isolated commands:
3158
1. [PHP Parallel Lint](https://github.com/JakubOnderka/PHP-Parallel-Lint): `composer lint`.
3259
2. [PHP Style Check](https://github.com/squizlabs/PHP_CodeSniffer): `composer style`. If you want to fix style issues automatically: `composer fix-style`.
3360
3. [PHP Unit](https://phpunit.de/): `composer phpunit`.
34-
4. Start coding!
61+
6. Create your own repository cleaning the bootstrap project history:
62+
1. Remove previous Git history in order to do not add the bootstrap repo noise in your project: `rm -rf .git`
63+
2. Initialize your own Git repository: `git init`
64+
3. Add the bootstrap files: `git add .`
65+
4. Commit: `git commit -m "Initial commit with project boilerplate based on https://github.com/CodelyTV/php-bootstrap"`
66+
5. Add your remote repository: `git remote add origin [email protected]:your-username/your-project-name`
67+
6. Upload your local commits to the new remote repo: `git push -u origin master`
68+
7. Start coding!
3569

3670
## Helpful resources
3771

@@ -41,7 +75,7 @@ It could be useful if you want to start from scratch a kata or a little exercise
4175
* [Scalar type declarations example](https://github.com/tpunt/PHP7-Reference#scalar-type-declarations)
4276
* [Return type declarations example](https://github.com/tpunt/PHP7-Reference#return-type-declarations)
4377

44-
### PHPUnit 5.5
78+
### PHPUnit
4579

4680
* [Introduction to writing tests for PHPUnit](https://phpunit.de/manual/current/en/writing-tests-for-phpunit.html)
4781
* [Testing exceptions with PHPUnit](https://phpunit.de/manual/current/en/writing-tests-for-phpunit.html#writing-tests-for-phpunit.exceptions)

0 commit comments

Comments
 (0)