Skip to content

Latest commit

 

History

History
125 lines (86 loc) · 4.58 KB

README.md

File metadata and controls

125 lines (86 loc) · 4.58 KB

Build Status Coverage Status

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

  • Supported PHP Version to test
    • PHP v7.1, 7.2, 7.3, 7.4 (, nightly)
    • Details see: .travis.yml
    • Note: The nightly build version (PHP8-dev) fails on purpose in TravisCI.
  • Unit Test & Code Coverage
  • Coding Standard Compliance (PSR-2)
  • PHP Static Analysis
  • Docker for Local Testing

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

  1. Choose one of the below command that suits you, to create a new project following your project name. (Ex. MyNewProject)

    # For composer user (No Docker)
    composer create-project keinos/hello-world-tpl MyNewProject
    cd MyNewProject
    # For composer and Docker user
    composer create-project --no-dev 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
    rm -rf .git

    Note that the project name provided (the "MyNewProject" above) will be the package name and the namespace such as "MyVendorName/MyNewProject".

  2. Run the script below, which will re-write the package and vendor names to the provided name. (Ex. MyVendorName)

    ./.init/initialize_package.php MyVendorName
  3. Before anything, run the tests to check it's basic test functionality.

    composer test local all
    # For Docker users
    composer test all
  4. Create an empty Git repository and commit them.

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

  6. Re-name ENVFILE.env.sample to ENVFILE.env

  7. Get your access token from COVERALLS' settings and place/replace the token value in ENVFILE.env.

  8. Run tests again to see COVERALLS' function.

  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 develop via Docker.

VS Code and Docker User

If you use Visual Studio Code (a.k.a. VS Code) and have Docker installed, you can use "Remote - Containers" extension to develop your project over Docker container.

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. In VSCode, open the folder in Container by F1 -> "Remote-Containers".

Credit

This repo was very much inspired by: