1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace OCA\audioplayer\Migration; |
6
|
|
|
|
7
|
|
|
use Closure; |
8
|
|
|
use OCP\DB\ISchemaWrapper; |
9
|
|
|
use OCP\Migration\IOutput; |
10
|
|
|
use OCP\Migration\SimpleMigrationStep; |
11
|
|
|
use OCP\IDBConnection; |
12
|
|
|
|
13
|
|
|
/** |
14
|
|
|
* Auto-generated migration step: Please modify to your needs! |
15
|
|
|
*/ |
16
|
|
|
class Version2102Date20200712213332 extends SimpleMigrationStep |
17
|
|
|
{ |
18
|
|
|
|
19
|
|
|
/** @var IDBConnection */ |
20
|
|
|
private $connection; |
21
|
|
|
|
22
|
|
|
public function __construct(IDBConnection $connection) |
23
|
|
|
{ |
24
|
|
|
$this->connection = $connection; |
25
|
|
|
} |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* @param IOutput $output |
29
|
|
|
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
30
|
|
|
* @param array $options |
31
|
|
|
*/ |
32
|
|
|
public function preSchemaChange(IOutput $output, Closure $schemaClosure, array $options) |
33
|
|
|
{ |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* @param IOutput $output |
38
|
|
|
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
39
|
|
|
* @param array $options |
40
|
|
|
* @return null|ISchemaWrapper |
41
|
|
|
*/ |
42
|
|
|
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) |
43
|
|
|
{ |
44
|
|
|
/** @var ISchemaWrapper $schema */ |
45
|
|
|
$schema = $schemaClosure(); |
46
|
|
|
|
47
|
|
|
return $schema; |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* @param IOutput $output |
52
|
|
|
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
53
|
|
|
* @param array $options |
54
|
|
|
*/ |
55
|
|
|
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options) |
56
|
|
|
{ |
57
|
|
|
$query = $this->connection->getQueryBuilder(); |
58
|
|
|
$query->insert('audioplayer_whats_new') |
|
|
|
|
59
|
|
|
->values([ |
60
|
|
|
'version' => $query->createNamedParameter('2.11.0'), |
61
|
|
|
'data' => $query->createNamedParameter('{"changelogURL":"https:\/\/github.com\/rello\/audioplayer\/blob\/master\/CHANGELOG.md","whatsNew":{ |
62
|
|
|
"en":{"regular":["Hardware media buttons","Better repeat/shuffle","AIF mime type","Remember playback position"],"admin":["New Features apply to users"]}, |
63
|
|
|
"de":{"regular":["Hardware Medien Tasten","Besserer Repeat/Shuffle","AIF mime type","Titelposition werden gespeichert"],"admin":["Nur User Features"]} |
64
|
|
|
}}'), |
65
|
|
|
]) |
66
|
|
|
->execute(); |
67
|
|
|
} |
68
|
|
|
} |
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.