承接 gsl/civicrm-cli-utils 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

gsl/civicrm-cli-utils

Composer 安装命令:

composer require gsl/civicrm-cli-utils

包简介

Miscelanious utils. Bootstrap CiviCRM and wrap API for command-line use.

README 文档

README

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.

统计信息

  • 总下载量: 19
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2015-12-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固