buonzz/console-app

Boilerplate project files for creating Console Applications on executable PHAR file.

v1.4.0 2017-03-18 15:22 UTC

This package is auto-updated.

Last update: 2024-11-06 10:20:14 UTC


README

If you are trying to create a new Console Application that is distributed as .phar file, this template of files will surely help you make the process a lot easier and faster.

Features

  • PSR-4 autoloading compliant structure
  • Unit-Testing with PHPUnit
  • Comprehensive Guides and tutorial
  • Easy PHAR file building process
  • Eloquent ORM support
  • Powered by Symfony Console
  • Easy configuration via .env file

Build Environment

You need to have docker and docker-compose command installed in your local environment to build a new phar file.

Put up the server dependencies

docker-compose up -d

ssh to the container

docker-compose exec cli bash

execute the build command

cd /code
./build.sh

The compiled phar file should now be available in /code/dist/yourapp.phar
You can then upload it to your web server and let the users download/install it by:

wget http://downloads.yourdomain.com/yourapp.phar
sudo mv yourapp.phar  /usr/local/bin/yourapp
chmod +x /usr/local/bin/yourapp
yourapp -V

shutdown the containers

docker-compose down