KEINOS / TPL-PHP-HelloWorld

✅ Overly-super-cautious "Hello World" in PHP7 and PHP8 for fun.
Apache License 2.0
2 stars 0 forks source link
cis composer coveralls docker fun php php8 template-project travis

Build Status Coverage Status Code Quality Supported PHP Version

Super cautious "Hello-World"

This repo is an overly-cautious Hello-World PHP script for fun. It includes the following tests and CIs to just say "Hello-World!".

Tests

CIs Used

This repo uses the following CIs. On your use, register your repo first.

Using this package as a template/boilerplate

How to

## How to use it as a template ### TL; DR Copy, initialize the project, smoke test, add CI's ACCESS TOKEN then you're redy-to-go! ### TS; DR 1. Create a new copy. Choose one of the below commands that suits you. - Note that you need to specify your project's name. This will be your "package name" as well. ```bash # For composer user with NO Docker composer create-project keinos/hello-world-tpl MyNewProject cd MyNewProject ``` ```bash # For Docker and docker-compose user (No PHP nor composer user) git clone https://github.com/KEINOS/TPL-PHP-HelloWorld.git MyNewProject cd MyNewProject ``` 2. Initialize. Run the command below to initialize your project. This will re-write the package and vendor names to the provided name. (Ex. MyVendorName) ```bash rm -rf .git git init ./.devcontainer/initialize_package.php MyVendorName ``` 3. Functioning test. Before anything, run the tests to check it's basic test functionality. ```bash composer test -- --all --verbose ``` 4. Initial commit. Commit your first change. ```bash git add . git commit -m 'initial commit' ``` 5. Push the repo to GitHub then register it to the following CIs. - [TravisCI](https://travis-ci.org/) - [COVERALLS](https://coveralls.io/) 6. Re-name `COVERALLS.env.sample` to `COVERALLS.env` under `./tests/conf`. 7. Get your access token from COVERALLS' settings and place/replace the token value in `COVERALLS.env`. 8. Run tests again to see COVERALLS' function-ability. 9. If the local test passes then commit changes and push. 10. If the tests passes on CIs then start building your project. ## Developing via Docker This repo can be developed via Docker. Run: ```bash composer dev ``` Or, if you use Visual Studio Code (a.k.a. VS Code) and have Docker, then **"Remote - Containers" extension** is available. In this case, you don't need to install the packages or even PHP on your local env. 1. Install Microsoft's ["Remote - Containers"](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension to your VS Code. 2. `git clone` this repo to your local. 3. Remove the `.git` directory and initialize as a new one by `git init`. 4. Open folder in a Container by: F1 -> "Remote-Containers: Reopen in Container".

Credit

This repo was very much inspired by: