Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dbp-relay-example-bundle
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
digital blueprint
Relay API Gateway
dbp-relay-example-bundle
Commits
21991325
Commit
21991325
authored
2 years ago
by
Bekerle, Patrizio
Browse files
Options
Downloads
Patches
Plain Diff
Migrate to "example" from "template"
parent
c718e74d
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+8
-8
8 additions, 8 deletions
README.md
src/DependencyInjection/Configuration.php
+1
-1
1 addition, 1 deletion
src/DependencyInjection/Configuration.php
tests/Kernel.php
+1
-1
1 addition, 1 deletion
tests/Kernel.php
with
10 additions
and
10 deletions
README.md
+
8
−
8
View file @
21991325
# Relay
Te
mpl
at
e Bundle
# Relay
Exa
mple Bundle
This Symfony bundle can be used as a
te
mpl
at
e for creating new bundles for the
This Symfony bundle can be used as a
n exa
mple for creating new bundles for the
DBP Relay project.
When including this bundle into your API server it will gain the following
...
...
@@ -12,17 +12,17 @@ features:
## TL;DR
The quickest way to make use of this
t
empl
at
e bundle is to feed your desired names
The quickest way to make use of this e
xa
mple bundle is to feed your desired names
to one command and generate a ready-to-use bundle with the correct naming.
See
[
Generate DBP Symfony bundle
](
https://dbp-demo.tugraz.at/dev-guide/relay/naming/#generate-dbp-symfony-bundle
)
for more information.
## Using the Bundle as a
Te
mpl
at
e
## Using the Bundle as a
n exa
mple
*
Copy the repo contents
*
Adjust the package name in
`composer.json`
, in this example we'll pretend you named your bundle
`dbp/relay-your-bundle`
*
Invent a new PHP namespace and adjust it in all PHP files
*
Rename
`src/DbpRelay
Te
mpl
at
eBundle`
and
`DependencyInjection/DbpRelay
Te
mpl
at
eExtension`
to match the new project name
*
Rename
`src/DbpRelay
Exa
mpleBundle`
and
`DependencyInjection/DbpRelay
Exa
mpleExtension`
to match the new project name
## Integration into the API Server
...
...
@@ -61,16 +61,16 @@ DBP\API\CoreBundle\DbpCoreBundle::class => ['all' => true],
The bundle has a
`example_config`
configuration value that you can specify in your
app, either by hard-coding it, or by referencing an environment variable.
For this create
`config/packages/dbp_relay_
t
empl
at
e.yaml`
in the app with the following
For this create
`config/packages/dbp_relay_e
xa
mple.yaml`
in the app with the following
content:
```
yaml
dbp_relay_
t
empl
at
e
:
dbp_relay_e
xa
mple
:
example_config
:
42
# example_config: '%env(EXAMPLE_CONFIG)%'
```
The value gets read in
`DbpRelay
Te
mpl
at
eExtension`
(your extension will be named differently)
The value gets read in
`DbpRelay
Exa
mpleExtension`
(your extension will be named differently)
and passed when creating the
`MyCustomService`
service.
For more info on bundle configuration see
[
Symfony bundles configuration
](
https://symfony.com/doc/current/bundles/configuration.html
)
.
...
...
This diff is collapsed.
Click to expand it.
src/DependencyInjection/Configuration.php
+
1
−
1
View file @
21991325
...
...
@@ -11,7 +11,7 @@ class Configuration implements ConfigurationInterface
{
public
function
getConfigTreeBuilder
():
TreeBuilder
{
$treeBuilder
=
new
TreeBuilder
(
'dbp_relay_
t
empl
at
e'
);
$treeBuilder
=
new
TreeBuilder
(
'dbp_relay_e
xa
mple'
);
$treeBuilder
->
getRootNode
()
->
children
()
...
...
This diff is collapsed.
Click to expand it.
tests/Kernel.php
+
1
−
1
View file @
21991325
...
...
@@ -47,7 +47,7 @@ class Kernel extends BaseKernel
'secret'
=>
''
,
]);
$container
->
extension
(
'dbp_relay_
t
empl
at
e'
,
[
$container
->
extension
(
'dbp_relay_e
xa
mple'
,
[
'example_config'
=>
'test-42'
,
]);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment