Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Controller/DefaultController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function indexAction($url)
Zend_Registry::set('dic', $this->container);

$rootDir = $this->get('kernel')->getRootDir();
$bootstrap = $this->container->getParameter('zf1wrapper_bootstrap_path');
$bootstrap = $this->container->getParameter('bootstrap_path');

// capture content from legacy application
ob_start();
Expand Down
11 changes: 8 additions & 3 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,14 @@ public function getConfigTreeBuilder()
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('zf1_wrapper');

// Here you should define the parameters that are allowed to
// configure your bundle. See the documentation linked above for
// more information on that topic.
$rootNode
->children()
->scalarNode('bootstrap_path')
->info('Relative path to Zend Framework Bootstrap file kernel.root_dir')
->isRequired()
->cannotBeEmpty()
->end()
->end();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...
->end()
->end();

?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wat bedoel je precies? Volgens mij zijn er 2 end() calls nodig, 1 voor scalarNode() en 1 voor children() (Zie https://symfony.com/doc/current/bundles/configuration.html#processing-the-configs-array)


return $treeBuilder;
}
Expand Down
2 changes: 2 additions & 0 deletions DependencyInjection/Zf1WrapperExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public function load(array $configs, ContainerBuilder $container)
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);

$container->setParameter('bootstrap_path', $config['bootstrap_path']);

$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.yml');
}
Expand Down
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@ Add the following to your composer.json:

### 1. config.yml ###
You need to configure is the location of your ZF1 bootstrap file (e.g. index.php).
Add the following to your config.yml:
Add the following to your packages/zf1_wrapper.yml:
```
parameters:

#Zf1WrapperBundle
zf1wrapper_bootstrap_path: ../web/index.php
zf1_wrapper:
bootstrap_path: ../web/index.php
```

### 2. routing.yml
Expand Down
2 changes: 1 addition & 1 deletion Resources/config/parameters.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
parameters:
zf1wrapper_bootstrap_path: ../web/index.php # your ZF1 bootstrap file relative to kernel.root_dir
bootstrap_path: ../web/index.php # your ZF1 bootstrap file relative to kernel.root_dir