Skip to content

Commit

Permalink
Merge pull request #639 from Eye4web/hotfix/servicemanager
Browse files Browse the repository at this point in the history
Hotfix/servicemanager
  • Loading branch information
Danielss89 committed May 7, 2016
2 parents 647e2fc + 3150e67 commit f3d5fab
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 12 deletions.
3 changes: 2 additions & 1 deletion Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ public function getServiceConfig()
'zfcuser_zend_db_adapter' => 'Zend\Db\Adapter\Adapter',
),
'invokables' => array(
'zfcuser_user_service' => 'ZfcUser\Service\User',
'zfcuser_register_form_hydrator' => 'Zend\Stdlib\Hydrator\ClassMethods',
),
'factories' => array(
Expand All @@ -90,6 +89,8 @@ public function getServiceConfig()

'ZfcUser\Authentication\Adapter\Db' => 'ZfcUser\Factory\Authentication\Adapter\DbFactory',
'ZfcUser\Authentication\Storage\Db' => 'ZfcUser\Factory\Authentication\Storage\DbFactory',

'zfcuser_user_service' => 'ZfcUser\Factory\Service\UserFactory',
),
);
}
Expand Down
2 changes: 0 additions & 2 deletions src/ZfcUser/Authentication/Adapter/Db.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

namespace ZfcUser\Authentication\Adapter;

use DateTime;
use Zend\Authentication\Result as AuthenticationResult;
use Zend\ServiceManager\ServiceManagerAwareInterface;
use Zend\ServiceManager\ServiceManager;
use Zend\Crypt\Password\Bcrypt;
use Zend\Session\Container as SessionContainer;
Expand Down
1 change: 0 additions & 1 deletion src/ZfcUser/Authentication/Storage/Db.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Zend\Authentication\Storage;
use Zend\Authentication\Storage\StorageInterface;
use Zend\ServiceManager\ServiceManagerAwareInterface;
use Zend\ServiceManager\ServiceManager;
use ZfcUser\Mapper\UserInterface as UserMapper;

Expand Down
12 changes: 6 additions & 6 deletions src/ZfcUser/Factory/Controller/UserControllerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ public function createService(ServiceLocatorInterface $controllerManager)
$controller = new UserController($redirectCallback);
$controller->setServiceLocator($serviceManager);

$controller->setChangeEmailForm($this->serviceLocator->get('zfcuser_change_email_form'));
$controller->setOptions($this->serviceLocator->get('zfcuser_module_options'));
$controller->setChangePasswordForm($this->serviceLocator->get('zfcuser_change_password_form'));
$controller->setLoginForm($this->serviceLocator->get('zfcuser_login_form'));
$controller->setRegisterForm($this->serviceLocator->get('zfcuser_register_form'));
$controller->setUserService($this->serviceLocator->get('zfcuser_user_service'));
$controller->setChangeEmailForm($serviceManager->get('zfcuser_change_email_form'));
$controller->setOptions($serviceManager->get('zfcuser_module_options'));
$controller->setChangePasswordForm($serviceManager->get('zfcuser_change_password_form'));
$controller->setLoginForm($serviceManager->get('zfcuser_login_form'));
$controller->setRegisterForm($serviceManager->get('zfcuser_register_form'));
$controller->setUserService($serviceManager->get('zfcuser_user_service'));

return $controller;
}
Expand Down
24 changes: 24 additions & 0 deletions src/ZfcUser/Factory/Service/UserFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace ZfcUser\Factory\Service;

use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use ZfcUser\Service\User;

class UserFactory implements FactoryInterface
{

/**
* Create service
*
* @param ServiceLocatorInterface $serviceLocator
* @return mixed
*/
public function createService(ServiceLocatorInterface $serviceLocator)
{
$service = new User();
$service->setServiceManager($serviceLocator);
return $service;
}
}
3 changes: 1 addition & 2 deletions src/ZfcUser/Service/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@

use Zend\Authentication\AuthenticationService;
use Zend\Form\Form;
use Zend\ServiceManager\ServiceManagerAwareInterface;
use Zend\ServiceManager\ServiceManager;
use Zend\Crypt\Password\Bcrypt;
use Zend\Stdlib\Hydrator;
use ZfcBase\EventManager\EventProvider;
use ZfcUser\Mapper\UserInterface as UserMapperInterface;
use ZfcUser\Options\UserServiceOptionsInterface;

class User extends EventProvider implements ServiceManagerAwareInterface
class User extends EventProvider
{

/**
Expand Down

0 comments on commit f3d5fab

Please sign in to comment.