Commit d77dc593 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Migration vers laminas

parent 77e8bcd1
Pipeline #10803 failed with stages
in 58 seconds
......@@ -9,24 +9,24 @@ use UnicaenApp\Mvc\Listener\MaintenanceListener;
use UnicaenApp\Mvc\Listener\ModalListener;
use UnicaenApp\Mvc\View\Http\ExceptionStrategy;
use UnicaenApp\Options\ModuleOptions;
use Zend\Console\Adapter\AdapterInterface as Console;
use Zend\Console\Request as ConsoleRequest;
use Zend\EventManager\EventInterface;
use Zend\Http\Request as HttpRequest;
use Zend\Mvc\I18n\Translator;
use Zend\ModuleManager\Feature\AutoloaderProviderInterface;
use Zend\ModuleManager\Feature\BootstrapListenerInterface;
use Zend\ModuleManager\Feature\ConfigProviderInterface;
use Zend\ModuleManager\Feature\ControllerPluginProviderInterface;
use Zend\ModuleManager\Feature\ServiceProviderInterface;
use Zend\Mvc\Console\View\ExceptionStrategy as ConsoleExceptionStrategy;
use Zend\Mvc\View\Http\ExceptionStrategy as HttpExceptionStrategy;
use Zend\ServiceManager\ServiceManager;
use Zend\Session\Container;
use Zend\Session\SessionManager;
use Zend\Validator\AbstractValidator;
use Zend\View\Helper\Navigation;
use Zend\View\HelperPluginManager;
use Laminas\Console\Adapter\AdapterInterface as Console;
use Laminas\Console\Request as ConsoleRequest;
use Laminas\EventManager\EventInterface;
use Laminas\Http\Request as HttpRequest;
use Laminas\Mvc\I18n\Translator;
use Laminas\ModuleManager\Feature\AutoloaderProviderInterface;
use Laminas\ModuleManager\Feature\BootstrapListenerInterface;
use Laminas\ModuleManager\Feature\ConfigProviderInterface;
use Laminas\ModuleManager\Feature\ControllerPluginProviderInterface;
use Laminas\ModuleManager\Feature\ServiceProviderInterface;
use Laminas\Mvc\Console\View\ExceptionStrategy as ConsoleExceptionStrategy;
use Laminas\Mvc\View\Http\ExceptionStrategy as HttpExceptionStrategy;
use Laminas\ServiceManager\ServiceManager;
use Laminas\Session\Container;
use Laminas\Session\SessionManager;
use Laminas\Validator\AbstractValidator;
use Laminas\View\Helper\Navigation;
use Laminas\View\HelperPluginManager;
define('__VENDOR_DIR__', dirname(dirname(__DIR__)));
......@@ -60,7 +60,7 @@ class Module implements
public function getAutoloaderConfig()
{
return array(
'Zend\Loader\StandardAutoloader' => array(
'Laminas\Loader\StandardAutoloader' => array(
'namespaces' => array(
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
),
......@@ -76,9 +76,9 @@ class Module implements
* @see BootstrapListenerInterface
* @return array
*/
public function onBootstrap(EventInterface $e) /* @var $e \Zend\Mvc\MvcEvent */
public function onBootstrap(EventInterface $e) /* @var $e \Laminas\Mvc\MvcEvent */
{
/* @var $application \Zend\Mvc\Application */
/* @var $application \Laminas\Mvc\Application */
$application = $e->getApplication();
/* @var $services ServiceManager */
$services = $application->getServiceManager();
......@@ -86,7 +86,7 @@ class Module implements
$this->bootstrapSession($e);
// la locale par défaut est celle du service de traduction
/** @var \Zend\I18n\Translator\Translator $translator */
/** @var \Laminas\I18n\Translator\Translator $translator */
$translator = $services->get('translator');
Locale::setDefault($translator->getLocale());
......@@ -111,7 +111,7 @@ class Module implements
$vhm = $services->get('ViewHelperManager');
/* @var $nvh Navigation */
$nvh = $vhm->get('Zend\View\Helper\Navigation');
$nvh = $vhm->get('Laminas\View\Helper\Navigation');
$nvh->setServiceLocator($services);
// Déclaration des plugins maison pour l'aide de vue de navigation
$invokables = array(
......@@ -145,7 +145,7 @@ class Module implements
/**
* Init session manager.
*
* @param \Zend\Mvc\MvcEvent $e
* @param \Laminas\Mvc\MvcEvent $e
*/
public function bootstrapSession($e)
{
......@@ -193,10 +193,10 @@ class Module implements
}
/**
* Expected to return \Zend\ServiceManager\Config object or array to
* Expected to return \Laminas\ServiceManager\Config object or array to
* seed such an object.
*
* @return array|\Zend\ServiceManager\Config
* @return array|\Laminas\ServiceManager\Config
*/
public function getControllerPluginConfig()
{
......
......@@ -17,8 +17,8 @@
* <http://www.doctrine-project.org>.
*/
use Zend\ServiceManager\ServiceManager;
use Zend\Mvc\Application;
use Laminas\ServiceManager\ServiceManager;
use Laminas\Mvc\Application;
ini_set('display_errors', true);
chdir(__DIR__);
......
......@@ -2,42 +2,44 @@
"name": "unicaen/app",
"description": "Module de base des applications unicaen",
"require": {
"php": ">=5.6 || >=7.0",
"ext-bcmath": "*",
"ext-intl": "*",
"ext-ldap": "*",
"beberlei/assert": "^2.9",
"doctrine/doctrine-orm-module": "*",
"mpdf/mpdf": "^7.1 || ^8.0",
"ocramius/proxy-manager": "^2.0",
"zendframework/zend-config": "^3.2",
"zendframework/zend-console": "^2.8",
"zendframework/zend-eventmanager": "^3.2",
"zendframework/zend-form": "^2.14",
"zendframework/zend-http": "^2.10",
"zendframework/zend-i18n": "^2.9",
"zendframework/zend-i18n-resources": "^2.6",
"zendframework/zend-json": "^2.6",
"zendframework/zend-ldap": "^2.10",
"zendframework/zend-log": "^2.10",
"zendframework/zend-mail": "^2.10",
"zendframework/zend-mvc": "^3.1",
"zendframework/zend-mvc-console": "^1.2",
"zendframework/zend-mvc-i18n": "^1.1",
"zendframework/zend-mvc-plugin-fileprg": "^1.1",
"zendframework/zend-mvc-plugin-flashmessenger": "^1.1",
"zendframework/zend-mvc-plugin-identity": "^1.1",
"zendframework/zend-mvc-plugin-prg": "^1.1",
"zendframework/zend-navigation": "^2.9",
"zendframework/zend-serializer": "^2.9",
"zendframework/zend-servicemanager": "^3.4",
"zendframework/zend-session": "^2.8",
"zendframework/zend-version": "^2.4",
"zendframework/zend-view": "^2.11"
"php": ">=5.6 || >=7.0",
"ext-bcmath": "*",
"ext-intl": "*",
"ext-ldap": "*",
"beberlei/assert": "^2.9",
"mpdf/mpdf": "^7.1",
"ocramius/proxy-manager": "^2.0",
"doctrine/doctrine-laminas-hydrator": "^2.0",
"doctrine/doctrine-orm-module": "^4.0",
"laminas/laminas-config": "^3.2",
"laminas/laminas-console": "^2.8",
"laminas/laminas-eventmanager": "^3.2",
"laminas/laminas-form": "^2.17",
"laminas/laminas-http": "^2.10",
"laminas/laminas-i18n": "^2.9",
"laminas/laminas-i18n-resources": "^2.6",
"laminas/laminas-json": "^3.2",
"laminas/laminas-ldap": "^2.10",
"laminas/laminas-log": "^2.10",
"laminas/laminas-mail": "^2.10",
"laminas/laminas-mvc": "^3.1",
"laminas/laminas-mvc-console": "^1.2",
"laminas/laminas-mvc-i18n": "^1.1",
"laminas/laminas-mvc-plugin-fileprg": "^1.2",
"laminas/laminas-mvc-plugin-flashmessenger": "^1.1",
"laminas/laminas-mvc-plugin-identity": "^1.1",
"laminas/laminas-mvc-plugin-prg": "*",
"laminas/laminas-navigation": "^2.9",
"laminas/laminas-serializer": "^2.9",
"laminas/laminas-servicemanager": "^3.4",
"laminas/laminas-session": "^2.8",
"laminas/laminas-view": "^2.11",
"laminas-api-tools/api-tools-asset-manager": "^1.2",
"laminas/laminas-dependency-plugin": "^2.1"
},
"require-dev": {
"zendframework/zend-test": "^3.2",
"phpunit/phpunit": "^5.6"
"laminas/laminas-test": "^3.2",
"phpunit/phpunit": "^5.6"
},
"autoload": {
"psr-0": {
......
......@@ -46,7 +46,7 @@ use UnicaenApp\View\Helper\Upload\UploaderHelper;
use UnicaenApp\View\Helper\Upload\UploaderHelperFactory;
use UnicaenApp\View\Helper\UserProfileSelect;
use UnicaenApp\View\Helper\UserProfileSelectFactory;
use Zend\Mvc\Console\Router\Simple;
use Laminas\Mvc\Console\Router\Simple;
return [
'router' => [
......@@ -279,10 +279,10 @@ return [
],
'service_manager' => [
'factories' => [
'translator' => 'Zend\I18n\Translator\TranslatorServiceFactory',
'navigation' => 'Zend\Navigation\Service\DefaultNavigationFactory',
'translator' => 'Laminas\I18n\Translator\TranslatorServiceFactory',
'navigation' => 'Laminas\Navigation\Service\DefaultNavigationFactory',
// service de gestion de la session
'Zend\Session\SessionManager' => 'UnicaenApp\Session\SessionManagerFactory',
'Laminas\Session\SessionManager' => 'UnicaenApp\Session\SessionManagerFactory',
// service d'accès aux options de config de ce module
'unicaen-app_module_options' => 'UnicaenApp\Options\ModuleOptionsFactory',
// mapper d'accès aux individus de l'annuaire LDAP
......
......@@ -6,9 +6,9 @@
* enlevez l'extension ".dist" et adaptez son contenu à vos besoins.
*/
use Zend\Session\Storage\SessionArrayStorage;
use Zend\Session\Validator\HttpUserAgent;
use Zend\Session\Validator\RemoteAddr;
use Laminas\Session\Storage\SessionArrayStorage;
use Laminas\Session\Validator\HttpUserAgent;
use Laminas\Session\Validator\RemoteAddr;
return [
'unicaen-app' => [
......
......@@ -89,7 +89,7 @@ Exemple d'utilisation :
<file php DemoController.php>
public function pdfAction()
{
$renderer = $this->getServiceLocator()->get('view_renderer'); /* @var $renderer \Zend\View\Renderer\PhpRenderer */
$renderer = $this->getServiceLocator()->get('view_renderer'); /* @var $renderer \Laminas\View\Renderer\PhpRenderer */
$exporter = new \UnicaenApp\Exporter\Pdf($renderer, 'A4', true);
$exporter->addBodyHtml('<h1>Module UnicaenApp</h1>');
$exporter->addBodyHtml('<h2>Export PDF</h2>', false);
......
......@@ -120,7 +120,7 @@ Exemple d\'utilisation :
``` {.php}
public function pdfAction()
{
$renderer = $this->getServiceLocator()->get('view_renderer'); /* @var $renderer \Zend\View\Renderer\PhpRenderer */
$renderer = $this->getServiceLocator()->get('view_renderer'); /* @var $renderer \Laminas\View\Renderer\PhpRenderer */
$exporter = new \UnicaenApp\Exporter\Pdf($renderer, 'A4', true);
$exporter->addBodyHtml('<h1>Module UnicaenApp</h1>');
$exporter->addBodyHtml('<h2>Export PDF</h2>', false);
......
......@@ -19,7 +19,7 @@ Le filtre d'entrée (input filter) "[[develop:unicaen2:moduleunicaenunicaenapp:f
Exemple :
<code php>
class CaractEvtFieldset extends \Zend\Form\Fieldset implements \Zend\InputFilter\InputFilterProviderInterface
class CaractEvtFieldset extends \Laminas\Form\Fieldset implements \Laminas\InputFilter\InputFilterProviderInterface
{
const DATETIME_FORMAT_PHP = 'd-m-Y H:i';
const DATETIME_FORMAT_HUMAN = 'jj-mm-aaaa hh:mm';
......@@ -30,9 +30,9 @@ class CaractEvtFieldset extends \Zend\Form\Fieldset implements \Zend\InputFilter
$this->setLabel("Caractéristiques de l'événement")
->add(new \UnicaenApp\Form\Element\DateInfSup('dates', array('label' => "Début et fin éventuelle")))
->add(new \Zend\Form\Element\Text('duree_prevue', array('label' => _("Durée prévue"))))
->add(new \Zend\Form\Element\Textarea('serv_affectes', array('label' => _("Services numériques affectés principalement"))))
->add(new \Zend\Form\Element\Textarea('actions', array('label' => _("Moyens et actions mis en oeuvre"))));
->add(new \Laminas\Form\Element\Text('duree_prevue', array('label' => _("Durée prévue"))))
->add(new \Laminas\Form\Element\Textarea('serv_affectes', array('label' => _("Services numériques affectés principalement"))))
->add(new \Laminas\Form\Element\Textarea('actions', array('label' => _("Moyens et actions mis en oeuvre"))));
}
public function getInputFilterSpecification()
......@@ -122,7 +122,7 @@ public function rechercherAction()
'extra' => "Bla bla", // infos complémentaires (facultatives) sur l'item
);
}
return new \Zend\View\Model\JsonModel($result);
return new \Laminas\View\Model\JsonModel($result);
}
exit;
}
......@@ -132,7 +132,7 @@ public function rechercherAction()
===== Description =====
Ceci est une aide de vue pour élément de formulaire.
Il accepte les éléments de type <php>Zend\Form\Element\MultiCheckbox</php>.
Il accepte les éléments de type <php>Laminas\Form\Element\MultiCheckbox</php>.
* Il ajoute deux boutons au multicheckbox habituel : un pour tout sélectionner et un pour ne rien sélectionner.
* En outre, il encapsule les items dans une liste dont la hauteur est définissable au besoin. Ainsi pas de risque d'avoir une liste interminable à l'écran.
......
......@@ -28,7 +28,7 @@ permet de valider la saisie de cet élément.
Exemple :
``` {.php}
class CaractEvtFieldset extends \Zend\Form\Fieldset implements \Zend\InputFilter\InputFilterProviderInterface
class CaractEvtFieldset extends \Laminas\Form\Fieldset implements \Laminas\InputFilter\InputFilterProviderInterface
{
const DATETIME_FORMAT_PHP = 'd-m-Y H:i';
const DATETIME_FORMAT_HUMAN = 'jj-mm-aaaa hh:mm';
......@@ -39,9 +39,9 @@ class CaractEvtFieldset extends \Zend\Form\Fieldset implements \Zend\InputFilter
$this->setLabel("Caractéristiques de l'événement")
->add(new \UnicaenApp\Form\Element\DateInfSup('dates', array('label' => "Début et fin éventuelle")))
->add(new \Zend\Form\Element\Text('duree_prevue', array('label' => _("Durée prévue"))))
->add(new \Zend\Form\Element\Textarea('serv_affectes', array('label' => _("Services numériques affectés principalement"))))
->add(new \Zend\Form\Element\Textarea('actions', array('label' => _("Moyens et actions mis en oeuvre"))));
->add(new \Laminas\Form\Element\Text('duree_prevue', array('label' => _("Durée prévue"))))
->add(new \Laminas\Form\Element\Textarea('serv_affectes', array('label' => _("Services numériques affectés principalement"))))
->add(new \Laminas\Form\Element\Textarea('actions', array('label' => _("Moyens et actions mis en oeuvre"))));
}
public function getInputFilterSpecification()
......@@ -153,7 +153,7 @@ public function rechercherAction()
'extra' => "Bla bla", // infos complémentaires (facultatives) sur l'item
);
}
return new \Zend\View\Model\JsonModel($result);
return new \Laminas\View\Model\JsonModel($result);
}
exit;
}
......@@ -166,7 +166,7 @@ Description
-----------
Ceci est une aide de vue pour élément de formulaire. Il accepte les
éléments de type `Zend\Form\Element\MultiCheckbox`{.php}.
éléments de type `Laminas\Form\Element\MultiCheckbox`{.php}.
- Il ajoute deux boutons au multicheckbox habituel : un pour tout
sélectionner et un pour ne rien sélectionner.
......
......@@ -19,9 +19,9 @@ Stratégie permettant d'afficher proprement un message d'erreur lorsqu'une excep
Cette stratégie est activée par défaut dans le module UnicaenApp :
<file php Module.php>
public function onBootstrap(EventInterface $e) /* @var $e \Zend\Mvc\MvcEvent */
public function onBootstrap(EventInterface $e) /* @var $e \Laminas\Mvc\MvcEvent */
{
/* @var $application \Zend\Mvc\Application */
/* @var $application \Laminas\Mvc\Application */
$application = $e->getApplication();
/* @var $services ServiceManager */
$services = $application->getServiceManager();
......@@ -43,21 +43,21 @@ public function onBootstrap(EventInterface $e) /* @var $e \Zend\Mvc\MvcEvent */
Stratégie permettant de na pas retourner le template en AJAX.
<file php Module.php>
public function onBootstrap(EventInterface $e) /* @var $e \Zend\Mvc\MvcEvent */
public function onBootstrap(EventInterface $e) /* @var $e \Laminas\Mvc\MvcEvent */
{
/* Déclare la dernière vue transmise comme terminale si on est en AJAX */
$sharedEvents = $e->getApplication()->getEventManager()->getSharedManager();
$sharedEvents->attach('Zend\Mvc\Controller\AbstractActionController','dispatch',
$sharedEvents->attach('Laminas\Mvc\Controller\AbstractActionController','dispatch',
function($e) {
$result = $e->getResult();
if(is_array($result)){
$result = new \Zend\View\Model\ViewModel($result);
$result = new \Laminas\View\Model\ViewModel($result);
$e->setResult($result);
}elseif(empty($result)){
$result = new \Zend\View\Model\ViewModel();
$result = new \Laminas\View\Model\ViewModel();
$e->setResult($result);
}
if ($result instanceof \Zend\View\Model\ViewModel) {
if ($result instanceof \Laminas\View\Model\ViewModel) {
$result->setTerminal($e->getRequest()->isXmlHttpRequest());
}
});
......
......@@ -35,9 +35,9 @@ l\'exception lancée implémente l\'interface
Cette stratégie est activée par défaut dans le module UnicaenApp :
``` {.php}
public function onBootstrap(EventInterface $e) /* @var $e \Zend\Mvc\MvcEvent */
public function onBootstrap(EventInterface $e) /* @var $e \Laminas\Mvc\MvcEvent */
{
/* @var $application \Zend\Mvc\Application */
/* @var $application \Laminas\Mvc\Application */
$application = $e->getApplication();
/* @var $services ServiceManager */
$services = $application->getServiceManager();
......@@ -61,21 +61,21 @@ AjaxStrategy
Stratégie permettant de na pas retourner le template en AJAX.
``` {.php}
public function onBootstrap(EventInterface $e) /* @var $e \Zend\Mvc\MvcEvent */
public function onBootstrap(EventInterface $e) /* @var $e \Laminas\Mvc\MvcEvent */
{
/* Déclare la dernière vue transmise comme terminale si on est en AJAX */
$sharedEvents = $e->getApplication()->getEventManager()->getSharedManager();
$sharedEvents->attach('Zend\Mvc\Controller\AbstractActionController','dispatch',
$sharedEvents->attach('Laminas\Mvc\Controller\AbstractActionController','dispatch',
function($e) {
$result = $e->getResult();
if(is_array($result)){
$result = new \Zend\View\Model\ViewModel($result);
$result = new \Laminas\View\Model\ViewModel($result);
$e->setResult($result);
}elseif(empty($result)){
$result = new \Zend\View\Model\ViewModel();
$result = new \Laminas\View\Model\ViewModel();
$e->setResult($result);
}
if ($result instanceof \Zend\View\Model\ViewModel) {
if ($result instanceof \Laminas\View\Model\ViewModel) {
$result->setTerminal($e->getRequest()->isXmlHttpRequest());
}
});
......
......@@ -104,13 +104,13 @@ Vous pouvez le paramétrer dans la config locale du module UnicaenApp, exemple :
Exemple d'utilisation :
<file php>
// corps au format HTML
$part = new \Zend\Mime\Part($html);
$part->type = \Zend\Mime\Mime::TYPE_HTML;
$part = new \Laminas\Mime\Part($html);
$part->type = \Laminas\Mime\Mime::TYPE_HTML;
$part->charset = 'UTF-8';
$body = new \Zend\Mime\Message();
$body = new \Laminas\Mime\Message();
$body->addPart($part);
// init
$message = new \Zend\Mail\Message();
$message = new \Laminas\Mail\Message();
$message->setEncoding('UTF-8')
->addTo($ldapPeople->getMail(), $ldapPeople->getNomComplet(true))
->setFrom('dsi.applications@unicaen.fr', "Contact Application")
......@@ -129,7 +129,7 @@ public function modalAction()
{
$terminal = $this->getRequest()->isXmlHttpRequest();
$viewModel = new \Zend\View\Model\ViewModel();
$viewModel = new \Laminas\View\Model\ViewModel();
$viewModel->setTemplate('application/demo/modal')
->setTerminal($terminal) // Turn off the layout for AJAX requests
->setVariables(array(
......@@ -154,7 +154,7 @@ public function popoverAction()
{
$terminal = $this->getRequest()->isXmlHttpRequest();
$viewModel = new \Zend\View\Model\ViewModel();
$viewModel = new \Laminas\View\Model\ViewModel();
$viewModel->setTemplate('application/demo/popover')
->setTerminal($terminal) // Turn off the layout for AJAX requests
->setVariables(array(
......@@ -187,8 +187,8 @@ Exemple d'un formulaire de contact avec une saisie en 3 étapes (identité, coor
namespace Application\Form;
use UnicaenApp\Form\MultipageForm;
use Zend\Form\Element\Csrf;
use Zend\Form\Element\Submit;
use Laminas\Form\Element\Csrf;
use Laminas\Form\Element\Submit;
class ContactForm extends MultipageForm
{
......@@ -205,17 +205,17 @@ class ContactForm extends MultipageForm
}
</file>
Chaque fieldset hérite de la classe ''\Zend\Form\Fieldset''.
Chaque fieldset hérite de la classe ''\Laminas\Form\Fieldset''.
Exemple du fieldset de saisie des coordonnées :
<file php CoordFieldset.php>
namespace Application\Form;
use Zend\Form\Element\Text;
use Zend\Form\Element\Textarea;
use Zend\Form\Fieldset;
use Zend\InputFilter\InputFilterProviderInterface;
use Laminas\Form\Element\Text;
use Laminas\Form\Element\Textarea;
use Laminas\Form\Fieldset;
use Laminas\InputFilter\InputFilterProviderInterface;
class CoordFieldset extends Fieldset implements InputFilterProviderInterface
{
......@@ -234,13 +234,13 @@ class CoordFieldset extends Fieldset implements InputFilterProviderInterface
'adresse' => array(
'required' => false,
'filters' => array(
array('name' => '\Zend\Filter\StringTrim'),
array('name' => '\Laminas\Filter\StringTrim'),
),
),
'email' => array(
'required' => true,
'filters' => array(
array('name' => '\Zend\Filter\StringTrim'),
array('name' => '\Laminas\Filter\StringTrim'),
),
'validators' => array(
array(
......@@ -251,7 +251,7 @@ class CoordFieldset extends Fieldset implements InputFilterProviderInterface
)
),
array(
'name' => '\Zend\Validator\EmailAddress',
'name' => '\Laminas\Validator\EmailAddress',
'options' => array(
'messages' => array('emailAddressInvalidFormat' => "L'adresse mail spécifiée est invalide"),
),
......@@ -308,8 +308,8 @@ namespace Application\Controller;
use Application\Form\ContactForm;
use UnicaenApp\Form\MultipageForm;
use Zend\Http\PhpEnvironment\Response;
use Zend\Mvc\Controller\AbstractActionController;
use Laminas\Http\PhpEnvironment\Response;
use Laminas\Mvc\Controller\AbstractActionController;
class DemandeController extends AbstractActionController
{
......@@ -404,9 +404,9 @@ namespace Application\Form;
use Unicaen\Exception;
use UnicaenApp\Form\MultipageFormFieldsetInterface;
use Zend\Form\Element\Text;
use Zend\Form\Fieldset;
use Zend\InputFilter\InputFilterProviderInterface;
use Laminas\Form\Element\Text;
use Laminas\Form\Fieldset;
use Laminas\InputFilter\InputFilterProviderInterface;
class DiversFieldset extends Fieldset implements InputFilterProviderInterface, MultipageFormFieldsetInterface
{
......
......@@ -124,13 +124,13 @@ Exemple d'utilisation :
``` {.php}
// corps au format HTML
$part = new \Zend\Mime\Part($html);
$part->type = \Zend\Mime\Mime::TYPE_HTML;
$part = new \Laminas\Mime\Part($html);
$part->type = \Laminas\Mime\Mime::TYPE_HTML;
$part->charset = 'UTF-8';
$body = new \Zend\Mime\Message();
$body = new \Laminas\Mime\Message();
$body->addPart($part);
// init
$message = new \Zend\Mail\Message();
$message = new \Laminas\Mail\Message();
$message->setEncoding('UTF-8')
->addTo($ldapPeople->getMail(), $ldapPeople->getNomComplet(true))
->setFrom('dsi.applications@unicaen.fr', "Contact Application")
......@@ -153,7 +153,7 @@ public function modalAction()
{
$terminal = $this->getRequest()->isXmlHttpRequest();
$viewModel = new \Zend\View\Model\ViewModel();
$viewModel = new \Laminas\View\Model\ViewModel();
$viewModel->setTemplate('application/demo/modal')
->setTerminal($terminal) // Turn off the layout for AJAX requests
->setVariables(array(
......@@ -181,7 +181,7 @@ public function popoverAction()
{
$terminal = $this->getRequest()->isXmlHttpRequest();
$viewModel = new \Zend\View\Model\ViewModel();
$viewModel = new \Laminas\View\Model\ViewModel();
$viewModel->setTemplate('application/demo/popover')
->setTerminal($terminal) // Turn off the layout for AJAX requests
->setVariables(array(
......@@ -224,8 +224,8 @@ Exemple d'un formulaire de contact avec une saisie en 3 étapes
namespace Application\Form;
use UnicaenApp\Form\MultipageForm;
use Zend\Form\Element\Csrf;
use Zend\Form\Element\Submit;
use Laminas\Form\Element\Csrf;
use Laminas\Form\Element\Submit;
class ContactForm extends MultipageForm
{
......@@ -242,17 +242,17 @@ class ContactForm extends MultipageForm
}
```
Chaque fieldset hérite de la classe `\Zend\Form\Fieldset`.
Chaque fieldset hérite de la classe `\Laminas\Form\Fieldset`.
Exemple du fieldset de saisie des coordonnées :
```php
namespace Application\Form;
use Zend\Form\Element\Text;
use Zend\Form\Element\Textarea;
use Zend\Form\Fieldset;
use Zend\InputFilter\InputFilterProviderInterface;
use Laminas\Form\Element\Text;
use Laminas\Form\Element\Textarea;
use Laminas\Form\Fieldset;
use Laminas\InputFilter\InputFilterProviderInterface;
class CoordFieldset extends Fieldset implements InputFilterProviderInterface
{
......@@ -271,13 +271,13 @@ class CoordFieldset extends Fieldset implements InputFilterProviderInterface
'adresse' => array(
'required' => false,
'filters' => array(
array('name' => '\Zend\Filter\StringTrim'),
array('name' => '\Laminas\Filter\StringTrim'),
),
),
'email' => array(
'required' => true,
'filters' => array(
array('name' => '\Zend\Filter\StringTrim'),
array('name' => '\Laminas\Filter\StringTrim'),
),
'validators' => array(
array(
......@@ -288,7 +288,7 @@ class CoordFieldset extends Fieldset implements InputFilterProviderInterface
)
),
array(
'name' => '\Zend\Validator\EmailAddress',
'name' => '\Laminas\Validator\EmailAddress',
'options' => array(
'messages' => array('emailAddressInvalidFormat' => "L'adresse mail spécifiée est invalide"),
),
......@@ -361,8 +361,8 @@ namespace Application\Controller;
use Application\Form\ContactForm;
use UnicaenApp\Form\MultipageForm;
use Zend\Http\PhpEnvironment\Response;
use Zend\Mvc\Controller\AbstractActionController;
use Laminas\Http\PhpEnvironment\Response;
use Laminas\Mvc\Controller\AbstractActionController;
class DemandeController extends AbstractActionController