keinos/hello-world-tpl

Overly cautious HelloWorld class. See the repo for details.

1.2.3 2021-01-01 05:31 UTC

README

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.
    # For composer user with NO Docker
    composer create-project keinos/hello-world-tpl MyNewProject
    cd MyNewProject
    # 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)

    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.

    composer test -- --all --verbose
  4. Initial commit.

    Commit your first change.

    git add .
    git commit -m 'initial commit'
  5. Push the repo to GitHub then register it to the following CIs.

  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:

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" 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: