Skip to content

Commit

Permalink
Move services_bolt.yaml to packages/bolt.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
bobdenotter committed Jul 16, 2020
1 parent c71185c commit be3b389
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 28 deletions.
18 changes: 18 additions & 0 deletions config/packages/bolt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This file is auto-generated by Bolt. Do not modify.

services:
_defaults:
autowire: true
autoconfigure: true
AcmeCorp\ReferenceExtension\:
resource: '../../vendor/acmecorp/reference-extension/src/*'
exclude: '../../vendor/acmecorp/reference-extension/src/{Entity,Exception}'
BobdenOtter\ConfigurationNotices\:
resource: '../../vendor/bobdenotter/configuration-notices/src/*'
exclude: '../../vendor/bobdenotter/configuration-notices/src/{Entity,Exception}'
BobdenOtter\WeatherWidget\:
resource: '../../vendor/bobdenotter/weatherwidget/src/*'
exclude: '../../vendor/bobdenotter/weatherwidget/src/{Entity,Exception}'
Bolt\NewsWidget\:
resource: '../../vendor/bolt/newswidget/src/*'
exclude: '../../vendor/bolt/newswidget/src/{Entity,Exception}'
18 changes: 0 additions & 18 deletions config/services_bolt.yaml

This file was deleted.

8 changes: 5 additions & 3 deletions src/Extension/ExtensionCompilerPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function buildServices(array $packages): void
$yaml = "# This file is auto-generated by Bolt. Do not modify.\n\n";
$yaml .= Yaml::dump($services, 3);

$filename = $this->projectDir . '/config/services_bolt.yaml';
$filename = $this->projectDir . '/config/packages/bolt.yaml';
file_put_contents($filename, $yaml);
}

Expand Down Expand Up @@ -96,7 +96,7 @@ private function createService(string $package): array

return [$namespace, [
'resource' => $path . '/*',
'exclude' => $path . '/{Entity,Exception,Exclude}',
'exclude' => $path . '/{Entity,Exception}',
]];
}

Expand All @@ -119,7 +119,9 @@ private function addComposerPackages(array $packages): array
private function getRelativePath($package): string
{
$reflection = new \ReflectionClass($package);
return Path::makeRelative(dirname($reflection->getFileName()), $this->projectDir . '/foo');

// We add the `/foo/bar` to make the path start with `../../`
return Path::makeRelative(dirname($reflection->getFileName()), $this->projectDir . '/foo/bar');
}

}
7 changes: 0 additions & 7 deletions src/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,6 @@ protected function configureContainer(ContainerBuilder $container, LoaderInterfa
$this->setBoltParameters($container, $confDir);
$this->setContentTypeRequirements($container);
$this->setTaxonomyRequirements($container);

try {
$loader->load($confDir . '/{services}_bolt' . self::CONFIG_EXTS, 'glob');
} catch (\Throwable $e) {
// Ignore errors. The file will be updated on next `cache:clear` or whenever
// the container gets refreshed
}
}

protected function configureRoutes(RouteCollectionBuilder $routes): void
Expand Down

0 comments on commit be3b389

Please sign in to comment.