francisco-cardoso/artsoft-connector
最新稳定版本:v1.0.2
Composer 安装命令:
composer require francisco-cardoso/artsoft-connector
包简介
Framework-agnostic PHP package for connecting to the ARTSOFT ERP system
README 文档
README
Framework-agnostic PHP package for connecting to ARTSOFT.
Requirements
- PHP 8.2+
- ext-curl
- ext-simplexml
Install
composer require francisco-cardoso/artsoft-connector
For local workspace development (for example from ARTSOFTCustomer), use a path repository:
{
"repositories": [
{
"type": "path",
"url": "../ARTSOFTConnector",
"options": {
"symlink": true
}
}
],
"require": {
"francisco-cardoso/artsoft-connector": "^1.0"
}
}
Config
The package ships with a reusable PHP config file at config/artsoft.php.
If you want to copy that file into your own application, use the framework-agnostic publisher helper:
<?php declare(strict_types=1); use FranciscoCardoso\ArtsoftConnector\ServiceProviders\ArtsoftConnectorServiceProvider; require __DIR__ . '/vendor/autoload.php'; $provider = new ArtsoftConnectorServiceProvider(); $provider->publishConfig(__DIR__ . '/config/artsoft.php');
You can also load the bundled file directly with Artsoft::fromConfigFile() or require your own copied config file and pass the resulting array to Artsoft::create().
Usage
<?php declare(strict_types=1); use FranciscoCardoso\ArtsoftConnector\Artsoft; require __DIR__ . '/vendor/autoload.php'; $config = require __DIR__ . '/config/artsoft.php'; $service = Artsoft::create($config); $result = $service->request('ArtDB/_DbTables', '<root/>'); var_dump($result->toArray());
Laravel
The package is framework-agnostic, but ships with optional Laravel support.
The service provider is auto-discovered via Composer. If you have auto-discovery disabled, register it manually in bootstrap/providers.php:
FranciscoCardoso\ArtsoftConnector\ServiceProviders\Laravel\ArtsoftLaravelServiceProvider::class,
To publish the config file to config/artsoft.php, run:
php artisan artsoft:publish
To overwrite an already-published config file:
php artisan artsoft:publish --force
Alternatively, use the standard Laravel vendor publish tag:
php artisan vendor:publish --tag=artsoft-config
Once published, the config keys are available via config('artsoft.*') and can also be overridden with environment variables (see config/artsoft.php for the full list).
Main API
FranciscoCardoso\ArtsoftConnector\Artsoft::create()FranciscoCardoso\ArtsoftConnector\Contracts\ArtsoftServiceInterfaceFranciscoCardoso\ArtsoftConnector\Services\ArtsoftServiceFranciscoCardoso\ArtsoftConnector\DTO\Output\RequestResultDTO
Tooling
vendor/bin/phpunit --configuration phpunit.xml vendor/bin/phpstan analyse -c phpstan.neon
Documentation
- Full usage and expected example outputs:
docs/usage-and-examples.md - Runnable example scripts:
examples/basic.php,examples/advanced.php,examples/custom_connector.php
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 9
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-05-12