Download the PHP package civicrm/cv-lib without Composer
On this page you can find all versions of the php package civicrm/cv-lib. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package cv-lib
cv-lib
cv-lib is a subpackage provided by cv. It defines the essential core of cv -- locating and booting CiviCRM.
The canonical home for developing this code is in civicrm/cv. It will be periodically published to the read-only mirror civicrm/cv-lib to facilitate usage by other projects.
Installation
Primary API
The library provides a handful of supported classes:
-
Civi\Cv\CmsBootstrapsupports the standard boot protocol. In this protocol, we search for a recognized UF/CMS, start that, and then start CiviCRM. The advantage of this protocol is that it is more representative of a typical HTTP-request. (Events and add-ons supported by UF/CMS and CRM will tend to work more normally.)Basic usage:
Or you can pass in options:
End-users may fine-tune the behavior by setting
CIVICRM_BOOT(as documented incv). -
Civi\Cv\Bootstrapsupports the legacy boot protocol. In this protocol, we search forcivicrm.settings.phpand start CiviCRM. Finally, we usecivicrm-coreAPI's to start the associated UF/CMS.Basic usage:
End-users may fine-tune the behavior by setting
CIVICRM_SETTING(as documented incv).
Both bootstrap mechanisms accept an optional set of hints and overrides.
For example, by default, cv-lib will print errors to STDERR, but you can override the
handling of messages:
For more info about $options, see the docblocks.
Experimental API
Other classes are included, but their contracts are subject to change. These include higher-level helpers for building Symfony Console apps that incorporate Civi bootstrap behaviors.
BootTraithas previously suggested as an experimentally available API (circa v0.3.44). It changed significantly (circa v0.3.56), whereconfigureBootOptions()was replaced by$bootOptions,mergeDefaultBootDefinition(), andmergeBootDefinition().- As an alternative, consider the classes
BaseApplicationandCvCommandif you aim to build a tool using Symfony Console and Cv Lib.
All versions of cv-lib with dependencies
ext-json Version *