-
-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dev 1.0 #256
Dev 1.0 #256
Changes from all commits
7324170
36fa2c8
9a1f0fa
9b6ac7d
ff4ba0b
b4900f9
0288cc2
7d92054
888253f
b8d6fe1
77b97ae
7eab5c5
5b17a94
e3811c0
346713e
246b840
a4c88ca
0d7f587
af15ebd
d641b17
a0c18c2
a09bc71
ca1e7dd
6539115
cb94c2f
863e74f
5639c0c
807cd6c
9fe9f5d
bb7e020
3875f8b
21a779e
b8cb316
c2afd5f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,56 @@ | ||
# 1.0 | ||
|
||
* Dependency to zendframework has been bumped from `~2.1` to `~2.2` | ||
* Dependency to doctrine/common has been bumped from `>=2.3,<2.5-dev` to `>=2.4,<2.6-dev` | ||
* Class name changes: | ||
- `DoctrineModule\ServiceFactory\AbstractDoctrineServiceFactory` -> `DoctrineModule\ServiceFactory\DoctrineServiceAbstractFactory` | ||
- `DoctrineModule\Authentication\Adapter\ObjectRepository` -> `DoctrineModule\Authentication\Adapter\ObjectRepositoryAdapter` | ||
- `DoctrineModule\Authentication\Storage\ObjectRepository` -> `DoctrineModule\Authentication\Storage\ObjectRepositoryStorage` | ||
- `DoctrineModule\Paginator\Adatper\Collection` -> `DoctrineModule\Paginator\Adatper\CollectionAdapter` | ||
- `DoctrineModule\Paginator\Adatper\Selectable` -> ``DoctrineModule\Paginator\Adatper\SelectableAdater` | ||
- `DoctrineModule\Stdlib\Hydrator\DoctrineObject` -> `DoctrineModule\Stdlib\Hydrator\ObjectHydrator` | ||
- All `DoctrineModule\Options\*.php` -> `DoctrineModule\Options\*Options.php` | ||
* Any fluent interfaces have been removed. | ||
* Configuration has changed significantly. Most services are created by `DoctrineModule\ServiceFactory\DoctrineServiceAbstractFactory`, | ||
and expects configuration to follow this pattern: | ||
- All service names should start with `doctrine.`. | ||
- All service names should use `.` to delimit words in the service name | ||
- All service names should survive `Zend\ServiceManager\ServiceManager`'s cannonacalization process unchanged. | ||
If they do not, getting the service directly will work, but aliases will not. In practice, this means service names should be all lower case, | ||
and should not include the characters `_-\ /`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we have any way to force this via exception? Maybe in the abstract factory? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could check if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @superdweebie that disallows aliases though (now that I think of it) guess it's a problem to be thought carefully after this PR |
||
- If a service with name `doctrine.foo.bar.baz` is requested, then `DoctrineServiceAbstractFactory` will get the service | ||
called `doctrine.factory.foo.bar` from the ServiceManager. The `doctrine.factory.foo.bar` instance must be an object implementing | ||
`DoctrineModule\Factory\AbstractFactoryInterface`. `$instanace::create($options)` will be called to create the oringally | ||
requested `doctrine.foo.bar.baz` service. The `$options` passed to `create` will be an array taken from | ||
the application config: `$config['doctrine']['foo']['bar']['baz']`s. | ||
- For example in the config options for the default EventManager should be placed in | ||
`$config['doctrine']['eventmanager']['default']`. The EventManager will be created by a | ||
`DoctrineModule\Factory\EventManagerFactory` which is fetched from the ServiceManager with the service | ||
name `doctrine.factory.eventmanager`. To get a configured instance of the default EventManager call | ||
`$serviceManager->get('doctrine.eventmanager.default')`. | ||
* Configuration for authentication services has been rearranged to follow the pattern above, with separate | ||
config keys for `adapter`, `storage`, and `service`. See `module.config.php`. | ||
* Authentication configuration no longer supports setting `objectRepository`. You must set both `objectManager` and | ||
`identityClass`. This significantly simplifies the code, and allows a flat config for easy caching. | ||
* Most of the factories that were in `DoctrineModule\Service` have been moved to `DoctrineModule\Builder`. This is because | ||
they are not actual service factories to be consumed by the ServiceManager. Rather they are consumed by `DoctrineServiceAbstractFactory`. | ||
* When configuring drivers, the cache key must now be a full service name. eg `doctrine.cache.array`. | ||
* When configuring a driver chain, the `$options->drivers` array may contain driver instances, or complete service names. | ||
|
||
eg: | ||
|
||
'driver' => array( | ||
'default' => array( | ||
'drivers' => array( | ||
'My\Namespace' => 'doctrine.driver.mydriver' | ||
), | ||
), | ||
'mydriver' => array( | ||
'class' => 'Doctrine\ODM\MongoDB\Mapping\Driver\AnnotationDriver', | ||
'paths' => array('path/to/my/namespace') | ||
), | ||
), | ||
|
||
# 0.8.0 | ||
|
||
* Dependency to zendframework has been bumped from `2.*` to `~2.1` | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,18 +84,18 @@ class Module | |
'factories' => array( | ||
'Zend\Authentication\AuthenticationService' => function($serviceManager) { | ||
// If you are using DoctrineORMModule: | ||
return $serviceManager->get('doctrine.authenticationservice.orm_default'); | ||
return $serviceManager->get('doctrine.authenticationservice.default'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 ! I still want a doctrine.objectmanager.default key... =) Would be super nice for third party modules taht can't assume if the user is using ODM or ORM, but want to provide a deafult object manager. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 on that - could be an alias set by the last loaded module There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Exactly my thought :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea. |
||
|
||
// If you are using DoctrineODMModule: | ||
return $serviceManager->get('doctrine.authenticationservice.odm_default'); | ||
return $serviceManager->get('doctrine.authenticationservice.default'); | ||
} | ||
) | ||
); | ||
} | ||
} | ||
``` | ||
|
||
Please note that Iam using here a ``Zend\Authentication\AuthenticationService`` name, but it can be anything else (``my_auth_service``…). However, using the name ``Zend\Authentication\AuthenticationService`` will allow it to be recognised by the ZF2 view helper. | ||
Please note that I am using here a ``Zend\Authentication\AuthenticationService`` name, but it can be anything else (``my_auth_service``…). However, using the name ``Zend\Authentication\AuthenticationService`` will allow it to be recognised by the ZF2 view helper. | ||
|
||
#### Using the AuthenticationService | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest, still for homogeneity purpose I'd like some service keys to be renamed. For instance doctrine.eventmanager to doctrine.event_manager.
The solution would be to override the canonicalizeName in the factory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bakura10 can't work - already went through it in detail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why ? We had this problem in ZfrRest with application/json and it works by overriding canonicalizeName.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bakura10 that only because we had our own service container
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did think about creating a domain specific ServiceManager for doctrine, but the extra complexity didn't seem to be worth the modest benefit. Even if we did, and peered it to the main ServiceManager, we would still have the alias problem for anything pulled through the main ServiceManager.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@superdweebie indeed, even a peering service locator has that problem :(