Skip to content

Commit

Permalink
Laminas
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorybesson committed Jun 26, 2021
1 parent 1deb99a commit 8b77d85
Show file tree
Hide file tree
Showing 88 changed files with 421 additions and 412 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
composer.phar
/.buildpath
/build
.phpunit.result.cache
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ If you want to change the ChangeInfo Form for example (ie. you want to add a 'ch
And then you add the Form elements you want

$this->add(array(
'type' => 'Zend\Form\Element\Select',
'type' => 'Laminas\Form\Element\Select',
'name' => 'children',
'attributes' => array(
'id' => 'children',
Expand Down Expand Up @@ -157,7 +157,7 @@ If you want to add an action or modify an existing one.
'zfcuser' => array(
'child_routes' => array(
'profile' => array(
'type' => 'Zend\Router\Http\Literal',
'type' => 'Laminas\Router\Http\Literal',
'options' => array(
'route' => '/mes-coordonnees',
'defaults' => array(
Expand Down
75 changes: 38 additions & 37 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,43 @@
{
"name" : "playground/user",
"description" : "Module managing user",
"type" : "library",
"license" : "MIT",
"keywords" : [
"ZF3",
"playground",
"user"
],
"homepage" : "https://github.com/gregorybesson/PlaygroundUser",
"authors" : [
{
"name" : "Greg Besson",
"email" : "[email protected]",
"homepage" : "http://www.playground.gg"
}
],
"require" : {
"php" : ">=5.5.0",
"facebook/graph-sdk": "^5.6",
"playground/design" : ">=4.0.0",
"zendframework/zend-developer-tools" : ">=1.0.0",
"hybridauth/hybridauth": "@RC",
"zf-commons/zfc-user" : ">=3.0.0"
},
"require-dev" : {
"phpunit/phpunit" : ">=4.0.0",
"squizlabs/php_codesniffer": ">=2.0.0",
"php-coveralls/php-coveralls": ">=0.0.0"
},
"autoload" : {
"psr-4" : {
"PlaygroundUser\\" : "src/"
}
},
"extra": {
"name": "playground/user",
"description": "Module user",
"type": "library",
"license": "MIT",
"keywords": [
"Laminas",
"playground",
"user"
],
"homepage": "https://github.com/gregorybesson/PlaygroundUser",
"authors": [
{
"name": "Greg Besson",
"email": "[email protected]",
"homepage": "http://www.playground.gg"
}
],
"require": {
"php": ">=7.3.0",
"facebook/graph-sdk": "^5.6",
"playground/design": "^5.0",
"laminas/laminas-developer-tools": ">=1.0.0",
"hybridauth/hybridauth": "@RC",
"zf-commons/zfc-user": ">=3.0.0",
"laminas/laminas-dependency-plugin": "^2.1"
},
"require-dev": {
"phpunit/phpunit": ">=4.0.0",
"squizlabs/php_codesniffer": ">=2.0.0",
"php-coveralls/php-coveralls": "^2.4"
},
"autoload": {
"psr-4": {
"PlaygroundUser\\": "src/"
}
},
"extra": {
"branch-alias": {
"dev-master": "4.x-dev"
"dev-master": "5.x-dev"
}
}
}
44 changes: 22 additions & 22 deletions config/module.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
'frontend' => array(
'child_routes' => array(
'contact' => array(
'type' => 'Zend\Router\Http\Literal',
'type' => 'Laminas\Router\Http\Literal',
'options' => array(
'route' => 'contactez-nous',
'defaults' => array(
Expand All @@ -156,7 +156,7 @@
'may_terminate' => true,
'child_routes' => array(
'confirmation' => array(
'type' => 'Zend\Router\Http\Literal',
'type' => 'Laminas\Router\Http\Literal',
'options' => array(
'route' => '/confirmation',
'defaults' => array(
Expand Down Expand Up @@ -196,7 +196,7 @@
),
),
'zfcuser' => array(
'type' => 'Zend\Router\Http\Literal',
'type' => 'Laminas\Router\Http\Literal',
'priority' => 1000,
'options' => array(
'route' => 'mon-compte',
Expand All @@ -208,7 +208,7 @@
'may_terminate' => true,
'child_routes' => array(
'team' => array(
'type' => 'Zend\Router\Http\Literal',
'type' => 'Laminas\Router\Http\Literal',
'options' => array(
'route' => '/team',
'defaults' => array(
Expand All @@ -218,7 +218,7 @@
),
),
'forgotpassword' => array(
'type' => 'Zend\Router\Http\Literal',
'type' => 'Laminas\Router\Http\Literal',
'options' => array(
'route' => '/mot-passe-oublie',
'defaults' => array(
Expand All @@ -228,7 +228,7 @@
),
),
'ajaxforgotpassword' => array(
'type' => 'Zend\Router\Http\Literal',
'type' => 'Laminas\Router\Http\Literal',
'options' => array(
'route' => '/ajax-mot-passe-oublie',
'defaults' => array(
Expand Down Expand Up @@ -261,7 +261,7 @@
),
),
'ajaxlogin' => array(
'type' => 'Zend\Router\Http\Literal',
'type' => 'Laminas\Router\Http\Literal',
'options' => array(
'route' => '/ajaxlogin',
'defaults' => array(
Expand All @@ -271,7 +271,7 @@
),
),
'login' => array(
'type' => 'Zend\Router\Http\Literal',
'type' => 'Laminas\Router\Http\Literal',
'options' => array(
'route' => '/login',
'defaults' => array(
Expand All @@ -297,7 +297,7 @@
),
),
'logout' => array(
'type' => 'Zend\Router\Http\Literal',
'type' => 'Laminas\Router\Http\Literal',
'options' => array(
'route' => '/logout',
'defaults' => array(
Expand All @@ -307,7 +307,7 @@
),
),
'ajaxauthenticate' => array(
'type' => 'Zend\Router\Http\Literal',
'type' => 'Laminas\Router\Http\Literal',
'options' => array(
'route' => '/ajaxauthenticate',
'defaults' => array(
Expand All @@ -317,7 +317,7 @@
),
),
'authenticate' => array(
'type' => 'Zend\Router\Http\Literal',
'type' => 'Laminas\Router\Http\Literal',
'options' => array(
'route' => '/authenticate',
'defaults' => array(
Expand Down Expand Up @@ -364,7 +364,7 @@
),
),
'registermail' => array(
'type' => 'Zend\Router\Http\Literal',
'type' => 'Laminas\Router\Http\Literal',
'options' => array(
'route' => '/registermail',
'defaults' => array(
Expand All @@ -374,7 +374,7 @@
),
),
'verification' => array(
'type' => 'Zend\Router\Http\Literal',
'type' => 'Laminas\Router\Http\Literal',
'options' => array(
'route' => '/verification',
'defaults' => array(
Expand All @@ -395,7 +395,7 @@
),

'profile' => array(
'type' => 'Zend\Router\Http\Literal',
'type' => 'Laminas\Router\Http\Literal',
'options' => array(
'route' => '/mes-coordonnees',
'defaults' => array(
Expand All @@ -405,7 +405,7 @@
),
),
'profile_prizes' => array(
'type' => 'Zend\Router\Http\Literal',
'type' => 'Laminas\Router\Http\Literal',
'options' => array(
'route' => '/prizes',
'defaults' => array(
Expand All @@ -415,7 +415,7 @@
),
),
'newsletter' => array(
'type' => 'Zend\Router\Http\Literal',
'type' => 'Laminas\Router\Http\Literal',
'options' => array(
'route' => '/newsletter',
'defaults' => array(
Expand All @@ -425,7 +425,7 @@
),
),
'ajax_newsletter' => array(
'type' => 'Zend\Router\Http\Literal',
'type' => 'Laminas\Router\Http\Literal',
'options' => array(
'route' => '/ajax-newsletter',
'defaults' => array(
Expand All @@ -435,7 +435,7 @@
),
),
'changepassword' => array(
'type' => 'Zend\Router\Http\Literal',
'type' => 'Laminas\Router\Http\Literal',
'options' => array(
'route' => '/change-password',
'defaults' => array(
Expand All @@ -445,7 +445,7 @@
),
),
'blockaccount' => array(
'type' => 'Zend\Router\Http\Literal',
'type' => 'Laminas\Router\Http\Literal',
'options' => array(
'route' => '/block-account',
'defaults' => array(
Expand All @@ -455,7 +455,7 @@
),
),
'changeemail' => array(
'type' => 'Zend\Router\Http\Literal',
'type' => 'Laminas\Router\Http\Literal',
'options' => array(
'route' => '/change-email',
'defaults' => array(
Expand All @@ -478,7 +478,7 @@
),
'child_routes' => array(
'logout' => array(
'type' => 'Zend\Router\Http\Literal',
'type' => 'Laminas\Router\Http\Literal',
'options' => array(
'route' => '/logout',
'defaults' => array(
Expand All @@ -488,7 +488,7 @@
),
),
'playgrounduser' => array(
'type' => 'Zend\Router\Http\Literal',
'type' => 'Laminas\Router\Http\Literal',
'priority' => 1000,
'options' => array(
'route' => '/user',
Expand Down
14 changes: 7 additions & 7 deletions src/Authentication/Adapter/Cookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
namespace PlaygroundUser\Authentication\Adapter;

use ZfcUser\Authentication\Adapter\AbstractAdapter;
use Zend\Authentication\Result as AuthenticationResult;
use Zend\ServiceManager\ServiceManager;
use Zend\Stdlib\ResponseInterface as Response;
use Zend\ServiceManager\ServiceLocatorInterface;
use Laminas\Authentication\Result as AuthenticationResult;
use Laminas\ServiceManager\ServiceManager;
use Laminas\Stdlib\ResponseInterface as Response;
use Laminas\ServiceManager\ServiceLocatorInterface;

class Cookie extends AbstractAdapter
{
Expand All @@ -23,7 +23,7 @@ public function __construct(ServiceLocatorInterface $locator)
$this->serviceManager = $locator;
}

public function authenticate(\Zend\EventManager\EventInterface $e)
public function authenticate(\Laminas\EventManager\EventInterface $e)
{
$e = $e->getTarget();
//throw new \Exception('Cookie Auth event was stopped without a response.');
Expand All @@ -37,7 +37,7 @@ public function authenticate(\Zend\EventManager\EventInterface $e)
* but afterwords login with identity/credential
* we remove the "cookieLogin" session.
*/
$session = new \Zend\Session\Container('zfcuser');
$session = new \Laminas\Session\Container('zfcuser');
$session->offsetSet("cookieLogin", false);

return;
Expand Down Expand Up @@ -96,7 +96,7 @@ public function authenticate(\Zend\EventManager\EventInterface $e)
->setMessages(array('Authentication successful.'));

// Reference for weak login. Should not be allowed to change PW etc.
$session = new \Zend\Session\Container('zfcuser');
$session = new \Laminas\Session\Container('zfcuser');
$session->offsetSet("cookieLogin", true);
}

Expand Down
10 changes: 5 additions & 5 deletions src/Authentication/Adapter/EmailValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
namespace PlaygroundUser\Authentication\Adapter;

use ZfcUser\Authentication\Adapter\AbstractAdapter;
use Zend\Authentication\Result as AuthenticationResult;
use Zend\EventManager\EventInterface as AuthEvent;
use Zend\ServiceManager\ServiceManager;
use Zend\ServiceManager\ServiceLocatorInterface;
use Laminas\Authentication\Result as AuthenticationResult;
use Laminas\EventManager\EventInterface as AuthEvent;
use Laminas\ServiceManager\ServiceManager;
use Laminas\ServiceManager\ServiceLocatorInterface;

class EmailValidation extends AbstractAdapter
{
Expand Down Expand Up @@ -35,7 +35,7 @@ public function authenticate(AuthEvent $e)

$service = $this->getUserService();
$token = $e->getRequest()->getQuery()->get('token');
$validator = new \Zend\Validator\Hex();
$validator = new \Laminas\Validator\Hex();
if (!$validator->isValid($token)) {
return false;
}
Expand Down
12 changes: 6 additions & 6 deletions src/Authentication/Adapter/HybridAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
use Hybrid_Auth;
use PlaygroundUser\Mapper\UserProvider;
use PlaygroundUser\Options\ModuleOptions;
use Zend\Authentication\Result;
use Zend\ServiceManager\ServiceManager;
use Laminas\Authentication\Result;
use Laminas\ServiceManager\ServiceManager;
use ZfcUser\Authentication\Adapter\AbstractAdapter;
use ZfcUser\Mapper\UserInterface as UserMapperInterface;
use ZfcUser\Options\UserServiceOptionsInterface;
use Zend\EventManager\EventManagerInterface;
use Zend\EventManager\EventManager;
use Zend\EventManager\EventManagerAwareInterface;
use Laminas\EventManager\EventManagerInterface;
use Laminas\EventManager\EventManager;
use Laminas\EventManager\EventManagerAwareInterface;

class HybridAuth extends AbstractAdapter implements EventManagerAwareInterface
{
Expand Down Expand Up @@ -55,7 +55,7 @@ class HybridAuth extends AbstractAdapter implements EventManagerAwareInterface
*/
protected $roleMapper;

public function authenticate(\Zend\EventManager\EventInterface $authEvent)
public function authenticate(\Laminas\EventManager\EventInterface $authEvent)
{
$authEvent = $authEvent->getTarget();
if ($this->isSatisfied()) {
Expand Down
Loading

0 comments on commit 8b77d85

Please sign in to comment.