@@ -32,52 +32,52 @@ |
||
| 32 | 32 | |
| 33 | 33 | class RefreshWebcalJobRegistrar implements IRepairStep { |
| 34 | 34 | |
| 35 | - /** @var IDBConnection */ |
|
| 36 | - private $connection; |
|
| 35 | + /** @var IDBConnection */ |
|
| 36 | + private $connection; |
|
| 37 | 37 | |
| 38 | - /** @var IJobList */ |
|
| 39 | - private $jobList; |
|
| 38 | + /** @var IJobList */ |
|
| 39 | + private $jobList; |
|
| 40 | 40 | |
| 41 | - /** |
|
| 42 | - * FixBirthdayCalendarComponent constructor. |
|
| 43 | - * |
|
| 44 | - * @param IDBConnection $connection |
|
| 45 | - * @param IJobList $jobList |
|
| 46 | - */ |
|
| 47 | - public function __construct(IDBConnection $connection, IJobList $jobList) { |
|
| 48 | - $this->connection = $connection; |
|
| 49 | - $this->jobList = $jobList; |
|
| 50 | - } |
|
| 41 | + /** |
|
| 42 | + * FixBirthdayCalendarComponent constructor. |
|
| 43 | + * |
|
| 44 | + * @param IDBConnection $connection |
|
| 45 | + * @param IJobList $jobList |
|
| 46 | + */ |
|
| 47 | + public function __construct(IDBConnection $connection, IJobList $jobList) { |
|
| 48 | + $this->connection = $connection; |
|
| 49 | + $this->jobList = $jobList; |
|
| 50 | + } |
|
| 51 | 51 | |
| 52 | - /** |
|
| 53 | - * @inheritdoc |
|
| 54 | - */ |
|
| 55 | - public function getName() { |
|
| 56 | - return 'Registering background jobs to update cache for webcal calendars'; |
|
| 57 | - } |
|
| 52 | + /** |
|
| 53 | + * @inheritdoc |
|
| 54 | + */ |
|
| 55 | + public function getName() { |
|
| 56 | + return 'Registering background jobs to update cache for webcal calendars'; |
|
| 57 | + } |
|
| 58 | 58 | |
| 59 | - /** |
|
| 60 | - * @inheritdoc |
|
| 61 | - */ |
|
| 62 | - public function run(IOutput $output) { |
|
| 63 | - $query = $this->connection->getQueryBuilder(); |
|
| 64 | - $query->select(['principaluri', 'uri']) |
|
| 65 | - ->from('calendarsubscriptions'); |
|
| 66 | - $stmt = $query->execute(); |
|
| 59 | + /** |
|
| 60 | + * @inheritdoc |
|
| 61 | + */ |
|
| 62 | + public function run(IOutput $output) { |
|
| 63 | + $query = $this->connection->getQueryBuilder(); |
|
| 64 | + $query->select(['principaluri', 'uri']) |
|
| 65 | + ->from('calendarsubscriptions'); |
|
| 66 | + $stmt = $query->execute(); |
|
| 67 | 67 | |
| 68 | - $count = 0; |
|
| 69 | - while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { |
|
| 70 | - $args = [ |
|
| 71 | - 'principaluri' => $row['principaluri'], |
|
| 72 | - 'uri' => $row['uri'], |
|
| 73 | - ]; |
|
| 68 | + $count = 0; |
|
| 69 | + while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { |
|
| 70 | + $args = [ |
|
| 71 | + 'principaluri' => $row['principaluri'], |
|
| 72 | + 'uri' => $row['uri'], |
|
| 73 | + ]; |
|
| 74 | 74 | |
| 75 | - if (!$this->jobList->has(RefreshWebcalJob::class, $args)) { |
|
| 76 | - $this->jobList->add(RefreshWebcalJob::class, $args); |
|
| 77 | - $count++; |
|
| 78 | - } |
|
| 79 | - } |
|
| 75 | + if (!$this->jobList->has(RefreshWebcalJob::class, $args)) { |
|
| 76 | + $this->jobList->add(RefreshWebcalJob::class, $args); |
|
| 77 | + $count++; |
|
| 78 | + } |
|
| 79 | + } |
|
| 80 | 80 | |
| 81 | - $output->info("Added $count background jobs to update webcal calendars"); |
|
| 82 | - } |
|
| 81 | + $output->info("Added $count background jobs to update webcal calendars"); |
|
| 82 | + } |
|
| 83 | 83 | } |
@@ -66,7 +66,7 @@ |
||
| 66 | 66 | $stmt = $query->execute(); |
| 67 | 67 | |
| 68 | 68 | $count = 0; |
| 69 | - while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { |
|
| 69 | + while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { |
|
| 70 | 70 | $args = [ |
| 71 | 71 | 'principaluri' => $row['principaluri'], |
| 72 | 72 | 'uri' => $row['uri'], |
@@ -31,78 +31,78 @@ |
||
| 31 | 31 | |
| 32 | 32 | class Version1006Date20180628111625 extends SimpleMigrationStep { |
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * @param IOutput $output |
|
| 36 | - * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
| 37 | - * @param array $options |
|
| 38 | - * @return null|ISchemaWrapper |
|
| 39 | - */ |
|
| 40 | - public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) { |
|
| 41 | - /** @var ISchemaWrapper $schema */ |
|
| 42 | - $schema = $schemaClosure(); |
|
| 34 | + /** |
|
| 35 | + * @param IOutput $output |
|
| 36 | + * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
| 37 | + * @param array $options |
|
| 38 | + * @return null|ISchemaWrapper |
|
| 39 | + */ |
|
| 40 | + public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) { |
|
| 41 | + /** @var ISchemaWrapper $schema */ |
|
| 42 | + $schema = $schemaClosure(); |
|
| 43 | 43 | |
| 44 | - if (!$schema->hasTable('calendarsubscrobjects')) { |
|
| 45 | - $table = $schema->createTable('calendarsubscrobjects'); |
|
| 46 | - $table->addColumn('id', Type::BIGINT, [ |
|
| 47 | - 'autoincrement' => true, |
|
| 48 | - 'notnull' => true, |
|
| 49 | - 'length' => 11, |
|
| 50 | - 'unsigned' => true, |
|
| 51 | - ]); |
|
| 52 | - $table->addColumn('calendardata', Type::BLOB, [ |
|
| 53 | - 'notnull' => false, |
|
| 54 | - ]); |
|
| 55 | - $table->addColumn('uri', Type::STRING, [ |
|
| 56 | - 'notnull' => false, |
|
| 57 | - 'length' => 255, |
|
| 58 | - ]); |
|
| 59 | - $table->addColumn('subscriptionid', Type::BIGINT, [ |
|
| 60 | - 'notnull' => true, |
|
| 61 | - 'length' => 11, |
|
| 62 | - 'unsigned' => true, |
|
| 63 | - ]); |
|
| 64 | - $table->addColumn('lastmodified', Type::INTEGER, [ |
|
| 65 | - 'notnull' => false, |
|
| 66 | - 'length' => 10, |
|
| 67 | - 'unsigned' => true, |
|
| 68 | - ]); |
|
| 69 | - $table->addColumn('etag', Type::STRING, [ |
|
| 70 | - 'notnull' => false, |
|
| 71 | - 'length' => 32, |
|
| 72 | - ]); |
|
| 73 | - $table->addColumn('size', Type::BIGINT, [ |
|
| 74 | - 'notnull' => true, |
|
| 75 | - 'length' => 11, |
|
| 76 | - 'unsigned' => true, |
|
| 77 | - ]); |
|
| 78 | - $table->addColumn('componenttype', Type::STRING, [ |
|
| 79 | - 'notnull' => false, |
|
| 80 | - 'length' => 8, |
|
| 81 | - ]); |
|
| 82 | - $table->addColumn('firstoccurence', Type::BIGINT, [ |
|
| 83 | - 'notnull' => false, |
|
| 84 | - 'length' => 11, |
|
| 85 | - 'unsigned' => true, |
|
| 86 | - ]); |
|
| 87 | - $table->addColumn('lastoccurence', Type::BIGINT, [ |
|
| 88 | - 'notnull' => false, |
|
| 89 | - 'length' => 11, |
|
| 90 | - 'unsigned' => true, |
|
| 91 | - ]); |
|
| 92 | - $table->addColumn('uid', Type::STRING, [ |
|
| 93 | - 'notnull' => false, |
|
| 94 | - 'length' => 255, |
|
| 95 | - ]); |
|
| 96 | - $table->addColumn('classification', Type::INTEGER, [ |
|
| 97 | - 'notnull' => false, |
|
| 98 | - 'default' => 0, |
|
| 99 | - ]); |
|
| 100 | - $table->setPrimaryKey(['id']); |
|
| 101 | - $table->addUniqueIndex(['subscriptionid', 'uri'], 'subobjects_index'); |
|
| 102 | - } |
|
| 44 | + if (!$schema->hasTable('calendarsubscrobjects')) { |
|
| 45 | + $table = $schema->createTable('calendarsubscrobjects'); |
|
| 46 | + $table->addColumn('id', Type::BIGINT, [ |
|
| 47 | + 'autoincrement' => true, |
|
| 48 | + 'notnull' => true, |
|
| 49 | + 'length' => 11, |
|
| 50 | + 'unsigned' => true, |
|
| 51 | + ]); |
|
| 52 | + $table->addColumn('calendardata', Type::BLOB, [ |
|
| 53 | + 'notnull' => false, |
|
| 54 | + ]); |
|
| 55 | + $table->addColumn('uri', Type::STRING, [ |
|
| 56 | + 'notnull' => false, |
|
| 57 | + 'length' => 255, |
|
| 58 | + ]); |
|
| 59 | + $table->addColumn('subscriptionid', Type::BIGINT, [ |
|
| 60 | + 'notnull' => true, |
|
| 61 | + 'length' => 11, |
|
| 62 | + 'unsigned' => true, |
|
| 63 | + ]); |
|
| 64 | + $table->addColumn('lastmodified', Type::INTEGER, [ |
|
| 65 | + 'notnull' => false, |
|
| 66 | + 'length' => 10, |
|
| 67 | + 'unsigned' => true, |
|
| 68 | + ]); |
|
| 69 | + $table->addColumn('etag', Type::STRING, [ |
|
| 70 | + 'notnull' => false, |
|
| 71 | + 'length' => 32, |
|
| 72 | + ]); |
|
| 73 | + $table->addColumn('size', Type::BIGINT, [ |
|
| 74 | + 'notnull' => true, |
|
| 75 | + 'length' => 11, |
|
| 76 | + 'unsigned' => true, |
|
| 77 | + ]); |
|
| 78 | + $table->addColumn('componenttype', Type::STRING, [ |
|
| 79 | + 'notnull' => false, |
|
| 80 | + 'length' => 8, |
|
| 81 | + ]); |
|
| 82 | + $table->addColumn('firstoccurence', Type::BIGINT, [ |
|
| 83 | + 'notnull' => false, |
|
| 84 | + 'length' => 11, |
|
| 85 | + 'unsigned' => true, |
|
| 86 | + ]); |
|
| 87 | + $table->addColumn('lastoccurence', Type::BIGINT, [ |
|
| 88 | + 'notnull' => false, |
|
| 89 | + 'length' => 11, |
|
| 90 | + 'unsigned' => true, |
|
| 91 | + ]); |
|
| 92 | + $table->addColumn('uid', Type::STRING, [ |
|
| 93 | + 'notnull' => false, |
|
| 94 | + 'length' => 255, |
|
| 95 | + ]); |
|
| 96 | + $table->addColumn('classification', Type::INTEGER, [ |
|
| 97 | + 'notnull' => false, |
|
| 98 | + 'default' => 0, |
|
| 99 | + ]); |
|
| 100 | + $table->setPrimaryKey(['id']); |
|
| 101 | + $table->addUniqueIndex(['subscriptionid', 'uri'], 'subobjects_index'); |
|
| 102 | + } |
|
| 103 | 103 | |
| 104 | - return $schema; |
|
| 105 | - } |
|
| 104 | + return $schema; |
|
| 105 | + } |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | |