1 |
efrain |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
namespace Packback\Lti1p3\Interfaces;
|
|
|
4 |
|
|
|
5 |
use Packback\Lti1p3\LtiMessageLaunch;
|
|
|
6 |
|
|
|
7 |
/**
|
|
|
8 |
* This is an optional interface if an LTI 1.3 tool supports migrations
|
|
|
9 |
* from LTI 1.1 compatible installations.
|
|
|
10 |
*
|
|
|
11 |
* To use this, just have whatever class you create that implements IDatabase
|
|
|
12 |
* also implement this interface.
|
|
|
13 |
*/
|
|
|
14 |
interface IMigrationDatabase extends IDatabase
|
|
|
15 |
{
|
|
|
16 |
/**
|
|
|
17 |
* Using the LtiMessageLaunch return an array of matching LTI 1.1 keys
|
|
|
18 |
*
|
|
|
19 |
* @return array<\Packback\Lti1p3\Lti1p1Key>
|
|
|
20 |
*/
|
|
|
21 |
public function findLti1p1Keys(LtiMessageLaunch $launch): array;
|
|
|
22 |
|
|
|
23 |
/**
|
|
|
24 |
* Given an LtiMessageLaunch, return true if this tool should migrate from 1.1 to 1.3
|
|
|
25 |
*/
|
|
|
26 |
public function shouldMigrate(LtiMessageLaunch $launch): bool;
|
|
|
27 |
|
|
|
28 |
/**
|
|
|
29 |
* This method should create a 1.3 deployment in your DB based on the LtiMessageLaunch.
|
|
|
30 |
* Previous to this, we validated the oauth_consumer_key_sign to ensure this migration
|
|
|
31 |
* can safely occur.
|
|
|
32 |
*/
|
|
|
33 |
public function migrateFromLti1p1(LtiMessageLaunch $launch): ?ILtiDeployment;
|
|
|
34 |
}
|