form-synergy/localize-fallback

This script will download and localize all modules within a strategy. If the connection between the API and FS service is broken, the javaScript client will re-rout simple interactions locally.

dev-master 2019-04-07 11:31 UTC

This package is auto-updated.

Last update: 2022-01-07 17:41:44 UTC


README

This script will download and localize all modules within a strategy. If the connection between the API and FS service is broken, the javaScript client will re-rout simple interactions locally.

Install using composer

composer require form-synergy/custom-module

Include the library

require '/vendor/autoload.php';

Enable session management

\FormSynergy\Session::enable();

Import the Form Synergy class

use \FormSynergy\Fs as FS;

You will need to retrieve your credentials in the Form Synergy console.

Console Access: https://formsynergy.com/console/

  • $profileid = '';
  • $apikey = '';
  • $apisecret = '';

If you are a reseller

  • $resellerid = '';

Configuration

FS::Config([
    'version' => 'v1',
    'protocol' => 'https',
    'endpoint' => 'api.formsynergy.com',
    'apikey' => $apikey,
    'secretkey' => $secretkey,
     //'resellerid' => $resellerid,  If you are a reseller
    'max_auth_count' => 15,
]);

local storage

Enable local storage to store downloads and responses.

FS::Storage( '/', 'local-storage' );

Load account

Load and start managing an account.

$api = FS::Api()->Load($profileid);

Run script

Update modid, the unique identifier of the strategy.

\FormSynergy\Localize_Fallback::Run([
    'modid' => '',
])