Commit 4cbbeba7 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Essai migration vers laminas

parent 82bc0f1f
Pipeline #8852 failed with stage
in 7 seconds
......@@ -12,7 +12,7 @@
require __DIR__ . '/../vendor/autoload.php';
use Zend\Config\Writer\PhpArray;
use Laminas\Config\Writer\PhpArray;
$defaultConfig = [
'unicaen-app' => [
......
{
"name": "unicaen/skeleton-application",
"description": "Squelette d'application Unicaen (ZF2)",
"description": "Squelette d'application Unicaen (Laminas aka ZF3)",
"repositories": [
{
"type": "composer",
......@@ -12,12 +12,13 @@
"unicaen/auth": "^3.0",
"unicaen/bjy-authorize": "^3.0",
"unicaen/faq": "^3.0",
"unicaen/ldap": "^3.0"
"unicaen/ldap": "^3.0",
"laminas/laminas-dependency-plugin": "^1.0"
},
"require-dev": {
"zendframework/zend-test": "^3.2",
"laminas/laminas-test": "^3.2",
"phpunit/phpunit": ">=3.7",
"zendframework/zend-developer-tools": ">=1.0"
"laminas/laminas-developer-tools": ">=1.0"
},
"scripts": {
"post-install-cmd": [
......
This source diff could not be displayed because it is too large. You can view the blob instead.
<?php
$modules = [
'Zend\Cache',
'Zend\Filter',
'Zend\Form',
'Zend\Hydrator',
'Zend\I18n',
'Zend\InputFilter',
'Zend\Log',
'Zend\Mail',
'Zend\Mvc\Console',
'Zend\Mvc\I18n',
// 'Zend\Mvc\Plugin\FilePrg',
'Zend\Mvc\Plugin\FlashMessenger',
// 'Zend\Mvc\Plugin\Identity',
'Zend\Mvc\Plugin\Prg',
'Zend\Navigation',
'Zend\Paginator',
'Zend\Router',
'Zend\Session',
'Zend\Validator',
'Laminas\Cache',
'Laminas\Filter',
'Laminas\Form',
'Laminas\Hydrator',
'Laminas\I18n',
'Laminas\InputFilter',
'Laminas\Log',
'Laminas\Mail',
'Laminas\Mvc\Console',
'Laminas\Mvc\I18n',
// 'Laminas\Mvc\Plugin\FilePrg',
'Laminas\Mvc\Plugin\FlashMessenger',
// 'Laminas\Mvc\Plugin\Identity',
'Laminas\Mvc\Plugin\Prg',
'Laminas\Navigation',
'Laminas\Paginator',
'Laminas\Router',
'Laminas\Session',
'Laminas\Validator',
'DoctrineModule',
'DoctrineORMModule',
......@@ -33,7 +33,7 @@ $modules = [
$applicationEnv = getenv('APPLICATION_ENV') ?: 'production';
if ('development' === $applicationEnv) {
$modules[] = 'ZendDeveloperTools';
$modules[] = 'Laminas\DeveloperTools';
// $modules[] = 'UnicaenCode';
}
......
<?php
return [
'view_manager' => [
'display_not_found_reason' => true,
'display_exceptions' => true,
],
];
......@@ -19,11 +19,9 @@ return [
'app_infos' => [
'nom' => "NomDeVotreApplication",
'desc' => "Description succincte de votre application",
//'version' => cf. 'version.global.php'
//'date' => cf. 'version.global.php'
'version' => "0.0.1",
'date' => "07/11/2017",
'contact' => ['mail' => "dsi.applications@unicaen.fr", /*'tel' => "01 02 03 04 05"*/],
'mentionsLegales' => "http://www.unicaen.fr/acces-direct/mentions-legales/",
'informatiqueEtLibertes' => "http://www.unicaen.fr/acces-direct/informatique-et-libertes/",
],
/**
......@@ -79,11 +77,7 @@ return [
// Session validators (used for security).
'validators' => [
RemoteAddr::class,
// Erreur rencontrée avec ce validateur lorsqu'on passe en "Version pour ordinateur" sur un téléphone Android :
// `Fatal error: Uncaught Zend\Session\Exception\RuntimeException: Session validation failed
// in /var/www/app/vendor/zendframework/zend-session/src/SessionManager.php on line 162`
//HttpUserAgent::class,
HttpUserAgent::class,
]
],
//
......
......@@ -14,7 +14,7 @@ $settings = [
/**
* Affichage ou non du formulaire d'authentification avec un compte local.
*/
'enabled' => true,
'enabled' => false,
],
/**
......@@ -25,7 +25,7 @@ $settings = [
* Affichage ou non du formulaire d'authentification via l'annuaire LDAP.
* NB: en réalité cela permet aussi l'authentification avec un compte local.
*/
'enabled' => false,
'enabled' => true,
],
/**
......
......@@ -10,7 +10,7 @@ services:
PHP_VERSION: 7.3
ports:
- "8080:80"
- "8443:443"
- "7443:443"
volumes:
- .:/var/www/html
working_dir: /var/www/html
......
......@@ -36,14 +36,14 @@ if ($zf2Path) {
$loader->add('Zend', $zf2Path);
} else {
include $zf2Path . '/Zend/Loader/AutoloaderFactory.php';
Zend\Loader\AutoloaderFactory::factory(array(
'Zend\Loader\StandardAutoloader' => array(
Laminas\Loader\AutoloaderFactory::factory(array(
'Laminas\Loader\StandardAutoloader' => array(
'autoregister_zf' => true
)
));
}
}
if (!class_exists('Zend\Loader\AutoloaderFactory')) {
if (!class_exists('Laminas\Loader\AutoloaderFactory')) {
throw new RuntimeException('Unable to load ZF2. Run `php composer.phar install` or define a ZF2_PATH environment variable.');
}
......@@ -2,10 +2,10 @@
namespace Application;
use Zend\Mvc\ModuleRouteListener;
use Zend\Mvc\MvcEvent;
use Zend\Http\Request as HttpRequest;
use Zend\Session\SessionManager;
use Laminas\Mvc\ModuleRouteListener;
use Laminas\Mvc\MvcEvent;
use Laminas\Http\Request as HttpRequest;
use Laminas\Session\SessionManager;
class Module
{
......@@ -19,7 +19,7 @@ class Module
$moduleRouteListener->attach($eventManager);
/* Active un layout spécial si la requête est de type AJAX. Valable pour TOUS les modules de l'application. */
$eventManager->getSharedManager()->attach('Zend\Mvc\Controller\AbstractActionController', 'dispatch',
$eventManager->getSharedManager()->attach('Laminas\Mvc\Controller\AbstractActionController', 'dispatch',
function (MvcEvent $e) {
$request = $e->getRequest();
if ($request instanceof HttpRequest && $request->isXmlHttpRequest()) {
......@@ -41,7 +41,7 @@ class Module
public function getAutoloaderConfig()
{
return [
'Zend\Loader\StandardAutoloader' => [
'Laminas\Loader\StandardAutoloader' => [
'namespaces' => [
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
],
......
......@@ -9,8 +9,8 @@
namespace Application\Controller;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;
use Laminas\Mvc\Controller\AbstractActionController;
use Laminas\View\Model\ViewModel;
class IndexController extends AbstractActionController
{
......
......@@ -9,8 +9,8 @@
namespace Demo;
use Zend\Mvc\ModuleRouteListener;
use Zend\Mvc\MvcEvent;
use Laminas\Mvc\ModuleRouteListener;
use Laminas\Mvc\MvcEvent;
class Module
{
......@@ -22,7 +22,7 @@ class Module
$moduleRouteListener->attach($eventManager);
/* Active un layout spécial si la requête est de type AJAX. Valable pour TOUS les modules de l'application. */
$eventManager->getSharedManager()->attach('Zend\Mvc\Controller\AbstractActionController', 'dispatch',
$eventManager->getSharedManager()->attach('Laminas\Mvc\Controller\AbstractActionController', 'dispatch',
function (MvcEvent $e) {
$request = $e->getRequest();
if ($request instanceof HttpRequest && $request->isXmlHttpRequest()) {
......@@ -40,7 +40,7 @@ class Module
public function getAutoloaderConfig()
{
return array(
'Zend\Loader\StandardAutoloader' => array(
'Laminas\Loader\StandardAutoloader' => array(
'namespaces' => array(
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
),
......
......@@ -72,7 +72,7 @@ Interrogez la table `user` pour vérifier la présence de l'utilisateur `demo`,
1|demo|demo@mail.fr|Demo|$2y$10$GmGzPXsLK5Kts30ZrS9QnOLsNYDgZ62797Kitp4Z1nWHlB1g7DZma|1|
NB: l'utilisateur `admin` a pour mot de passe `admin`, chiffré avec Bcrypt comme ceci :
`php --run 'require "vendor/autoload.php"; $bcrypt = new Zend\Crypt\Password\Bcrypt(); var_dump($bcrypt->create("xxx"));'`
`php --run 'require "vendor/autoload.php"; $bcrypt = new Laminas\Crypt\Password\Bcrypt(); var_dump($bcrypt->create("xxx"));'`
## Configuration du module
......
......@@ -2,8 +2,8 @@
namespace Demo\Controller;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;
use Laminas\Mvc\Controller\AbstractActionController;
use Laminas\View\Model\ViewModel;
class IndexController extends AbstractActionController
{
......
......@@ -11,4 +11,4 @@ chdir(dirname(__DIR__));
require 'init_autoloader.php';
// Run the application!
Zend\Mvc\Application::init(require 'config/application.config.php')->run();
Laminas\Mvc\Application::init(require 'config/application.config.php')->run();
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment