Skip to content

Commit 8a39355

Browse files
authored
Merge pull request #37 from pagemachine/datahandler-authentication
Authenticate user for DataHandler usage
2 parents 686123c + 5abafb3 commit 8a39355

File tree

4 files changed

+23
-0
lines changed

4 files changed

+23
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
declare(strict_types = 1);
4+
5+
namespace Pagemachine\Phinx\Command;
6+
7+
use Symfony\Component\Console\Input\InputInterface;
8+
use Symfony\Component\Console\Output\OutputInterface;
9+
use TYPO3\CMS\Core\Core\Bootstrap;
10+
11+
trait AuthenticatedExecutionTrait
12+
{
13+
protected function execute(InputInterface $input, OutputInterface $output): int
14+
{
15+
// Make sure the _cli_ user is loaded
16+
Bootstrap::initializeBackendAuthentication();
17+
18+
return parent::execute($input, $output);
19+
}
20+
}

Classes/Command/MigrateCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@
99
final class MigrateCommand extends Migrate
1010
{
1111
use ConfigurationTrait;
12+
use AuthenticatedExecutionTrait;
1213
}

Classes/Command/RollbackCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@
99
final class RollbackCommand extends Rollback
1010
{
1111
use ConfigurationTrait;
12+
use AuthenticatedExecutionTrait;
1213
}

Classes/Command/SeedRunCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@
99
final class SeedRunCommand extends SeedRun
1010
{
1111
use ConfigurationTrait;
12+
use AuthenticatedExecutionTrait;
1213
}

0 commit comments

Comments
 (0)