PHP Web Application Bootstrap
, (*1)
A bootstrap for a web application in PHP. Don't set, just code!, (*2)
About
This bootstrap will install all the basic files and settings to start a PHP web application., (*3)
This assumes you'll use Git for vcs,
Composer for dependencies,
PHPUnit for testing,
Travis and Scrutinizer for integration servers., (*4)
Files architecture
βββ public
| βββ .htaccess
| βββ index.php
| βββ robots.txt
βββ src
| βββ Dummy.php
βββ tests
| βββ DummyTest.php
βββ vendor
βββ .editorconfig
βββ .gitattributes
βββ .gitignore
βββ .scrutinizer.yml
βββ .travis.yml
βββ composer.json
βββ composer.lock
βββ LICENSE
βββ phpunit.xml.dist
βββ README.md
βββ run
- "public" is the web entry point.
- "src" contains all your PHP code.
- "tests" contains all your PHP tests. See PHPUnit for more information.
- "vendor" contains all your PHP dependencies. See Composer for more information.
Installation
With Samurai (recommended)
Just execute Samurai with 'app' bootstrap., (*5)
$ samurai new app
With Composer
First, execute Composer to create your project., (*6)
$ composer create-project raphhh/php-lib-bootstrap path/to/my/project
Go into your project., (*7)
$ cd path/to/my/project
Then, you need to replace composer.json with your specific info., (*8)
Usage
Launch unit tests
This bootstrap is configured to use PHPUnit. To run the tests, cd to your project and enter the following command in your console:, (*9)
$ vendor/bin/phpunit
Launch app in the browser
The public entry point of the application is the dir "public". To run the app, cd to your project and enter the following command in your console:, (*10)
$ run
This command will launch for you the PHP internal server. Then, open your browser and go to http://localhost:8080/, (*11)