ianl28/starter-files

PHP class library to run as script from Composer in order to create the starter files for a PHP project.

dev-main 2022-10-11 03:42 UTC

This package is auto-updated.

Last update: 2024-06-11 06:18:20 UTC


README

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.

Compatibility

Tested up to PHP 7, should be compatible with PHP 5.3 or above

Installation

The following instructions are used to create a new PHP project from scratch using ianl28/starter-files:

  1. Create a new folder for the new project by entering mkdir newproj
  2. Navigate into the new folder cd newproj
  3. Create a new composer.json file by entering composer init
  4. Enter the necessary values. Ensure that the minimum stability is set to dev.
  5. Ensure that the internet is connected
  6. Run composer require ianl28/starter-files
  7. Then add these lines to your composer.json:
    "scripts": {
      "post-status-cmd": "Ianl28\\StarterFiles\\StarterFiles::run"
    },
  1. Then run composer status
  2. 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
  3. Then add these lines to your composer.json:
    "autoload": {
        "psr-4": {
            "Namespace\\Newproj\\": "src/"
        }
    },
  1. Then run composer update
  2. 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
  3. Alternatively, the class Newproj may be run from ./ as php index.php or from ./src as php test.php

Change Log

Please see CHANGELOG for more information on the recent changes.

Contribute

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.