Table of Contents

Development Workflow Utilities

The following command line utilities support a development workflow, including version control, code generation and templates, and API CLI's.

It is assumed that you already have git installed.

PHP Composer

https://getcomposer.org/doc/

Confirm that the install location is in your $PATH.

export INSTALL_PATH='/usr/local/bin'

# download install-composer.php:
wget -q 'https://getcomposer.org/installer' -O 'install-composer.php'

# install: verify install-composer.php
php install-composer.php --install-dir=$(INSTALL_PATH) --filename=composer

Confirm the install by running composer on the command line and you should see:

mzd☯ artichoke :>composer
   ______
  / ____/___  ____ ___  ____  ____  ________  _____
 / /   / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__  )  __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
                    /_/
Composer version 1.8.4 2019-02-11 10:52:10

Usage:
  command [options] [arguments]

WP CLI

https://make.wordpress.org/cli/handbook/

Download the PHP Archive. A CLI HTTP client like curl or wget is recommended.

curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar

Copy the archive to a location in your $PATH.

mv wp-cli.phar /usr/local/bin/wp

And verify the install

wp --info

CiviCRM CLI

https://github.com/civicrm/cv/blob/master/README.md

Download and put cv somewhere in your $PATH.

curl -O https://download.civicrm.org/cv/cv.phar
chmod ugo+x cv.phar
mv cv.phar /usr/local/bin/cv

CiviCRM Extension Development Tool (Civix)

https://docs.civicrm.org/dev/en/latest/extensions/civix/

In CiviCRM plugins are called, Extensions. Yet, in the civix help, extensions are called "modules". For example: civix generate:module. (Don't ask me why, but CiviCRM was grounded in Drupal development for many years.)

Most circumstances call for extending CiviCRM by creating an extension, though other (historic) techniques also exist.

curl https://download.civicrm.org/civix/civix.phar -o /usr/local/bin/civix
chmod +x /usr/local/bin/civix

Besides generating extension boilerplate, civix is often used to do the following:

  • create angular modules
  • create custom API end-points
  • create page, forms, and report templates.
  • add custom entries to the CiviCRM menu and routing