Download the PHP package gsl/civicrm-cli-utils without Composer

On this page you can find all versions of the php package gsl/civicrm-cli-utils. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package civicrm-cli-utils

civicrm-cli-utils

Mixed bag of civicrm command line utils. Work in progress.

Install

composer install to fetch dependency: wp-cli/php-cli-tools

Config file

You can place a .conf file in the root of the project to save yourself some typing. See includes/base.php ::getConfig(). A good config to have in there is CIVICRM_ROOT. Also see the option to specifcy column mappings for includes/base.php::mapColumns()

Example

clean is an example usage of these utils. It deletes, un-deletes, as well as imports contacts piped to STDIN. Use the source, Luke.

Caution

For pre-4.7 versions of civicrm, cvCli() requires a core hack to add --json output option.

a hasty orientation over chat:

"clean" started off as an example integration... but then Toby generalized it... so... there ya go. I'm looking to figure out what will need to be extended you should skim this file: https://github.com/ginkgostreet/civicrm-cli-utils/blob/master/includes/base.php just look at the function names, parseCsv() being a key one.

oh right, getConfig is another. that might be where you got hung-up last time. that is not the only way to set this up, but probably the easiest... put a .conf file in the root of this project, and set the path to civicrm.

so... I think creating a file LIKE createContact.php https://github.com/ginkgostreet/civicrm-cli-utils/blob/master/includes/createContact.php .. e.g. createParticipant.php yes, it involves coding... but it is pretty declarative.

the suffix _run() is what the core will look for to implement a command, e.g. createParticipant. You can see around the end of clean.php... it looks for a file that matches the command and then expects that loaded by that file... a function of similar name with the suffix, _run().

so... createContact_run()... basically gets the global configs (which just has the path to Civi), and then sets some constants... and then it does:

$main = 'processContactsForImport';
withFile($input, $main);

which says... for each line of the input file, call the function processContactsForImport. ... which is defined in the same file. ... and that function, recieves the line, already parsed out into an array, and then uses the core utility to call the civicrm API.


All versions of civicrm-cli-utils with dependencies

PHP Build Version
Package Version
Requires wp-cli/php-cli-tools Version 0.10.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package gsl/civicrm-cli-utils contains the following files

Loading the files please wait ....