Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Add aura/di basics #112

Merged
merged 3 commits into from
Sep 3, 2015
Merged

Add aura/di basics #112

merged 3 commits into from
Sep 3, 2015

Conversation

harikt
Copy link
Contributor

@harikt harikt commented Aug 28, 2015

No description provided.

@harikt
Copy link
Contributor Author

harikt commented Aug 28, 2015

Fixes #109

@@ -5,6 +5,6 @@
{"Container Factories": "factories.md"},
{"Using zend-servicemanager": "zend-servicemanager.md"},
{"Using Pimple": "pimple.md"}
Copy link
Contributor

Choose a reason for hiding this comment

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

missing , before next line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch.

]
}

Copy link
Contributor

Choose a reason for hiding this comment

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

yup, new line for end of file, a blank line after }

Copy link
Member

Choose a reason for hiding this comment

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

@samsonasik No blank line at the end of the file, please!!!!

@weierophinney
Copy link
Member

My principal suggestion is that you follow the same patterns used for the ZF2 service manager and Pimple: in other words, have a config/services.php file that returns the fully configured container. We plan to use this pattern in the skeleton application, with example files for each container we document; this allows keeping the bootstrap file the same across implementations.

@harikt
Copy link
Contributor Author

harikt commented Aug 28, 2015

@weierophinney question :

Do you think changing to config/services.php

use Aura\Di\ContainerBuilder;

$container_builder = new ContainerBuilder();

// use the builder to create and configure a container
// using an array of ContainerConfig classes
$di = $container_builder->newConfiguredInstance([
    'Application\_Config\Common',
]);
return $di;

and having a seprate class is acceptable? The things are you can load other config classes if they are already provided by the package and don't need to add the config our own.

<?php
chdir(dirname(__DIR__));
$container = require 'config/services.php';
$app = $container->get('Zend\Expressive\Application');
$app->run();

If this is acceptable let me know.

@weierophinney
Copy link
Member

Absolutely; that's exactly how we handled the other two, and why I
suggested it. :-)
On Aug 28, 2015 11:20 AM, "Hari K T" [email protected] wrote:

@weierophinney https://github.com/weierophinney question :

Do you think changing to config/services.php

use Aura\Di\ContainerBuilder;$container_builder = new ContainerBuilder();// use the builder to create and configure a container// using an array of ContainerConfig classes$di = $container_builder->newConfiguredInstance([ 'Application_Config\Common',]);return $di;

and having a seprate class is acceptable? The things are you can load
other config classes if they are already provided by the package and don't
need to add the config our own.

get('Zend\Expressive\Application'); $app->run(); If this is acceptable let me know. — Reply to this email directly or view it on GitHub https://github.com//pull/112#issuecomment-135823413 .

@harikt
Copy link
Contributor Author

harikt commented Aug 29, 2015

Have made the changes @weierophinney . Hope you like. Feel free to make the necessary changes.

Thank you.


The bare minimal `ContainerConfig ` code needed to make zend-expressive work is

```php
Copy link
Member

Choose a reason for hiding this comment

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

Where should this class file be placed?

Copy link
Member

Choose a reason for hiding this comment

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

I'm assuming src/_Config/Common.php?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@weierophinney weierophinney merged commit 12b8570 into zendframework:master Sep 3, 2015
weierophinney added a commit that referenced this pull request Sep 3, 2015
weierophinney added a commit that referenced this pull request Sep 3, 2015
weierophinney added a commit that referenced this pull request Sep 3, 2015
weierophinney added a commit that referenced this pull request Sep 3, 2015
@weierophinney weierophinney added this to the 0.1.1 milestone Sep 3, 2015
@weierophinney weierophinney self-assigned this Sep 3, 2015
@weierophinney weierophinney mentioned this pull request Sep 3, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants