PHPackages                             apsconnect/connect-sdk-migration-framework - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. apsconnect/connect-sdk-migration-framework

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

apsconnect/connect-sdk-migration-framework
==========================================

Small middleware to ease the service migration from legacy to Connect.

16.1(6y ago)4707↓100%1Apache-2.0PHPPHP &gt;=5.6.0

Since Apr 24Pushed 6y ago6 watchersCompare

[ Source](https://github.com/cloudblue/connect-php-sdk-migration-framework)[ Packagist](https://packagist.org/packages/apsconnect/connect-sdk-migration-framework)[ RSS](/packages/apsconnect-connect-sdk-migration-framework/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

Connect Migration Middleware
============================

[](#connect-migration-middleware)

[![Build Status](https://camo.githubusercontent.com/72e4ec44ed058405d59ba5c4ea37af86424d755836e9f1f01950b184cf386416/68747470733a2f2f7472617669732d63692e636f6d2f696e6772616d6d6963726f2f636f6e6e6563742d7068702d73646b2d6d6967726174696f6e2d6672616d65776f726b2e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/ingrammicro/connect-php-sdk-migration-framework) [![Latest Stable Version](https://camo.githubusercontent.com/c2bb45fc00085fc1b1f8631be323b234fea439de564f2aa5990c512a63146d28/68747470733a2f2f706f7365722e707567782e6f72672f617073636f6e6e6563742f636f6e6e6563742d73646b2d6d6967726174696f6e2d6672616d65776f726b2f762f737461626c65)](https://packagist.org/packages/apsconnect/connect-sdk-migration-framework) [![License](https://camo.githubusercontent.com/45a0224943edc51330124e8db1305afd60dce82a6313641ac37c6f8c720122c8/68747470733a2f2f706f7365722e707567782e6f72672f617073636f6e6e6563742f636f6e6e6563742d73646b2d6d6967726174696f6e2d6672616d65776f726b2f6c6963656e7365)](https://packagist.org/packages/apsconnect/connect-sdk-migration-framework) [![codecov](https://camo.githubusercontent.com/8d9539c26dc3da4a207d9bff761daa5b908dd266f0be079697a6ed16abe61956/68747470733a2f2f636f6465636f762e696f2f67682f696e6772616d6d6963726f2f636f6e6e6563742d7068702d73646b2d6d6967726174696f6e2d6672616d65776f726b2f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/ingrammicro/connect-php-sdk-migration-framework)

Small middleware to ease the service migration from legacy to Connect

Installation
------------

[](#installation)

Install via ***composer***:

```
{
    "require": {
      "apsconnect/connect-sdk-migration-framework": "*"
    }
}
```

Usage
-----

[](#usage)

Once we have the package installed we need to create a new service provider to inject the middleware into our connector. We need to provide some basic configuration to our migrations service in order to properly migrate the incoming old data.

### Configuration parameters

[](#configuration-parameters)

ParameterTypeDescriptionlogger`Psr\Log\LoggerInterface`The logger instance of our connector.migrationFlag`string`The name of the Connect parameter that stores the legacy data in json format. Default value is `migration_info`serialize`bool`If true will automatically serialize any non-string value in the migration data on direct assignation flow. Default value is `false`validation`callable`Custom validation function. Not defined by default.onSuccess`callable`Custom function to execute on migration success. Not defined by default.onFail`callable`Custom function to execute on migration fail. Not defined by default.transformations`array`Assoc array with the connect param id as key and the rule to process the parameter value from the legacy data. Default value is an empty array.Input parameters:

- `validation`: `$migrationData`, `Request $request`, `Config $config`, `LoggerInterface $logger`
- `onSuccess`: `$migrationData`, `Request $request`, `Config $config`, `LoggerInterface $logger`
- `onFail`: `$migrationData`, `Request $request`, `Config $config`, `LoggerInterface $logger`, `MigrationAbortException $e`
- `transformations`: `$migrationData`, `Request $request`, `Config $config`, `LoggerInterface $logger`

```
