webmarketer/webmarketer-plugin-core-php

2.2.0 2024-04-09 14:24 UTC

This package is auto-updated.

Last update: 2024-05-09 14:28:32 UTC


README

89253090?s=200&v=4

PHP Core plugin for Webmarketer tiers integrations

Latest Stable Version Total Downloads Latest Unstable Version PHP Version Require License

The official PHP Core bundle for Webmarketer plugins.

Install

To add this package, your project must meet several requirements :

This package is the core used by all Webmarketer tiers integrations and plugins (WordPress, Prestashop). It provides interfaces and utilities for any plugin.
It is not designed to work as a standalone and must be used along a plugin implementation.

This package wrap the PHP SDK for Webmarketer. Thereby, check that your project meet the SDK requirements too.

composer require webmarketer/webmarketer-php-core-plugin

Usage

try {
    // create an instance of the SDK with the desired configuration
    $client = new \Webmarketer\WebmarketerSdk([
        'credential' => '{ ...jsonSa }',
        'scopes' => 'test',
        'default_project_id' => 'webmarketer-awesome-project'
    ]);
} catch (\Webmarketer\Exception\DependencyException $dep_ex) {
    // SDK init throw a dependency exception if requirements are not meet (see Install)
} catch (\Webmarketer\Exception\CredentialException $cred_ex) {
    // SDK automatically try to authenticate you agains API
    // A credential exception could be throw if credentials are invalid
}

// SDK exposes resources services, use them to manipulate your resources
$event_type_service = $client->getEventTypeService();
$field_service = $client->getFieldService();

Integrations based on this package

Contributing

All SDK dependencies are managed via Composer :

composer install

Run all tests with PHPUnit and the configuration provided :

composer tests

Run all tests and check codecoverage (must be >= 80%) with PHPUnit :

composer tests-coverage

Lint code :

composer phpcs

Feel free to report issues and bugs directly on this repository.

Resources