alexacrm/php-crm-toolkit
Composer 安装命令:
composer require alexacrm/php-crm-toolkit
包简介
PHP Toolkit for Microsoft Dynamics CRM
关键字:
README 文档
README
CRM Toolkit for PHP provides integration with Microsoft Dynamics CRM in PHP applications.
This toolkit supports only Dynamics 365 SOAP interface. For PHP implementation of the Dynamics 365 Web API, see dynamics-webapi-toolkit project.
Installation
Install the latest version with
$ composer require alexacrm/php-crm-toolkit:dev-master
Examples
/** * Use init.php if you didn't install the package via Composer */ require_once 'vendor/autoload.php'; use AlexaCRM\CRMToolkit\Client as OrganizationService; use AlexaCRM\CRMToolkit\Settings; $contactId = '1d2fc62f-1c56-448b-b546-edfb6d6fec5c'; /* * WS-Trust is now deprecated $options = [ 'serverUrl' => 'https://org.crmN.dynamics.com', 'username' => 'portal@org.onmicrosoft.com', 'password' => 'portalPassword', 'authMode' => 'OnlineFederation', ]; $serviceSettings = new Settings( $options ); */ $options = [ 'serverUrl' => 'https://org.crmN.dynamics.com', 'applicationId' => '1111c62f-dead-beef-dead-edfbffffec5c', 'clientSecret' => 'whateveristhesecretgenerated', 'authMode' => 'OnlineFederation', 'authMethod' => 'sharedSecretAuth', 'cache' => new AlexaCRM\CRMToolkit\NullCache(), ]; // This code uses NullCache which allows to connect and run the operations // but it is very inefficient and should not be used in production. // You can use any PSR-6 compliant cache implementation. $serviceSettings = new OnlineS2SSecretAuthenticationSettings( $options ); $service = new OrganizationService( $serviceSettings ); // retrieve a contact and update its fields $contact = $service->entity( 'contact', $guid ); $contact->firstname = explode( '@', $contact->emailaddress1 )[0]; $contact->update(); printf( 'Info for %s %s updated.', $contact->firstname, $contact->lastname ); // create a new contact $contact = $service->entity( 'contact' ); $contact->firstname = 'John'; $contact->lastname = 'Doe'; $contact->emailaddress1 = 'john.doe@example.com'; $contactId = $contact->create(); // delete a contact $contact->delete(); // execute an action $whoAmIResponse = $service->executeAction( 'WhoAmI' ); echo 'Organization ID: ' . $whoAmIResponse->OrganizationId; // inject cache repo // must be instance of AlexaCRM\CRMToolkit\CacheInterface $cacheRepo = Cache::instance(); $service = new Client( $serviceSettings, $cacheRepo );
In /examples/ you can find a few examples of toolkit usage. Copy config.example.php to config.php, set up credentials for your CRM and you are ready to go!
Contributing
Pull requests are gladly accepted in the GitHub repository.
License
Copyright (c) 2016 AlexaCRM.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, version 3.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Lesser Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see http://www.gnu.org/licenses/.
alexacrm/php-crm-toolkit 适用场景与选型建议
alexacrm/php-crm-toolkit 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 301.63k 次下载、GitHub Stars 达 107, 最近一次更新时间为 2016 年 08 月 01 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「sdk」 「crm」 「Dynamics CRM」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 alexacrm/php-crm-toolkit 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 alexacrm/php-crm-toolkit 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 alexacrm/php-crm-toolkit 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A PHP client for the Salesforce SOAP API
Command-line utility for Vtiger CRM.
Library for Kommo (AmoCRM)
Laravel Package for capsule CRM integration
File explorer for Appui
Alfabank REST API integration
统计信息
- 总下载量: 301.63k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 109
- 点击次数: 20
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: LGPL-3.0
- 更新时间: 2016-08-01