francisco-cardoso / artsoft-connector
Framework-agnostic PHP package for connecting to the ARTSOFT ERP system
Package info
github.com/developer-franciscocardoso/ARTSOFTConnector
pkg:composer/francisco-cardoso/artsoft-connector
Requires
- php: ^8.2
- ext-curl: *
- ext-simplexml: *
- psr/log: ^2.0|^3.0
Requires (Dev)
- illuminate/console: ^12.58
- illuminate/support: ^12.58
- phpstan/phpstan: ^1.12
- phpunit/phpunit: ^11.0
Suggests
- illuminate/console: Required to use the artsoft:publish Artisan command (^10.0|^11.0|^12.0)
- illuminate/support: Required to use the Laravel service provider (^10.0|^11.0|^12.0)
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