2017 © Pedro Peláez
 

library phapp-cli

Provides standardized console commands for PHP applications.

image

drunomics/phapp-cli

Provides standardized console commands for PHP applications.

  • Tuesday, May 15, 2018
  • by fago
  • Repository
  • 2 Watchers
  • 3 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 9 Open issues
  • 33 Versions
  • 0 % Grown

The README.md

Phapp CLI

Provides standardized console commands for PHP applications., (*1)

Requirements

  • Git version >= 2.0
  • Bash 4.*
  • PHP >5.6|>7.0

Installation

Installation requires composer. As there are some dependency conflicts with the latest drush release it is recommended to install the tool via consolidation/cgr. To do so, just execute:, (*2)

# Download latest stable release.
php -r "
  ini_set('user_agent','Mozilla/4.0 (compatible; MSIE 6.0)');
  readfile(json_decode(file_get_contents('https://api.github.com/repos/drunomics/phapp-cli/releases/latest'))->assets[0]->browser_download_url);
" > phapp
chmod +x phapp

# Optional: Ensure ~/bin exists and configure it to be available in $PATH.
[ -d ~/bin ] || mkdir ~/bin
echo $PATH | grep -q ~/bin || (echo "export PATH=~/bin:\$PATH" >> ~/.bashrc && export PATH=~/bin:$PATH)

# Make phapp executable from everywhere by moving to a destination available in $PATH.
# If you skipped the optional step above, be sure to move it to a suiting destination.
mv phapp ~/bin/phapp

Updating

Run, (*3)

 phapp self:update

Usage

Run phapp list to show a list of support commands and use phapp command --help for more information about a command. The list of currently available commands is:, (*4)

  build                 Builds the project with the current code checkout.
  clone                 Clones a Phapp project.
  create                Creates a new project base on a given template.
  help                  Displays help for a command
  init                  Initializes the app.
  install               Installs the application.
  list                  Lists commands
  setup                 Setups the phapp environment.
  status                Checks for a working and installed application.
  update                Updates the app.
 build
  build:branch          Builds a given branch.
  build:clean           Cleans all build related files.
 git
  git:pull              Updates local branches by pull from remote repositories.
  git:setup-remotes     Configures Git remote repositories.
 init
  init:manifest         Initializes a new phapp.yml for your project.
 self
  self:update           Updates the installed phar.

phapp.yml

An application provides basic metadata and customizes commands in its phapp.yml, the phapp manifest. See examples/phapp.yml for an example., (*5)

Phapp environment variables

Commands defined in phapp.yml may make use of the phapp environment variables., (*6)

Dotenv support

Phapp environment variables are either set by the environment; i.e. the host, or via a .env file., (*7)

In order to help with initializing the environment based upon one or multiple .env files the environment command may be used. This command is prepended the other commands (except setup) such that they may rely on the initialized environment., (*8)

Thus, the .env file can be written as part of the setup command and sourced as part of the environment command., (*9)

Available variables

Available environment variables are / must be:, (*10)

Variable Description Example value
PHAPP_ENV The environment name. E.g., local, test or live live
PHAPP_ENV_TYPE The environment type; e.g. an id for the hosting environment or type of server. acquia
PHAPP_ENV_MODE The environment mode; valid values are: production, development production
PHAPP_BASE_URL The base URL of the app. https://example.com

Optional environment variables are:, (*11)

Variable Description Example value
PHAPP_ENV_COLOR A color used for indicating the current environment. 302f2f

Database connection.

PHAPP_ENV_MYSQL_DEFAULT_DATABASE=database
PHAPP_ENV_MYSQL_DEFAULT_USERNAME=user
PHAPP_ENV_MYSQL_DEFAULT_PASSWORD=pass
PHAPP_ENV_MYSQL_DEFAULT_HOST=localhost
PHAPP_ENV_MYSQL_DEFAULT_PORT="3306"

Various other variables provided by the environment.

PHAPP_ENV_DUMP_DIR="/data/mysql_dumps/sync"
PHAPP_ENV_DUMP_DB_FILENAME="${PHAPP_ENV_MYSQL_DEFAULT_DATABASE}-$(date -d "1 day ago" +%Y%m%d).sql.gz"

Phapp development

Build a new phar

The phar is built using box, for details see https://github.com/box-project/box. To built the phar just run:, (*12)

 composer install --dev
 composer build

Create a new release

  • Tag a new version and push it.
  • Build a new phar (see above).
  • Upload the new phar at the github release page. Keep the filename as is.
  • Note that the packagist API is not updated immediately. Thus it takes a few minutes until the new release is picked up by the self:update command.

The Versions

15/05 2018

dev-master

9999999-dev

Provides standardized console commands for PHP applications.

  Sources   Download

MIT

The Requires

 

by drunomics GmbH

15/05 2018

0.6.6

0.6.6.0

Provides standardized console commands for PHP applications.

  Sources   Download

MIT

The Requires

 

by drunomics GmbH

03/05 2018

0.6.5

0.6.5.0

Provides standardized console commands for PHP applications.

  Sources   Download

MIT

The Requires

 

by drunomics GmbH

03/05 2018

0.6.4

0.6.4.0

Provides standardized console commands for PHP applications.

  Sources   Download

MIT

The Requires

 

by drunomics GmbH

30/04 2018

0.6.3

0.6.3.0

Provides standardized console commands for PHP applications.

  Sources   Download

MIT

The Requires

 

by drunomics GmbH

20/04 2018

0.6.2

0.6.2.0

Provides standardized console commands for PHP applications.

  Sources   Download

MIT

The Requires

 

by drunomics GmbH

20/04 2018

0.6.1

0.6.1.0

Provides standardized console commands for PHP applications.

  Sources   Download

MIT

The Requires

 

by drunomics GmbH

19/04 2018

0.6.0

0.6.0.0

Provides standardized console commands for PHP applications.

  Sources   Download

MIT

The Requires

 

by drunomics GmbH

27/03 2018

0.6.0-beta10

0.6.0.0-beta10

Provides standardized console commands for PHP applications.

  Sources   Download

MIT

The Requires

 

by drunomics GmbH

26/03 2018

0.6.0-beta9

0.6.0.0-beta9

Provides standardized console commands for PHP applications.

  Sources   Download

MIT

The Requires

 

by drunomics GmbH

26/03 2018

0.6.0-beta8

0.6.0.0-beta8

Provides standardized console commands for PHP applications.

  Sources   Download

MIT

The Requires

 

by drunomics GmbH

26/03 2018

dev-feature/MFD-128

dev-feature/MFD-128

Provides standardized console commands for PHP applications.

  Sources   Download

MIT

The Requires

 

by drunomics GmbH

14/03 2018

0.6.0-beta7

0.6.0.0-beta7

Provides standardized console commands for PHP applications.

  Sources   Download

MIT

The Requires

 

by drunomics GmbH

07/03 2018

0.6.0-beta6

0.6.0.0-beta6

Provides standardized console commands for PHP applications.

  Sources   Download

MIT

The Requires

 

by drunomics GmbH

09/02 2018

0.6.0-beta5

0.6.0.0-beta5

Provides standardized console commands for PHP applications.

  Sources   Download

MIT

The Requires

 

by drunomics GmbH

07/02 2018

0.6.0-beta4

0.6.0.0-beta4

Provides standardized console commands for PHP applications.

  Sources   Download

MIT

The Requires

 

by drunomics GmbH

07/02 2018

0.6.0-beta3

0.6.0.0-beta3

Provides standardized console commands for PHP applications.

  Sources   Download

MIT

The Requires

 

by drunomics GmbH

31/01 2018

0.6.0-beta2

0.6.0.0-beta2

Provides standardized console commands for PHP applications.

  Sources   Download

MIT

The Requires

 

by drunomics GmbH

28/01 2018

0.6.0-beta1

0.6.0.0-beta1

Provides standardized console commands for PHP applications.

  Sources   Download

MIT

The Requires

 

by drunomics GmbH

12/12 2017

0.5.0

0.5.0.0

Provides standardized console commands for PHP applications.

  Sources   Download

MIT

The Requires

 

by drunomics GmbH

22/11 2017

0.5.0-beta2

0.5.0.0-beta2

Provides standardized console commands for PHP applications.

  Sources   Download

MIT

The Requires

 

by drunomics GmbH

21/11 2017

0.5.0-beta1

0.5.0.0-beta1

Provides standardized console commands for PHP applications.

  Sources   Download

MIT

The Requires

 

by drunomics GmbH

06/11 2017

0.4.0

0.4.0.0

Provides standardized console commands for PHP applications.

  Sources   Download

MIT

The Requires

 

by drunomics GmbH

17/07 2017

0.3.4

0.3.4.0

Provides standardized console commands for PHP applications.

  Sources   Download

MIT

The Requires

 

by drunomics GmbH

17/07 2017

0.3.3

0.3.3.0

Provides standardized console commands for PHP applications.

  Sources   Download

MIT

The Requires

 

by drunomics GmbH

17/07 2017

0.3.2

0.3.2.0

Provides standardized console commands for PHP applications.

  Sources   Download

MIT

The Requires

 

by drunomics GmbH

17/07 2017

0.3.1

0.3.1.0

Provides standardized console commands for PHP applications.

  Sources   Download

MIT

The Requires

 

by drunomics GmbH

12/07 2017

0.3.0

0.3.0.0

Provides standardized console commands for PHP applications.

  Sources   Download

MIT

The Requires

 

by drunomics GmbH

01/01 2017

0.2.3

0.2.3.0

Provides standardized console commands for PHP applications.

  Sources   Download

MIT

The Requires

 

by drunomics GmbH

01/01 2017

0.2.2

0.2.2.0

Provides standardized console commands for PHP applications.

  Sources   Download

MIT

The Requires

 

by drunomics GmbH

01/01 2017

0.2.1

0.2.1.0

Provides standardized console commands for PHP applications.

  Sources   Download

MIT

The Requires

 

by drunomics GmbH

11/12 2016

0.2.0

0.2.0.0

Provides standardized console commands for PHP applications.

  Sources   Download

MIT

The Requires

 

by drunomics GmbH

09/12 2016

0.1.2

0.1.2.0

Provides standardized console commands for PHP applications.

  Sources   Download

MIT

The Requires

 

by drunomics GmbH