This is a simple utility run after the Composer init command, that creates the essential starter files for a project, namely, the ./src/Class.php, ./README.md, ./LICENSE.md (MIT), ./CONTRIBUTING.md, ./CHANGELOG.md, ./.gitignore, ./src/test.php and ./src/servephp.sh.
Tested up to PHP 7, should be compatible with PHP 5.3 or above
The following instructions are used to create a new PHP project from scratch using ianl28/starter-files:
- Create a new folder for the new project by entering mkdir newproj
- Navigate into the new folder cd newproj
- Create a new composer.json file by entering composer init
- Enter the necessary values. Ensure that the minimum stability is set to dev.
- Ensure that the internet is connected
- Run composer require ianl28/starter-files
- Then add these lines to your composer.json:
"scripts": {
"post-status-cmd": "Ianl28\\StarterFiles\\StarterFiles::run"
},
- Then run composer status
- The following files should then be created: ./index.php, ./README.md, ./LICENSE.md, ./CONTRIBUTING.md, ./.gitignore, ./src/Newproj.php, ./src/test.sh, ./src/servephp.sh
- Then add these lines to your composer.json:
"autoload": {
"psr-4": {
"Namespace\\Newproj\\": "src/"
}
},
- Then run composer update
- To start the PHP server and serve ./index.php on the browser, cd ./src, and then enter servephp.sh, and then point the browser to localhost:3000
- Alternatively, the class Newproj may be run from ./ as php index.php or from ./src as php test.php
Please see CHANGELOG for more information on the recent changes.
Please see CONTRIBUTING for details.
- Ian Low (ianlow28@gmail.com)
The MIT License (MIT). Please see License File for more information.