Olivier Massot 5 anni fa
parent
commit
5ac8501943

+ 2 - 1
README.md

@@ -3,7 +3,7 @@
 ### Pré-requis:
 
 * php 7.2
-* Typo3 v9.5-10.4 (en mode composer)
+* Typo3 v9.5 (en mode composer)
 
 ### Les extensions
 
@@ -19,6 +19,7 @@ du répertoire de l'application typo3
     		"psr-4": {
     			"Opentalent\\OtConnect\\": "public/typo3conf/ext/ot_connect/Classes",
     			"Opentalent\\OtTemplating\\": "public/typo3conf/ext/ot_templating/Classes"
+    			"Opentalent\\OtOptimizer\\": "public/typo3conf/ext/ot_optimizer/Classes"
     		}
     	}
 

+ 1 - 1
ot_connect/composer.json

@@ -9,7 +9,7 @@
         }
     ],
     "require": {
-        "typo3/cms-core": "^8.7.1 || ^10.4"
+        "typo3/cms-core": "^9.5 || ^10.4"
     },
     "autoload": {
         "psr-4": {

+ 13 - 2
ot_optimizer/Readme.md

@@ -2,5 +2,16 @@
 
 Optimize the Typo3 FE and BE behaviour for large amounts of sites
 
-> IMPORTANT: This extension only aims to improve performances. If disabled, it shall not 
-> cause more than performances losses. We need to be able to disable it anytime without other consequences.
+|||
+|---|---|
+| Extension key | ot_optimizer |
+| Vendor | Opentalent |
+| Nom | OtOptimizer |
+
+> **IMPORTANT**: This extension only aims to improve performances. **If disabled, it shall not 
+> cause anything else than performances losses**. We need to be able to disable it anytime without other consequences.
+
+Cette extension utilise en particulier des XClasses, qui permettent de surcharger le comportement du noyau Typo3,
+mais qui induisent par ailleurs un certain risque de conflit en cas de mise à jour de Typo3.
+
+> A propos des XClasses: <https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/Xclasses/Index.html>

+ 2 - 2
ot_optimizer/composer.json

@@ -22,7 +22,7 @@
         }
     },
     "replace": {
-        "ot_connect": "self.version",
-        "typo3-ter/ot-optimize": "self.version"
+        "ot_optimizer": "self.version",
+        "typo3-ter/ot-optimizer": "self.version"
     }
 }

+ 0 - 82
ot_templating/Classes/Page/ErrorHandler.php

@@ -1,82 +0,0 @@
-<?php
-
-namespace Opentalent\OtTemplating\Page;
-
-use Psr\Http\Message\ResponseInterface;
-use Psr\Http\Message\ServerRequestInterface;
-use TYPO3\CMS\Core\Error\PageErrorHandler\PageErrorHandlerInterface;
-use TYPO3\CMS\Core\Http\HtmlResponse;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Fluid\View\TemplateView;
-use TYPO3Fluid\Fluid\View\ViewInterface;
-
-class ErrorHandler implements PageErrorHandlerInterface
-{
-    const TEMPLATES_ROOT_PATHS = 'EXT:ot_templating/Resources/Private/Templates';
-    const LAYOUTS_ROOT_PATHS = 'EXT:ot_templating/Resources/Private/Layouts';
-    const PARTIALS_ROOT_PATHS = 'EXT:ot_templating/Resources/Private/Partials';
-
-    const TEMPLATE_FILES = [
-        403 => self::TEMPLATES_ROOT_PATHS . '/Page/Error/403.html',
-        404 => self::TEMPLATES_ROOT_PATHS . '/Page/Error/404.html',
-        500 => self::TEMPLATES_ROOT_PATHS . '/Page/Error/500.html'
-    ];
-
-    /**
-     * Status code of the response
-     * @var int
-     */
-    protected $statusCode;
-
-    /**
-     * Configuration of the error handler as set in site configuration.
-     * @var array
-     */
-    protected $errorHandlerConfiguration;
-
-    /**
-     * @var ViewInterface
-     */
-    protected $view;
-
-    public function __construct(int $statusCode, array $configuration)
-    {
-        $this->statusCode = $statusCode;
-        $this->errorHandlerConfiguration = $configuration;
-
-        $this->view = GeneralUtility::makeInstance(TemplateView::class);
-        $this->view->setTemplateRootPaths([self::TEMPLATES_ROOT_PATHS]);
-        $this->view->setLayoutRootPaths([self::LAYOUTS_ROOT_PATHS]);
-        $this->view->setPartialRootPaths([self::PARTIALS_ROOT_PATHS]);
-        $this->view->setTemplatePathAndFilename(
-            GeneralUtility::getFileAbsFileName(self::TEMPLATE_FILES[$statusCode])
-        );
-    }
-
-    /**
-     * @param ServerRequestInterface $request
-     * @param string $message
-     * @param array $reasons
-     * @return ResponseInterface
-     */
-    public function handlePageError(
-        ServerRequestInterface $request,
-        string $message,
-        array $reasons = []
-    ): ResponseInterface {
-
-        $pageRepository = GeneralUtility::makeInstance(OtPageRepository::class);
-        $site = $pageRepository->getCurrentSite();
-        $baseUri = $site->getBase();
-
-        $this->view->assignMultiple([
-            'request' => $request,
-            'message' => $message,
-            'reasons' => $reasons,
-            'homeUri' => $baseUri,
-            'siteTitle' => $site->getConfiguration()['websiteTitle']
-        ]);
-
-        return new HtmlResponse($this->view->render(), $this->statusCode);
-    }
-}

+ 0 - 3
ot_templating/Readme.md

@@ -47,8 +47,5 @@ Enregistrer, et quitter.
 * Onglet Page layouts:
   * Changer 'Page Layout - this page' et mettre 'Gabarit Accueil'
   * Changer 'Page Layout - subpages ' et mettre 'Gabarit simple'
-* Onglet Page Configuration:
-  * Choisissez un modèle de site et un thème de couleur
-  * Personnaliser le site si besoin en fonction des options. Ces paramètres sont facultatifs et viendront remplacer les paramètres par défaut.
 
 Enregistrer, et quitter.

+ 0 - 28
ot_templating/Resources/Private/Templates/Page/Error/403.html

@@ -1,28 +0,0 @@
-<!DOCTYPE html>
-<html dir="ltr" lang="fr-FR">
-<head>
-    <meta charset="utf-8">
-
-    <title>{siteTitle}</title>
-    <meta name="generator" content="TYPO3 CMS" />
-    <meta name="robots" content="index,follow,archive" />
-    <meta name="viewport" content="width=device-width" />
-    <meta name="twitter:card" content="summary" />
-
-    <link rel="stylesheet"
-          type="text/css"
-          href="/typo3conf/ext/ot_templating/Resources/Public/assets/_common/style/errpages.css"/>
-</head>
-<body>
-<div id="errpage">
-    <header>
-        <h1 class="title">{siteTitle}</h1>
-    </header>
-
-    <div class="message">
-        <p>Vous n'êtes pas autorisé à consulter cette page</p>
-        <p>Avez vous pensé à vous authentifier?</p>
-        <a href="{homeUri}">Revenir à la page d'accueil</a>
-    </div>
-</div>
-</body>

+ 0 - 30
ot_templating/Resources/Private/Templates/Page/Error/404.html

@@ -1,30 +0,0 @@
-<!DOCTYPE html>
-<html dir="ltr" lang="fr-FR">
-<head>
-    <meta charset="utf-8">
-
-    <title>{siteTitle}</title>
-    <meta name="generator" content="TYPO3 CMS" />
-    <meta name="robots" content="index,follow,archive" />
-    <meta name="viewport" content="width=device-width" />
-    <meta name="twitter:card" content="summary" />
-
-    <link rel="stylesheet"
-          type="text/css"
-          href="/typo3conf/ext/ot_templating/Resources/Public/assets/_common/style/errpages.css"/>
-</head>
-<body>
-    <div id="errpage">
-        <header>
-            <h1 class="title">{siteTitle}</h1>
-        </header>
-
-        <div class="message">
-            <p>Il semblerait que la page que vous souhaitez consulter n'existe pas ou n'est plus disponible.</p>
-            <p>
-                Veuillez vérifier que l'URL saisie est bien correcte, ou
-               <a href="{homeUri}">cliquez ici pour revenir à la page d'accueil.</a>
-            </p>
-        </div>
-    </div>
-</body>

+ 0 - 26
ot_templating/Resources/Private/Templates/Page/Error/500.html

@@ -1,26 +0,0 @@
-<!DOCTYPE html>
-<html dir="ltr" lang="fr-FR">
-<head>
-    <meta charset="utf-8">
-
-    <title>{siteTitle}</title>
-    <meta name="generator" content="TYPO3 CMS" />
-    <meta name="robots" content="index,follow,archive" />
-    <meta name="viewport" content="width=device-width" />
-    <meta name="twitter:card" content="summary" />
-
-    <link rel="stylesheet"
-          type="text/css"
-          href="/typo3conf/ext/ot_templating/Resources/Public/assets/_common/style/errpages.css"/>
-</head>
-<body>
-<div id="errpage">
-    <header>
-        <h1 class="title">{siteTitle}</h1>
-    </header>
-
-    <div class="message">
-        <p>Une erreur s'est produite, nous nous excusons pour la gêne occasionnée</p>
-    </div>
-</div>
-</body>

+ 0 - 43
ot_templating/Resources/Public/assets/_common/style/errpages.css

@@ -1,43 +0,0 @@
-
-#errpage {
-    width: 100%;
-    font-family: 'Source Sans Pro',sans-serif;;
-}
-
-#errpage header {
-    display: flex;
-    flex-direction: row;
-    justify-content: center;
-    align-items: center;
-    height: 200px;
-}
-
-#errpage .title {
-    color: #4d4d4d;
-}
-
-#errpage .message {
-    display: flex;
-    flex-direction: column;
-    justify-content: center;
-    align-items: center;
-    text-align: center;
-    min-height: 200px;
-    line-height: 2em;
-    font-size: 17px;
-    padding: 24px 0;
-    background-color: #ffe6cc;
-}
-
-#errpage a {
-    margin-top: 16px;
-    font-weight: bold;
-    color: #b35c00;
-    text-decoration: none;
-    padding: 3px;
-}
-
-#errpage a:hover {
-    color: #994f00;
-}
-

+ 1 - 1
ot_templating/composer.json

@@ -9,7 +9,7 @@
         }
     ],
     "require": {
-        "typo3/cms-core": "^8.7.1 || ^10.4",
+        "typo3/cms-core": "^9.5 || ^10.4",
         "fluidtypo3/vhs": "^6",
         "fluidtypo3/flux": "^9",
         "fluidtypo3/fluidpages": "^5",