attlaz/adapter-base

Base adapter as building block and tool collection for Attlaz adapters


README

Latest Stable Version

The base building block and tool collection for PHP adapters on Attlaz, a cloud-based iPaaS (Integration Platform as a Service). Attlaz adapters (Magento, DBFact and others) extend the abstractions in this package to connect to external systems.

Requirements

  • PHP 8.4+

Installation

composer require attlaz/adapter-base

What's included

Building blocks for connecting an adapter to an external system, under the Attlaz\Adapter\Base namespace:

  • Remote services — abstractions for talking to external systems: SQL (SqlRemoteService), SSH (SSH2RemoteService), SOAP (SoapRemoteService), Redis (RedisRemoteService) and Elasticsearch (ElasticsearchRemoteService), all built on a common BaseRemoteService.
  • Connection factoriesSqlFactory, SshFactory and SftpFactory, including SSH tunnelling for reaching systems behind a bastion host.
  • Repository patternBaseRepository as the base for an adapter's data access.
  • Helpers — SQL change detection, snapshots, and port/connection utilities.

Usage

Adapters build on these classes rather than using the package standalone — an adapter typically extends a RemoteService to reach its external system and a BaseRepository for data access. The first-party Attlaz adapters (e.g. Magento 2, DBFact) are built this way.

Documentation

Full documentation at docs.attlaz.com.

Development

Run static analysis and tests via the bundled Attlaz PHP image:

docker run -it -v .:/app -w /app --rm attlaz/php:8.4 composer phpstan
docker run -it -v .:/app -w /app --rm attlaz/php:8.4 php vendor/bin/phpunit tests/

Getting help

License

MIT