Skip to content

Commit

Permalink
Remove built in support for contao-manager.php b/c @aschempp insisted…
Browse files Browse the repository at this point in the history
… to remove it.
  • Loading branch information
dmolineus authored and leofeyer committed Nov 26, 2018
1 parent 5d27444 commit aafb0f1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 30 deletions.
23 changes: 5 additions & 18 deletions manager-bundle/src/DependencyInjection/ContaoManagerExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,6 @@

class ContaoManagerExtension extends ConfigurableExtension
{
/**
* @var array
*/
private static $managerPaths = [
'contao-manager.phar.php',
'contao-manager.php'
];

/**
* {@inheritdoc}
*/
Expand Down Expand Up @@ -57,23 +49,18 @@ protected function loadInternal(array $mergedConfig, ContainerBuilder $container
*/
protected function configureManagerUrlParameter(array $mergedConfig, ContainerBuilder $container): void
{
$managerUrl = null;
$managerPath = null;

if ($mergedConfig['manager_path']) {
$managerUrl = $mergedConfig['manager_path'];
$managerPath = $mergedConfig['manager_path'];
} else {
$projectDir = $container->getParameter('kernel.project_dir');

foreach (static::$managerPaths as $path) {
if (!is_file($projectDir . '/web/' . $path)) {
continue;
}

$managerUrl = $path;
break;
if (is_file($projectDir . '/web/contao-manager.phar.php')) {
$managerPath = 'contao-manager.phar.php';
}
}

$container->setParameter('contao_manager.manager_path', $managerUrl);
$container->setParameter('contao_manager.manager_path', $managerPath);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,9 @@ public function testRegistersTheRoutingLoader(): void
$this->assertSame('%kernel.project_dir%', (string) $definition->getArgument(3));
}

/**
* @dataProvider getDefaultManagerPaths
*/
public function testDefaultContaoManagerPathIsRegisteredAutomatically(string $defaultPath): void
public function testDefaultContaoManagerPathIsRegisteredAutomatically(): void
{
$defaultPath = 'contao-manager.phar.php';
$container = new ContainerBuilder();
$container->setParameter('kernel.project_dir', $this->getTempDir());

Expand Down Expand Up @@ -151,12 +149,4 @@ public function testCustomContaoManagerPathIsRegistered(): void

$fs->remove($tmpDir . '/web/custom.phar.php');
}

public function getDefaultManagerPaths(): array
{
return [
['contao-manager.phar.php'],
['contao-manager.php']
];
}
}

0 comments on commit aafb0f1

Please sign in to comment.