vitexsoftware/primaerp

基于PHP的库,用于轻松与primaERP API交互

dev-master 2023-11-28 12:41 UTC

This package is auto-updated.

Last update: 2024-08-28 14:17:33 UTC


README

用于轻松与ABRAprimaERP交互的PHP库

Source Code Latest Version Software License Build Status Code Coverage Total Downloads Latest stable

安装

composer require vitexsoftware/primaerp

配置

请设置以下常量

/*
 * primaERP API user comany/account name
 */
define('PRIMAERP_COMPANY', 'vitexsoftware');

/*
 * URL primaERP API
 */
define('PRIMAERP_URL',
    'https://'.constant('PRIMAERP_COMPANY').'.api.primaerp.com');

/*
 * Login is Email primaERP API user
 */
define('PRIMAERP_LOGIN', 'email@domain.tld');

/*
 * primaERP API user password
 */
define('PRIMAERP_PASSWORD', 'password');

/*
 * primaERP API KEY
 */
define('PRIMAERP_APIKEY', '1af7a44b-81f1-4de1-11e7-1e675acb1221');

或者可以在创建类实例时输入登录凭据。

$projector = new ApiClient(null, ['section' => 'time','user'=>'email@some.ser','password'=>'XXXX','apikey'=>'1af7a44b-81f1-4de1-11e7-1e675acb1221']);
$projects  = $projector->requestData('projects');

此设置方式优先级高于上述定义的常量。

Debian/Ubuntu

对于Linux,提供了.deb软件包。请使用repo

wget -O - http://v.s.cz/info@vitexsoftware.cz.gpg.key|sudo apt-key add -
echo deb http://v.s.cz/ stable main > /etc/apt/sources.list.d/ease.list
aptitude update
aptitude install php-primaerp