Skip to content
Chris Putnam edited this page Apr 7, 2020 · 7 revisions

Getting Started

OK, so you read this and your situation also seems like a good use-case for a PHP console tool? Here we go then!

Install PCon

  1. Clone this repository to the directory of your choice. This directory can be kept and updated for future use, and will inlude a special tool to help you create and managed console tools that you build. We'll refer to the directory as "~/dev/pcon"
  2. CD to your local pcon folder (cd ~/dev/pcon)
  3. Make sure the 'pcon' script file is executable - run chmod +x ./pcon

Create a New Console Tool

  1. CD to your local pcon folder (cd ~/dev/pcon)
  2. Run ./pcon create (optionally, run ./pcon help create to see usage)
  3. Follow prompts to specify details
  4. Program your functionality

Customize and Test Your Tool

Reference Development Cookbook section

Package a Console Tool

  1. CD to your local pcon folder (cd ~/dev/pcon)
  2. Run ./pcon package (optionally, run ./pcon help package to see usage)
  3. Follow prompts to specify deails
  4. Note the hash that is output during packaging, to use for delivery

Deliver a Packaged Console Tool

Delivery strategies may vary, but here is an example with github:

  1. Within your repository, add a 'dist' folder, and place your packaged script here

  2. In your github readme, include lines like these:

    Download Latest Version (1.0.1):
    https://raw.githubusercontent.com/chrisputnam9/pcon/master/tests/dist/test-thing-script
    
    Latest Version Hash (md5):
    8a8a3682d7ad710ed7e4a780b4678b74
    

    If you adjust the wording or organization, adjust the update regex patterns in your PHP accordingly.

  3. Update update_* properties in your code to point to the readme file url

  4. Update the hash and version number whenever you package and deploy a new version

More Information