@@ -31,90 +31,90 @@ |
||
31 | 31 | */ |
32 | 32 | class TasksList implements RequestHandlerInterface |
33 | 33 | { |
34 | - private ?AdminTasksModule $module; |
|
35 | - private TaskScheduleService $taskschedules_service; |
|
34 | + private ?AdminTasksModule $module; |
|
35 | + private TaskScheduleService $taskschedules_service; |
|
36 | 36 | |
37 | - /** |
|
38 | - * Constructor for TasksList Request Handler |
|
39 | - * |
|
40 | - * @param ModuleService $module_service |
|
41 | - * @param TaskScheduleService $taskschedules_service |
|
42 | - */ |
|
43 | - public function __construct( |
|
44 | - ModuleService $module_service, |
|
45 | - TaskScheduleService $taskschedules_service |
|
46 | - ) { |
|
47 | - $this->module = $module_service->findByInterface(AdminTasksModule::class)->first(); |
|
48 | - $this->taskschedules_service = $taskschedules_service; |
|
49 | - } |
|
37 | + /** |
|
38 | + * Constructor for TasksList Request Handler |
|
39 | + * |
|
40 | + * @param ModuleService $module_service |
|
41 | + * @param TaskScheduleService $taskschedules_service |
|
42 | + */ |
|
43 | + public function __construct( |
|
44 | + ModuleService $module_service, |
|
45 | + TaskScheduleService $taskschedules_service |
|
46 | + ) { |
|
47 | + $this->module = $module_service->findByInterface(AdminTasksModule::class)->first(); |
|
48 | + $this->taskschedules_service = $taskschedules_service; |
|
49 | + } |
|
50 | 50 | |
51 | - /** |
|
52 | - * {@inheritDoc} |
|
53 | - * @see \Psr\Http\Server\RequestHandlerInterface::handle() |
|
54 | - */ |
|
55 | - public function handle(ServerRequestInterface $request): ResponseInterface |
|
56 | - { |
|
57 | - if ($this->module === null) { |
|
58 | - throw new HttpNotFoundException(I18N::translate('The attached module could not be found.')); |
|
59 | - } |
|
51 | + /** |
|
52 | + * {@inheritDoc} |
|
53 | + * @see \Psr\Http\Server\RequestHandlerInterface::handle() |
|
54 | + */ |
|
55 | + public function handle(ServerRequestInterface $request): ResponseInterface |
|
56 | + { |
|
57 | + if ($this->module === null) { |
|
58 | + throw new HttpNotFoundException(I18N::translate('The attached module could not be found.')); |
|
59 | + } |
|
60 | 60 | |
61 | - $module = $this->module; |
|
62 | - $module_name = $this->module->name(); |
|
63 | - return response(['data' => $this->taskschedules_service->all(true, true) |
|
64 | - ->map(function (TaskSchedule $schedule) use ($module, $module_name): array { |
|
65 | - $task = $this->taskschedules_service->findTask($schedule->taskId()); |
|
66 | - $task_name = $task !== null ? $task->name() : I18N::translate('Task not found'); |
|
61 | + $module = $this->module; |
|
62 | + $module_name = $this->module->name(); |
|
63 | + return response(['data' => $this->taskschedules_service->all(true, true) |
|
64 | + ->map(function (TaskSchedule $schedule) use ($module, $module_name): array { |
|
65 | + $task = $this->taskschedules_service->findTask($schedule->taskId()); |
|
66 | + $task_name = $task !== null ? $task->name() : I18N::translate('Task not found'); |
|
67 | 67 | |
68 | - return [ |
|
69 | - 'edit' => view($module_name . '::admin/tasks-table-options', [ |
|
70 | - 'task_sched_id' => $schedule->id(), |
|
71 | - 'task_sched_enabled' => $schedule->isEnabled(), |
|
72 | - 'task_edit_route' => route(TaskEditPage::class, ['task' => $schedule->id()]), |
|
73 | - 'task_status_route' => route(TaskStatusAction::class, [ |
|
74 | - 'task' => $schedule->id(), |
|
75 | - 'enable' => $schedule->isEnabled() ? 0 : 1 |
|
76 | - ]) |
|
77 | - ]), |
|
78 | - 'status' => [ |
|
79 | - 'display' => view($module_name . '::components/yes-no-icons', [ |
|
80 | - 'yes' => $schedule->isEnabled() |
|
81 | - ]), |
|
82 | - 'raw' => $schedule->isEnabled() ? 1 : 0 |
|
83 | - ], |
|
84 | - 'task_name' => [ |
|
85 | - 'display' => '<span dir="auto">' . e($task_name) . '</span>', |
|
86 | - 'raw' => $task_name |
|
87 | - ], |
|
88 | - 'last_run' => [ |
|
89 | - 'display' => $schedule->lastRunTime()->unix() === 0 ? |
|
90 | - view('components/datetime', ['timestamp' => $schedule->lastRunTime()]) : |
|
91 | - view('components/datetime-diff', ['timestamp' => $schedule->lastRunTime()]), |
|
92 | - 'raw' => $schedule->lastRunTime()->unix() |
|
93 | - ], |
|
94 | - 'last_result' => [ |
|
95 | - 'display' => view($module_name . '::components/yes-no-icons', [ |
|
96 | - 'yes' => $schedule->wasLastRunSuccess() |
|
97 | - ]), |
|
98 | - 'raw' => $schedule->wasLastRunSuccess() ? 1 : 0 |
|
99 | - ], |
|
100 | - 'frequency' => '<span dir="auto">' . e($schedule->frequency()->cascade()->forHumans()) . '</span>', |
|
101 | - 'nb_occurrences' => $schedule->remainingOccurences() > 0 ? |
|
102 | - I18N::number($schedule->remainingOccurences()) : |
|
103 | - I18N::translate('Unlimited'), |
|
104 | - 'running' => view($module_name . '::components/yes-no-icons', [ |
|
105 | - 'yes' => $schedule->isRunning(), |
|
106 | - 'text_yes' => I18N::translate('Running'), |
|
107 | - 'text_no' => I18N::translate('Not running') |
|
108 | - ]), |
|
109 | - 'run' => view($module_name . '::admin/tasks-table-run', [ |
|
110 | - 'task_sched_id' => $schedule->id(), |
|
111 | - 'run_route' => route(TaskTrigger::class, [ |
|
112 | - 'task' => $schedule->taskId(), |
|
113 | - 'force' => $module->getPreference('MAJ_AT_FORCE_EXEC_TOKEN') |
|
114 | - ]) |
|
115 | - ]) |
|
116 | - ]; |
|
117 | - }) |
|
118 | - ]); |
|
119 | - } |
|
68 | + return [ |
|
69 | + 'edit' => view($module_name . '::admin/tasks-table-options', [ |
|
70 | + 'task_sched_id' => $schedule->id(), |
|
71 | + 'task_sched_enabled' => $schedule->isEnabled(), |
|
72 | + 'task_edit_route' => route(TaskEditPage::class, ['task' => $schedule->id()]), |
|
73 | + 'task_status_route' => route(TaskStatusAction::class, [ |
|
74 | + 'task' => $schedule->id(), |
|
75 | + 'enable' => $schedule->isEnabled() ? 0 : 1 |
|
76 | + ]) |
|
77 | + ]), |
|
78 | + 'status' => [ |
|
79 | + 'display' => view($module_name . '::components/yes-no-icons', [ |
|
80 | + 'yes' => $schedule->isEnabled() |
|
81 | + ]), |
|
82 | + 'raw' => $schedule->isEnabled() ? 1 : 0 |
|
83 | + ], |
|
84 | + 'task_name' => [ |
|
85 | + 'display' => '<span dir="auto">' . e($task_name) . '</span>', |
|
86 | + 'raw' => $task_name |
|
87 | + ], |
|
88 | + 'last_run' => [ |
|
89 | + 'display' => $schedule->lastRunTime()->unix() === 0 ? |
|
90 | + view('components/datetime', ['timestamp' => $schedule->lastRunTime()]) : |
|
91 | + view('components/datetime-diff', ['timestamp' => $schedule->lastRunTime()]), |
|
92 | + 'raw' => $schedule->lastRunTime()->unix() |
|
93 | + ], |
|
94 | + 'last_result' => [ |
|
95 | + 'display' => view($module_name . '::components/yes-no-icons', [ |
|
96 | + 'yes' => $schedule->wasLastRunSuccess() |
|
97 | + ]), |
|
98 | + 'raw' => $schedule->wasLastRunSuccess() ? 1 : 0 |
|
99 | + ], |
|
100 | + 'frequency' => '<span dir="auto">' . e($schedule->frequency()->cascade()->forHumans()) . '</span>', |
|
101 | + 'nb_occurrences' => $schedule->remainingOccurences() > 0 ? |
|
102 | + I18N::number($schedule->remainingOccurences()) : |
|
103 | + I18N::translate('Unlimited'), |
|
104 | + 'running' => view($module_name . '::components/yes-no-icons', [ |
|
105 | + 'yes' => $schedule->isRunning(), |
|
106 | + 'text_yes' => I18N::translate('Running'), |
|
107 | + 'text_no' => I18N::translate('Not running') |
|
108 | + ]), |
|
109 | + 'run' => view($module_name . '::admin/tasks-table-run', [ |
|
110 | + 'task_sched_id' => $schedule->id(), |
|
111 | + 'run_route' => route(TaskTrigger::class, [ |
|
112 | + 'task' => $schedule->taskId(), |
|
113 | + 'force' => $module->getPreference('MAJ_AT_FORCE_EXEC_TOKEN') |
|
114 | + ]) |
|
115 | + ]) |
|
116 | + ]; |
|
117 | + }) |
|
118 | + ]); |
|
119 | + } |
|
120 | 120 | } |
@@ -33,151 +33,151 @@ |
||
33 | 33 | */ |
34 | 34 | class TaskEditAction implements RequestHandlerInterface |
35 | 35 | { |
36 | - private ?AdminTasksModule $module; |
|
37 | - private TaskScheduleService $taskschedules_service; |
|
38 | - |
|
39 | - /** |
|
40 | - * Constructor for TaskEditAction Request Handler |
|
41 | - * |
|
42 | - * @param ModuleService $module_service |
|
43 | - * @param TaskScheduleService $taskschedules_service |
|
44 | - */ |
|
45 | - public function __construct(ModuleService $module_service, TaskScheduleService $taskschedules_service) |
|
46 | - { |
|
47 | - $this->module = $module_service->findByInterface(AdminTasksModule::class)->first(); |
|
48 | - $this->taskschedules_service = $taskschedules_service; |
|
49 | - } |
|
50 | - |
|
51 | - /** |
|
52 | - * {@inheritDoc} |
|
53 | - * @see \Psr\Http\Server\RequestHandlerInterface::handle() |
|
54 | - */ |
|
55 | - public function handle(ServerRequestInterface $request): ResponseInterface |
|
56 | - { |
|
57 | - $admin_config_route = route(AdminConfigPage::class); |
|
58 | - |
|
59 | - if ($this->module === null) { |
|
60 | - FlashMessages::addMessage( |
|
61 | - I18N::translate('The attached module could not be found.'), |
|
62 | - 'danger' |
|
63 | - ); |
|
64 | - return redirect($admin_config_route); |
|
65 | - } |
|
66 | - |
|
67 | - $task_sched_id = (int) $request->getAttribute('task'); |
|
68 | - $task_schedule = $this->taskschedules_service->find($task_sched_id); |
|
69 | - |
|
70 | - if ($task_schedule === null) { |
|
71 | - FlashMessages::addMessage( |
|
72 | - I18N::translate('The task shedule with ID “%s” does not exist.', I18N::number($task_sched_id)), |
|
73 | - 'danger' |
|
74 | - ); |
|
75 | - return redirect($admin_config_route); |
|
76 | - } |
|
77 | - |
|
78 | - $success = $this->updateGeneralSettings($task_schedule, $request); |
|
79 | - $success = $success && $this->updateSpecificSettings($task_schedule, $request); |
|
80 | - |
|
81 | - if ($success) { |
|
82 | - FlashMessages::addMessage( |
|
83 | - I18N::translate('The scheduled task has been successfully updated.'), |
|
84 | - 'success' |
|
85 | - ); |
|
86 | - //phpcs:ignore Generic.Files.LineLength.TooLong |
|
87 | - Log::addConfigurationLog('Module ' . $this->module->title() . ' : Task Schedule “' . $task_schedule->id() . '” has been updated.'); |
|
88 | - } |
|
89 | - |
|
90 | - return redirect($admin_config_route); |
|
91 | - } |
|
92 | - |
|
93 | - /** |
|
94 | - * Update general settings for the task, based on the request parameters |
|
95 | - * |
|
96 | - * @param TaskSchedule $task_schedule |
|
97 | - * @param ServerRequestInterface $request |
|
98 | - * @return bool |
|
99 | - */ |
|
100 | - private function updateGeneralSettings(TaskSchedule $task_schedule, ServerRequestInterface $request): bool |
|
101 | - { |
|
102 | - if ($this->module === null) { |
|
103 | - return false; |
|
104 | - } |
|
105 | - |
|
106 | - $params = (array) $request->getParsedBody(); |
|
107 | - |
|
108 | - $frequency = (int) $params['frequency']; |
|
109 | - if ($frequency > 0) { |
|
110 | - $task_schedule->setFrequency(CarbonInterval::minutes($frequency)); |
|
111 | - } else { |
|
112 | - FlashMessages::addMessage(I18N::translate('The frequency is not in a valid format.'), 'danger'); |
|
113 | - } |
|
114 | - |
|
115 | - $is_limited = (bool) $params['is_limited']; |
|
116 | - $nb_occur = (int) $params['nb_occur']; |
|
117 | - |
|
118 | - if ($is_limited) { |
|
119 | - if ($nb_occur > 0) { |
|
120 | - $task_schedule->setRemainingOccurences($nb_occur); |
|
121 | - } else { |
|
122 | - FlashMessages::addMessage( |
|
123 | - I18N::translate('The number of remaining occurences is not in a valid format.'), |
|
124 | - 'danger' |
|
125 | - ); |
|
126 | - } |
|
127 | - } else { |
|
128 | - $task_schedule->setRemainingOccurences(0); |
|
129 | - } |
|
130 | - |
|
131 | - try { |
|
132 | - $this->taskschedules_service->update($task_schedule); |
|
133 | - return true; |
|
134 | - } catch (Throwable $ex) { |
|
135 | - Log::addErrorLog( |
|
136 | - sprintf( |
|
137 | - 'Error while updating the Task Schedule "%s". Exception: %s', |
|
138 | - $task_schedule->id(), |
|
139 | - $ex->getMessage() |
|
140 | - ) |
|
141 | - ); |
|
142 | - } |
|
143 | - |
|
144 | - FlashMessages::addMessage(I18N::translate('An error occured while updating the scheduled task.'), 'danger'); |
|
145 | - //@phpcs:ignore Generic.Files.LineLength.TooLong |
|
146 | - Log::addConfigurationLog('Module ' . $this->module->title() . ' : Task Schedule “' . $task_schedule->id() . '” could not be updated. See error log.'); |
|
147 | - return false; |
|
148 | - } |
|
149 | - |
|
150 | - /** |
|
151 | - * Update general settings for the task, based on the request parameters |
|
152 | - * |
|
153 | - * @param TaskSchedule $task_schedule |
|
154 | - * @param ServerRequestInterface $request |
|
155 | - * @return bool |
|
156 | - */ |
|
157 | - private function updateSpecificSettings(TaskSchedule $task_schedule, ServerRequestInterface $request): bool |
|
158 | - { |
|
159 | - if ($this->module === null) { |
|
160 | - return false; |
|
161 | - } |
|
162 | - |
|
163 | - $task = $this->taskschedules_service->findTask($task_schedule->taskId()); |
|
164 | - if ($task === null || !($task instanceof ConfigurableTaskInterface)) { |
|
165 | - return true; |
|
166 | - } |
|
167 | - |
|
168 | - /** @var \MyArtJaub\Webtrees\Contracts\Tasks\TaskInterface&\MyArtJaub\Webtrees\Contracts\Tasks\ConfigurableTaskInterface $task */ |
|
169 | - if (!$task->updateConfig($request, $task_schedule)) { |
|
170 | - FlashMessages::addMessage( |
|
171 | - I18N::translate( |
|
172 | - 'An error occured while updating the specific settings of administrative task “%s”.', |
|
173 | - $task->name() |
|
174 | - ), |
|
175 | - 'danger' |
|
176 | - ); |
|
177 | - //phpcs:ignore Generic.Files.LineLength.TooLong |
|
178 | - Log::addConfigurationLog('Module ' . $this->module->title() . ' : AdminTask “' . $task->name() . '” specific settings could not be updated. See error log.'); |
|
179 | - } |
|
180 | - |
|
181 | - return true; |
|
182 | - } |
|
36 | + private ?AdminTasksModule $module; |
|
37 | + private TaskScheduleService $taskschedules_service; |
|
38 | + |
|
39 | + /** |
|
40 | + * Constructor for TaskEditAction Request Handler |
|
41 | + * |
|
42 | + * @param ModuleService $module_service |
|
43 | + * @param TaskScheduleService $taskschedules_service |
|
44 | + */ |
|
45 | + public function __construct(ModuleService $module_service, TaskScheduleService $taskschedules_service) |
|
46 | + { |
|
47 | + $this->module = $module_service->findByInterface(AdminTasksModule::class)->first(); |
|
48 | + $this->taskschedules_service = $taskschedules_service; |
|
49 | + } |
|
50 | + |
|
51 | + /** |
|
52 | + * {@inheritDoc} |
|
53 | + * @see \Psr\Http\Server\RequestHandlerInterface::handle() |
|
54 | + */ |
|
55 | + public function handle(ServerRequestInterface $request): ResponseInterface |
|
56 | + { |
|
57 | + $admin_config_route = route(AdminConfigPage::class); |
|
58 | + |
|
59 | + if ($this->module === null) { |
|
60 | + FlashMessages::addMessage( |
|
61 | + I18N::translate('The attached module could not be found.'), |
|
62 | + 'danger' |
|
63 | + ); |
|
64 | + return redirect($admin_config_route); |
|
65 | + } |
|
66 | + |
|
67 | + $task_sched_id = (int) $request->getAttribute('task'); |
|
68 | + $task_schedule = $this->taskschedules_service->find($task_sched_id); |
|
69 | + |
|
70 | + if ($task_schedule === null) { |
|
71 | + FlashMessages::addMessage( |
|
72 | + I18N::translate('The task shedule with ID “%s” does not exist.', I18N::number($task_sched_id)), |
|
73 | + 'danger' |
|
74 | + ); |
|
75 | + return redirect($admin_config_route); |
|
76 | + } |
|
77 | + |
|
78 | + $success = $this->updateGeneralSettings($task_schedule, $request); |
|
79 | + $success = $success && $this->updateSpecificSettings($task_schedule, $request); |
|
80 | + |
|
81 | + if ($success) { |
|
82 | + FlashMessages::addMessage( |
|
83 | + I18N::translate('The scheduled task has been successfully updated.'), |
|
84 | + 'success' |
|
85 | + ); |
|
86 | + //phpcs:ignore Generic.Files.LineLength.TooLong |
|
87 | + Log::addConfigurationLog('Module ' . $this->module->title() . ' : Task Schedule “' . $task_schedule->id() . '” has been updated.'); |
|
88 | + } |
|
89 | + |
|
90 | + return redirect($admin_config_route); |
|
91 | + } |
|
92 | + |
|
93 | + /** |
|
94 | + * Update general settings for the task, based on the request parameters |
|
95 | + * |
|
96 | + * @param TaskSchedule $task_schedule |
|
97 | + * @param ServerRequestInterface $request |
|
98 | + * @return bool |
|
99 | + */ |
|
100 | + private function updateGeneralSettings(TaskSchedule $task_schedule, ServerRequestInterface $request): bool |
|
101 | + { |
|
102 | + if ($this->module === null) { |
|
103 | + return false; |
|
104 | + } |
|
105 | + |
|
106 | + $params = (array) $request->getParsedBody(); |
|
107 | + |
|
108 | + $frequency = (int) $params['frequency']; |
|
109 | + if ($frequency > 0) { |
|
110 | + $task_schedule->setFrequency(CarbonInterval::minutes($frequency)); |
|
111 | + } else { |
|
112 | + FlashMessages::addMessage(I18N::translate('The frequency is not in a valid format.'), 'danger'); |
|
113 | + } |
|
114 | + |
|
115 | + $is_limited = (bool) $params['is_limited']; |
|
116 | + $nb_occur = (int) $params['nb_occur']; |
|
117 | + |
|
118 | + if ($is_limited) { |
|
119 | + if ($nb_occur > 0) { |
|
120 | + $task_schedule->setRemainingOccurences($nb_occur); |
|
121 | + } else { |
|
122 | + FlashMessages::addMessage( |
|
123 | + I18N::translate('The number of remaining occurences is not in a valid format.'), |
|
124 | + 'danger' |
|
125 | + ); |
|
126 | + } |
|
127 | + } else { |
|
128 | + $task_schedule->setRemainingOccurences(0); |
|
129 | + } |
|
130 | + |
|
131 | + try { |
|
132 | + $this->taskschedules_service->update($task_schedule); |
|
133 | + return true; |
|
134 | + } catch (Throwable $ex) { |
|
135 | + Log::addErrorLog( |
|
136 | + sprintf( |
|
137 | + 'Error while updating the Task Schedule "%s". Exception: %s', |
|
138 | + $task_schedule->id(), |
|
139 | + $ex->getMessage() |
|
140 | + ) |
|
141 | + ); |
|
142 | + } |
|
143 | + |
|
144 | + FlashMessages::addMessage(I18N::translate('An error occured while updating the scheduled task.'), 'danger'); |
|
145 | + //@phpcs:ignore Generic.Files.LineLength.TooLong |
|
146 | + Log::addConfigurationLog('Module ' . $this->module->title() . ' : Task Schedule “' . $task_schedule->id() . '” could not be updated. See error log.'); |
|
147 | + return false; |
|
148 | + } |
|
149 | + |
|
150 | + /** |
|
151 | + * Update general settings for the task, based on the request parameters |
|
152 | + * |
|
153 | + * @param TaskSchedule $task_schedule |
|
154 | + * @param ServerRequestInterface $request |
|
155 | + * @return bool |
|
156 | + */ |
|
157 | + private function updateSpecificSettings(TaskSchedule $task_schedule, ServerRequestInterface $request): bool |
|
158 | + { |
|
159 | + if ($this->module === null) { |
|
160 | + return false; |
|
161 | + } |
|
162 | + |
|
163 | + $task = $this->taskschedules_service->findTask($task_schedule->taskId()); |
|
164 | + if ($task === null || !($task instanceof ConfigurableTaskInterface)) { |
|
165 | + return true; |
|
166 | + } |
|
167 | + |
|
168 | + /** @var \MyArtJaub\Webtrees\Contracts\Tasks\TaskInterface&\MyArtJaub\Webtrees\Contracts\Tasks\ConfigurableTaskInterface $task */ |
|
169 | + if (!$task->updateConfig($request, $task_schedule)) { |
|
170 | + FlashMessages::addMessage( |
|
171 | + I18N::translate( |
|
172 | + 'An error occured while updating the specific settings of administrative task “%s”.', |
|
173 | + $task->name() |
|
174 | + ), |
|
175 | + 'danger' |
|
176 | + ); |
|
177 | + //phpcs:ignore Generic.Files.LineLength.TooLong |
|
178 | + Log::addConfigurationLog('Module ' . $this->module->title() . ' : AdminTask “' . $task->name() . '” specific settings could not be updated. See error log.'); |
|
179 | + } |
|
180 | + |
|
181 | + return true; |
|
182 | + } |
|
183 | 183 | } |
@@ -29,68 +29,68 @@ |
||
29 | 29 | */ |
30 | 30 | class TaskStatusAction implements RequestHandlerInterface |
31 | 31 | { |
32 | - private ?AdminTasksModule $module; |
|
33 | - private TaskScheduleService $taskschedules_service; |
|
32 | + private ?AdminTasksModule $module; |
|
33 | + private TaskScheduleService $taskschedules_service; |
|
34 | 34 | |
35 | - /** |
|
36 | - * Constructor for TaskStatusAction Request Handler |
|
37 | - * |
|
38 | - * @param ModuleService $module_service |
|
39 | - * @param TaskScheduleService $taskschedules_service |
|
40 | - */ |
|
41 | - public function __construct(ModuleService $module_service, TaskScheduleService $taskschedules_service) |
|
42 | - { |
|
43 | - $this->module = $module_service->findByInterface(AdminTasksModule::class)->first(); |
|
44 | - $this->taskschedules_service = $taskschedules_service; |
|
45 | - } |
|
35 | + /** |
|
36 | + * Constructor for TaskStatusAction Request Handler |
|
37 | + * |
|
38 | + * @param ModuleService $module_service |
|
39 | + * @param TaskScheduleService $taskschedules_service |
|
40 | + */ |
|
41 | + public function __construct(ModuleService $module_service, TaskScheduleService $taskschedules_service) |
|
42 | + { |
|
43 | + $this->module = $module_service->findByInterface(AdminTasksModule::class)->first(); |
|
44 | + $this->taskschedules_service = $taskschedules_service; |
|
45 | + } |
|
46 | 46 | |
47 | - /** |
|
48 | - * {@inheritDoc} |
|
49 | - * @see \Psr\Http\Server\RequestHandlerInterface::handle() |
|
50 | - */ |
|
51 | - public function handle(ServerRequestInterface $request): ResponseInterface |
|
52 | - { |
|
53 | - $admin_config_route = route(AdminConfigPage::class); |
|
47 | + /** |
|
48 | + * {@inheritDoc} |
|
49 | + * @see \Psr\Http\Server\RequestHandlerInterface::handle() |
|
50 | + */ |
|
51 | + public function handle(ServerRequestInterface $request): ResponseInterface |
|
52 | + { |
|
53 | + $admin_config_route = route(AdminConfigPage::class); |
|
54 | 54 | |
55 | - if ($this->module === null) { |
|
56 | - FlashMessages::addMessage( |
|
57 | - I18N::translate('The attached module could not be found.'), |
|
58 | - 'danger' |
|
59 | - ); |
|
60 | - return redirect($admin_config_route); |
|
61 | - } |
|
55 | + if ($this->module === null) { |
|
56 | + FlashMessages::addMessage( |
|
57 | + I18N::translate('The attached module could not be found.'), |
|
58 | + 'danger' |
|
59 | + ); |
|
60 | + return redirect($admin_config_route); |
|
61 | + } |
|
62 | 62 | |
63 | - $task_sched_id = (int) $request->getAttribute('task'); |
|
64 | - $task_schedule = $this->taskschedules_service->find($task_sched_id); |
|
63 | + $task_sched_id = (int) $request->getAttribute('task'); |
|
64 | + $task_schedule = $this->taskschedules_service->find($task_sched_id); |
|
65 | 65 | |
66 | - $admin_config_route = route(AdminConfigPage::class); |
|
66 | + $admin_config_route = route(AdminConfigPage::class); |
|
67 | 67 | |
68 | - if ($task_schedule === null) { |
|
69 | - FlashMessages::addMessage( |
|
70 | - I18N::translate('The task shedule with ID “%s” does not exist.', I18N::number($task_sched_id)), |
|
71 | - 'danger' |
|
72 | - ); |
|
73 | - return redirect($admin_config_route); |
|
74 | - } |
|
68 | + if ($task_schedule === null) { |
|
69 | + FlashMessages::addMessage( |
|
70 | + I18N::translate('The task shedule with ID “%s” does not exist.', I18N::number($task_sched_id)), |
|
71 | + 'danger' |
|
72 | + ); |
|
73 | + return redirect($admin_config_route); |
|
74 | + } |
|
75 | 75 | |
76 | - ((bool) $request->getAttribute('enable', false)) ? $task_schedule->enable() : $task_schedule->disable(); |
|
76 | + ((bool) $request->getAttribute('enable', false)) ? $task_schedule->enable() : $task_schedule->disable(); |
|
77 | 77 | |
78 | - if ($this->taskschedules_service->update($task_schedule) > 0) { |
|
79 | - FlashMessages::addMessage( |
|
80 | - I18N::translate('The scheduled task has been successfully updated.'), |
|
81 | - 'success' |
|
82 | - ); |
|
83 | - //phpcs:ignore Generic.Files.LineLength.TooLong |
|
84 | - Log::addConfigurationLog('Module ' . $this->module->title() . ' : Task Schedule “' . $task_schedule->id() . '” has been updated.'); |
|
85 | - } else { |
|
86 | - FlashMessages::addMessage( |
|
87 | - I18N::translate('An error occured while updating the scheduled task.'), |
|
88 | - 'danger' |
|
89 | - ); |
|
90 | - //phpcs:ignore Generic.Files.LineLength.TooLong |
|
91 | - Log::addConfigurationLog('Module ' . $this->module->title() . ' : Task Schedule “' . $task_schedule->id() . '” could not be updated. See error log.'); |
|
92 | - } |
|
78 | + if ($this->taskschedules_service->update($task_schedule) > 0) { |
|
79 | + FlashMessages::addMessage( |
|
80 | + I18N::translate('The scheduled task has been successfully updated.'), |
|
81 | + 'success' |
|
82 | + ); |
|
83 | + //phpcs:ignore Generic.Files.LineLength.TooLong |
|
84 | + Log::addConfigurationLog('Module ' . $this->module->title() . ' : Task Schedule “' . $task_schedule->id() . '” has been updated.'); |
|
85 | + } else { |
|
86 | + FlashMessages::addMessage( |
|
87 | + I18N::translate('An error occured while updating the scheduled task.'), |
|
88 | + 'danger' |
|
89 | + ); |
|
90 | + //phpcs:ignore Generic.Files.LineLength.TooLong |
|
91 | + Log::addConfigurationLog('Module ' . $this->module->title() . ' : Task Schedule “' . $task_schedule->id() . '” could not be updated. See error log.'); |
|
92 | + } |
|
93 | 93 | |
94 | - return redirect($admin_config_route); |
|
95 | - } |
|
94 | + return redirect($admin_config_route); |
|
95 | + } |
|
96 | 96 | } |
@@ -29,47 +29,47 @@ |
||
29 | 29 | */ |
30 | 30 | class AdminConfigPage implements RequestHandlerInterface |
31 | 31 | { |
32 | - use ViewResponseTrait; |
|
32 | + use ViewResponseTrait; |
|
33 | 33 | |
34 | - private ?AdminTasksModule $module; |
|
35 | - private TokenService $token_service; |
|
34 | + private ?AdminTasksModule $module; |
|
35 | + private TokenService $token_service; |
|
36 | 36 | |
37 | - /** |
|
38 | - * Constructor for Admin Config request handler |
|
39 | - * |
|
40 | - * @param ModuleService $module_service |
|
41 | - */ |
|
42 | - public function __construct(ModuleService $module_service, TokenService $token_service) |
|
43 | - { |
|
44 | - $this->module = $module_service->findByInterface(AdminTasksModule::class)->first(); |
|
45 | - $this->token_service = $token_service; |
|
46 | - } |
|
37 | + /** |
|
38 | + * Constructor for Admin Config request handler |
|
39 | + * |
|
40 | + * @param ModuleService $module_service |
|
41 | + */ |
|
42 | + public function __construct(ModuleService $module_service, TokenService $token_service) |
|
43 | + { |
|
44 | + $this->module = $module_service->findByInterface(AdminTasksModule::class)->first(); |
|
45 | + $this->token_service = $token_service; |
|
46 | + } |
|
47 | 47 | |
48 | - /** |
|
49 | - * {@inheritDoc} |
|
50 | - * @see \Psr\Http\Server\RequestHandlerInterface::handle() |
|
51 | - */ |
|
52 | - public function handle(ServerRequestInterface $request): ResponseInterface |
|
53 | - { |
|
54 | - $this->layout = 'layouts/administration'; |
|
48 | + /** |
|
49 | + * {@inheritDoc} |
|
50 | + * @see \Psr\Http\Server\RequestHandlerInterface::handle() |
|
51 | + */ |
|
52 | + public function handle(ServerRequestInterface $request): ResponseInterface |
|
53 | + { |
|
54 | + $this->layout = 'layouts/administration'; |
|
55 | 55 | |
56 | - if ($this->module === null) { |
|
57 | - throw new HttpNotFoundException(I18N::translate('The attached module could not be found.')); |
|
58 | - } |
|
56 | + if ($this->module === null) { |
|
57 | + throw new HttpNotFoundException(I18N::translate('The attached module could not be found.')); |
|
58 | + } |
|
59 | 59 | |
60 | - $token = $this->module->getPreference('MAJ_AT_FORCE_EXEC_TOKEN'); |
|
61 | - if ($token === '') { |
|
62 | - $token = $this->token_service->generateRandomToken(); |
|
63 | - $this->module->setPreference('PAT_FORCE_EXEC_TOKEN', $token); |
|
64 | - } |
|
60 | + $token = $this->module->getPreference('MAJ_AT_FORCE_EXEC_TOKEN'); |
|
61 | + if ($token === '') { |
|
62 | + $token = $this->token_service->generateRandomToken(); |
|
63 | + $this->module->setPreference('PAT_FORCE_EXEC_TOKEN', $token); |
|
64 | + } |
|
65 | 65 | |
66 | - return $this->viewResponse($this->module->name() . '::admin/config', [ |
|
67 | - 'title' => $this->module->title(), |
|
68 | - 'trigger_token' => $token, |
|
69 | - 'trigger_route' => route(TaskTrigger::class, ['task' => '__TASKNAME__', 'force' => '__TOKEN__']), |
|
70 | - 'new_token_route' => route(TokenGenerate::class), |
|
71 | - 'tasks_data_route' => route(TasksList::class), |
|
72 | - 'js_script_url' => $this->module->assetUrl('js/admintasks.min.js') |
|
73 | - ]); |
|
74 | - } |
|
66 | + return $this->viewResponse($this->module->name() . '::admin/config', [ |
|
67 | + 'title' => $this->module->title(), |
|
68 | + 'trigger_token' => $token, |
|
69 | + 'trigger_route' => route(TaskTrigger::class, ['task' => '__TASKNAME__', 'force' => '__TOKEN__']), |
|
70 | + 'new_token_route' => route(TokenGenerate::class), |
|
71 | + 'tasks_data_route' => route(TasksList::class), |
|
72 | + 'js_script_url' => $this->module->assetUrl('js/admintasks.min.js') |
|
73 | + ]); |
|
74 | + } |
|
75 | 75 | } |
@@ -28,41 +28,41 @@ |
||
28 | 28 | */ |
29 | 29 | class TaskTrigger implements RequestHandlerInterface |
30 | 30 | { |
31 | - private ?AdminTasksModule $module; |
|
32 | - private TaskScheduleService $taskschedules_service; |
|
31 | + private ?AdminTasksModule $module; |
|
32 | + private TaskScheduleService $taskschedules_service; |
|
33 | 33 | |
34 | - /** |
|
35 | - * Constructor for TaskTrigger request handler |
|
36 | - * @param ModuleService $module_service |
|
37 | - * @param TaskScheduleService $taskschedules_service |
|
38 | - */ |
|
39 | - public function __construct(ModuleService $module_service, TaskScheduleService $taskschedules_service) |
|
40 | - { |
|
41 | - $this->module = $module_service->findByInterface(AdminTasksModule::class)->first(); |
|
42 | - $this->taskschedules_service = $taskschedules_service; |
|
43 | - } |
|
34 | + /** |
|
35 | + * Constructor for TaskTrigger request handler |
|
36 | + * @param ModuleService $module_service |
|
37 | + * @param TaskScheduleService $taskschedules_service |
|
38 | + */ |
|
39 | + public function __construct(ModuleService $module_service, TaskScheduleService $taskschedules_service) |
|
40 | + { |
|
41 | + $this->module = $module_service->findByInterface(AdminTasksModule::class)->first(); |
|
42 | + $this->taskschedules_service = $taskschedules_service; |
|
43 | + } |
|
44 | 44 | |
45 | - /** |
|
46 | - * {@inheritDoc} |
|
47 | - * @see \Psr\Http\Server\RequestHandlerInterface::handle() |
|
48 | - */ |
|
49 | - public function handle(ServerRequestInterface $request): ResponseInterface |
|
50 | - { |
|
51 | - if ($this->module === null) { |
|
52 | - throw new HttpNotFoundException(I18N::translate('The attached module could not be found.')); |
|
53 | - } |
|
45 | + /** |
|
46 | + * {@inheritDoc} |
|
47 | + * @see \Psr\Http\Server\RequestHandlerInterface::handle() |
|
48 | + */ |
|
49 | + public function handle(ServerRequestInterface $request): ResponseInterface |
|
50 | + { |
|
51 | + if ($this->module === null) { |
|
52 | + throw new HttpNotFoundException(I18N::translate('The attached module could not be found.')); |
|
53 | + } |
|
54 | 54 | |
55 | - $task_id = $request->getAttribute('task'); |
|
56 | - $token = $this->module->getPreference('MAJ_AT_FORCE_EXEC_TOKEN'); |
|
57 | - $force_token = $request->getQueryParams()['force'] ?? ''; |
|
58 | - $force = $token == $force_token; |
|
55 | + $task_id = $request->getAttribute('task'); |
|
56 | + $token = $this->module->getPreference('MAJ_AT_FORCE_EXEC_TOKEN'); |
|
57 | + $force_token = $request->getQueryParams()['force'] ?? ''; |
|
58 | + $force = $token == $force_token; |
|
59 | 59 | |
60 | - $task_schedules = $this->taskschedules_service->findTasksToRun($force, $task_id); |
|
60 | + $task_schedules = $this->taskschedules_service->findTasksToRun($force, $task_id); |
|
61 | 61 | |
62 | - foreach ($task_schedules as $task_schedule) { |
|
63 | - $this->taskschedules_service->run($task_schedule, $force); |
|
64 | - } |
|
62 | + foreach ($task_schedules as $task_schedule) { |
|
63 | + $this->taskschedules_service->run($task_schedule, $force); |
|
64 | + } |
|
65 | 65 | |
66 | - return response(); |
|
67 | - } |
|
66 | + return response(); |
|
67 | + } |
|
68 | 68 | } |
@@ -30,58 +30,58 @@ |
||
30 | 30 | */ |
31 | 31 | class TaskEditPage implements RequestHandlerInterface |
32 | 32 | { |
33 | - use ViewResponseTrait; |
|
33 | + use ViewResponseTrait; |
|
34 | 34 | |
35 | - private ?AdminTasksModule $module; |
|
36 | - private TaskScheduleService $taskschedules_service; |
|
35 | + private ?AdminTasksModule $module; |
|
36 | + private TaskScheduleService $taskschedules_service; |
|
37 | 37 | |
38 | - /** |
|
39 | - * Constructor for TaskEditPage Request Handler |
|
40 | - * |
|
41 | - * @param ModuleService $module_service |
|
42 | - * @param TaskScheduleService $taskschedules_service |
|
43 | - */ |
|
44 | - public function __construct(ModuleService $module_service, TaskScheduleService $taskschedules_service) |
|
45 | - { |
|
46 | - $this->module = $module_service->findByInterface(AdminTasksModule::class)->first(); |
|
47 | - $this->taskschedules_service = $taskschedules_service; |
|
48 | - } |
|
38 | + /** |
|
39 | + * Constructor for TaskEditPage Request Handler |
|
40 | + * |
|
41 | + * @param ModuleService $module_service |
|
42 | + * @param TaskScheduleService $taskschedules_service |
|
43 | + */ |
|
44 | + public function __construct(ModuleService $module_service, TaskScheduleService $taskschedules_service) |
|
45 | + { |
|
46 | + $this->module = $module_service->findByInterface(AdminTasksModule::class)->first(); |
|
47 | + $this->taskschedules_service = $taskschedules_service; |
|
48 | + } |
|
49 | 49 | |
50 | - /** |
|
51 | - * {@inheritDoc} |
|
52 | - * @see \Psr\Http\Server\RequestHandlerInterface::handle() |
|
53 | - */ |
|
54 | - public function handle(ServerRequestInterface $request): ResponseInterface |
|
55 | - { |
|
56 | - $this->layout = 'layouts/administration'; |
|
50 | + /** |
|
51 | + * {@inheritDoc} |
|
52 | + * @see \Psr\Http\Server\RequestHandlerInterface::handle() |
|
53 | + */ |
|
54 | + public function handle(ServerRequestInterface $request): ResponseInterface |
|
55 | + { |
|
56 | + $this->layout = 'layouts/administration'; |
|
57 | 57 | |
58 | - if ($this->module === null) { |
|
59 | - throw new HttpNotFoundException(I18N::translate('The attached module could not be found.')); |
|
60 | - } |
|
58 | + if ($this->module === null) { |
|
59 | + throw new HttpNotFoundException(I18N::translate('The attached module could not be found.')); |
|
60 | + } |
|
61 | 61 | |
62 | - $task_sched_id = (int) $request->getAttribute('task'); |
|
63 | - $task_schedule = $this->taskschedules_service->find($task_sched_id); |
|
62 | + $task_sched_id = (int) $request->getAttribute('task'); |
|
63 | + $task_schedule = $this->taskschedules_service->find($task_sched_id); |
|
64 | 64 | |
65 | - if ($task_schedule === null) { |
|
66 | - throw new HttpNotFoundException(I18N::translate('The Task schedule could not be found.')); |
|
67 | - } |
|
65 | + if ($task_schedule === null) { |
|
66 | + throw new HttpNotFoundException(I18N::translate('The Task schedule could not be found.')); |
|
67 | + } |
|
68 | 68 | |
69 | - $task = $this->taskschedules_service->findTask($task_schedule->taskId()); |
|
69 | + $task = $this->taskschedules_service->findTask($task_schedule->taskId()); |
|
70 | 70 | |
71 | - if ($task === null) { |
|
72 | - throw new HttpNotFoundException(I18N::translate('The Task schedule could not be found.')); |
|
73 | - } |
|
71 | + if ($task === null) { |
|
72 | + throw new HttpNotFoundException(I18N::translate('The Task schedule could not be found.')); |
|
73 | + } |
|
74 | 74 | |
75 | - $has_task_config = $task instanceof ConfigurableTaskInterface; |
|
76 | - /** @var \MyArtJaub\Webtrees\Contracts\Tasks\TaskInterface&\MyArtJaub\Webtrees\Contracts\Tasks\ConfigurableTaskInterface $task */ |
|
75 | + $has_task_config = $task instanceof ConfigurableTaskInterface; |
|
76 | + /** @var \MyArtJaub\Webtrees\Contracts\Tasks\TaskInterface&\MyArtJaub\Webtrees\Contracts\Tasks\ConfigurableTaskInterface $task */ |
|
77 | 77 | |
78 | - return $this->viewResponse($this->module->name() . '::admin/tasks-edit', [ |
|
79 | - 'module' => $this->module, |
|
80 | - 'title' => I18N::translate('Edit the administrative task') . ' - ' . $task->name(), |
|
81 | - 'task_schedule' => $task_schedule, |
|
82 | - 'task' => $task, |
|
83 | - 'has_task_config' => $has_task_config, |
|
84 | - 'task_config_view' => $has_task_config ? $task->configView($request) : '' |
|
85 | - ]); |
|
86 | - } |
|
78 | + return $this->viewResponse($this->module->name() . '::admin/tasks-edit', [ |
|
79 | + 'module' => $this->module, |
|
80 | + 'title' => I18N::translate('Edit the administrative task') . ' - ' . $task->name(), |
|
81 | + 'task_schedule' => $task_schedule, |
|
82 | + 'task' => $task, |
|
83 | + 'has_task_config' => $has_task_config, |
|
84 | + 'task_config_view' => $has_task_config ? $task->configView($request) : '' |
|
85 | + ]); |
|
86 | + } |
|
87 | 87 | } |
@@ -30,34 +30,34 @@ |
||
30 | 30 | */ |
31 | 31 | class TokenGenerate implements RequestHandlerInterface |
32 | 32 | { |
33 | - private ?AdminTasksModule $module; |
|
34 | - private TokenService $token_service; |
|
35 | - |
|
36 | - /** |
|
37 | - * Constructor for TokenGenerate request handler |
|
38 | - * |
|
39 | - * @param ModuleService $module_service |
|
40 | - */ |
|
41 | - public function __construct(ModuleService $module_service, TokenService $token_service) |
|
42 | - { |
|
43 | - $this->module = $module_service->findByInterface(AdminTasksModule::class)->first(); |
|
44 | - $this->token_service = $token_service; |
|
45 | - } |
|
46 | - |
|
47 | - /** |
|
48 | - * {@inheritDoc} |
|
49 | - * @see \Psr\Http\Server\RequestHandlerInterface::handle() |
|
50 | - */ |
|
51 | - public function handle(ServerRequestInterface $request): ResponseInterface |
|
52 | - { |
|
53 | - if ($this->module === null) { |
|
54 | - throw new HttpNotFoundException(I18N::translate('The attached module could not be found.')); |
|
55 | - } |
|
56 | - |
|
57 | - $token = $this->token_service->generateRandomToken(); |
|
58 | - $this->module->setPreference('MAJ_AT_FORCE_EXEC_TOKEN', $token); |
|
59 | - Log::addConfigurationLog($this->module->title() . ' : New token generated.'); |
|
60 | - |
|
61 | - return response(['token' => $token]); |
|
62 | - } |
|
33 | + private ?AdminTasksModule $module; |
|
34 | + private TokenService $token_service; |
|
35 | + |
|
36 | + /** |
|
37 | + * Constructor for TokenGenerate request handler |
|
38 | + * |
|
39 | + * @param ModuleService $module_service |
|
40 | + */ |
|
41 | + public function __construct(ModuleService $module_service, TokenService $token_service) |
|
42 | + { |
|
43 | + $this->module = $module_service->findByInterface(AdminTasksModule::class)->first(); |
|
44 | + $this->token_service = $token_service; |
|
45 | + } |
|
46 | + |
|
47 | + /** |
|
48 | + * {@inheritDoc} |
|
49 | + * @see \Psr\Http\Server\RequestHandlerInterface::handle() |
|
50 | + */ |
|
51 | + public function handle(ServerRequestInterface $request): ResponseInterface |
|
52 | + { |
|
53 | + if ($this->module === null) { |
|
54 | + throw new HttpNotFoundException(I18N::translate('The attached module could not be found.')); |
|
55 | + } |
|
56 | + |
|
57 | + $token = $this->token_service->generateRandomToken(); |
|
58 | + $this->module->setPreference('MAJ_AT_FORCE_EXEC_TOKEN', $token); |
|
59 | + Log::addConfigurationLog($this->module->title() . ' : New token generated.'); |
|
60 | + |
|
61 | + return response(['token' => $token]); |
|
62 | + } |
|
63 | 63 | } |
@@ -25,25 +25,25 @@ |
||
25 | 25 | class Migration1 implements MigrationInterface |
26 | 26 | { |
27 | 27 | |
28 | - /** |
|
29 | - * {@inheritDoc} |
|
30 | - * @see \Fisharebest\Webtrees\Schema\MigrationInterface::upgrade() |
|
31 | - */ |
|
32 | - public function upgrade(): void |
|
33 | - { |
|
34 | - // Clean up previous admin tasks table if it exists |
|
35 | - DB::schema()->dropIfExists('maj_admintasks'); |
|
36 | - |
|
37 | - DB::schema()->create('maj_admintasks', static function (Blueprint $table): void { |
|
38 | - |
|
39 | - $table->increments('majat_id'); |
|
40 | - $table->string('majat_task_id', 32)->unique(); |
|
41 | - $table->enum('majat_status', ['enabled', 'disabled'])->default('disabled'); |
|
42 | - $table->dateTime('majat_last_run')->default(Carbon::createFromTimestampUTC(0)); |
|
43 | - $table->boolean('majat_last_result')->default(true); |
|
44 | - $table->integer('majat_frequency')->default(10080); |
|
45 | - $table->smallInteger('majat_nb_occur')->default(0); |
|
46 | - $table->boolean('majat_running')->default(false); |
|
47 | - }); |
|
48 | - } |
|
28 | + /** |
|
29 | + * {@inheritDoc} |
|
30 | + * @see \Fisharebest\Webtrees\Schema\MigrationInterface::upgrade() |
|
31 | + */ |
|
32 | + public function upgrade(): void |
|
33 | + { |
|
34 | + // Clean up previous admin tasks table if it exists |
|
35 | + DB::schema()->dropIfExists('maj_admintasks'); |
|
36 | + |
|
37 | + DB::schema()->create('maj_admintasks', static function (Blueprint $table): void { |
|
38 | + |
|
39 | + $table->increments('majat_id'); |
|
40 | + $table->string('majat_task_id', 32)->unique(); |
|
41 | + $table->enum('majat_status', ['enabled', 'disabled'])->default('disabled'); |
|
42 | + $table->dateTime('majat_last_run')->default(Carbon::createFromTimestampUTC(0)); |
|
43 | + $table->boolean('majat_last_result')->default(true); |
|
44 | + $table->integer('majat_frequency')->default(10080); |
|
45 | + $table->smallInteger('majat_nb_occur')->default(0); |
|
46 | + $table->boolean('majat_running')->default(false); |
|
47 | + }); |
|
48 | + } |
|
49 | 49 | } |
@@ -22,12 +22,12 @@ |
||
22 | 22 | class Migration0 implements MigrationInterface |
23 | 23 | { |
24 | 24 | |
25 | - /** |
|
26 | - * {@inheritDoc} |
|
27 | - * @see MigrationInterface::upgrade() |
|
28 | - */ |
|
29 | - public function upgrade(): void |
|
30 | - { |
|
31 | - // These migrations have been merged into migration 1. |
|
32 | - } |
|
25 | + /** |
|
26 | + * {@inheritDoc} |
|
27 | + * @see MigrationInterface::upgrade() |
|
28 | + */ |
|
29 | + public function upgrade(): void |
|
30 | + { |
|
31 | + // These migrations have been merged into migration 1. |
|
32 | + } |
|
33 | 33 | } |