From f63246ac2029a0e09445cfa8d724c27900e48410 Mon Sep 17 00:00:00 2001 From: julien Date: Mon, 9 Mar 2026 14:33:50 +0100 Subject: [PATCH] Simplified --- .gitignore | 3 + .../47/47cab4dc7982a59d8be24ee5dbfcb55a.php | 151 --------------- .../a8/a8a112b9f839398a4c36c8749dbe2f2d.php | 46 +++-- .../e0/e0b9aff4ba5a590eadfd3a590206e0b2.php | 182 ------------------ views/pages/post_form.twig | 9 +- 5 files changed, 35 insertions(+), 356 deletions(-) delete mode 100644 var/cache/twig/47/47cab4dc7982a59d8be24ee5dbfcb55a.php delete mode 100644 var/cache/twig/e0/e0b9aff4ba5a590eadfd3a590206e0b2.php diff --git a/.gitignore b/.gitignore index a53eda4..3058b57 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,6 @@ composer.lock # Base de données SQLite /database/*.sqlite /database/*.db + +# Cache et logs +/var/ \ No newline at end of file diff --git a/var/cache/twig/47/47cab4dc7982a59d8be24ee5dbfcb55a.php b/var/cache/twig/47/47cab4dc7982a59d8be24ee5dbfcb55a.php deleted file mode 100644 index a2e0f25..0000000 --- a/var/cache/twig/47/47cab4dc7982a59d8be24ee5dbfcb55a.php +++ /dev/null @@ -1,151 +0,0 @@ - - */ - private array $macros = []; - - public function __construct(Environment $env) - { - parent::__construct($env); - - $this->source = $this->getSourceContext(); - - $this->blocks = [ - 'title' => [$this, 'block_title'], - 'content' => [$this, 'block_content'], - ]; - } - - protected function doGetParent(array $context): bool|string|Template|TemplateWrapper - { - // line 1 - return "layout.twig"; - } - - protected function doDisplay(array $context, array $blocks = []): iterable - { - $macros = $this->macros; - $this->parent = $this->load("layout.twig", 1); - yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks)); - } - - // line 3 - /** - * @return iterable - */ - public function block_title(array $context, array $blocks = []): iterable - { - $macros = $this->macros; - yield "Mon Blog"; - yield from []; - } - - // line 5 - /** - * @return iterable - */ - public function block_content(array $context, array $blocks = []): iterable - { - $macros = $this->macros; - // line 6 - $context['_parent'] = $context; - $context['_seq'] = CoreExtension::ensureTraversable(($context["posts"] ?? null)); - $context['_iterated'] = false; - foreach ($context['_seq'] as $context["_key"] => $context["post"]) { - // line 7 - yield "
-

"; - // line 8 - yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["post"], "title", [], "any", false, false, false, 8), "html", null, true); - yield "

- -
- Publié le "; - // line 11 - yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate(CoreExtension::getAttribute($this->env, $this->source, $context["post"], "createdAt", [], "any", false, false, false, 11), "d/m/Y à H:i"), "html", null, true); - yield " - "; - // line 12 - if ((($tmp = CoreExtension::getAttribute($this->env, $this->source, $context["post"], "isRecent", [7], "method", false, false, false, 12)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) { - // line 13 - yield " Nouveau - "; - } - // line 15 - yield "
- -

"; - // line 17 - yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["post"], "getExcerpt", [200], "method", false, false, false, 17), "html", null, true); - yield "

- -

- env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["post"], "getSlug", [], "method", false, false, false, 20), "html", null, true); - yield "\">Lire la suite → -

-
-"; - $context['_iterated'] = true; - } - // line 23 - if (!$context['_iterated']) { - // line 24 - yield "

Aucun article publié.

-"; - } - $_parent = $context['_parent']; - unset($context['_seq'], $context['_key'], $context['post'], $context['_parent'], $context['_iterated']); - $context = array_intersect_key($context, $_parent) + $_parent; - yield from []; - } - - /** - * @codeCoverageIgnore - */ - public function getTemplateName(): string - { - return "pages/home.twig"; - } - - /** - * @codeCoverageIgnore - */ - public function isTraitable(): bool - { - return false; - } - - /** - * @codeCoverageIgnore - */ - public function getDebugInfo(): array - { - return array ( 114 => 24, 112 => 23, 104 => 20, 98 => 17, 94 => 15, 90 => 13, 88 => 12, 84 => 11, 78 => 8, 75 => 7, 70 => 6, 63 => 5, 52 => 3, 41 => 1,); - } - - public function getSourceContext(): Source - { - return new Source("", "pages/home.twig", "/home/julien/Documents/Git/julien/blog-slim/views/pages/home.twig"); - } -} diff --git a/var/cache/twig/a8/a8a112b9f839398a4c36c8749dbe2f2d.php b/var/cache/twig/a8/a8a112b9f839398a4c36c8749dbe2f2d.php index 1b4385f..56d6636 100644 --- a/var/cache/twig/a8/a8a112b9f839398a4c36c8749dbe2f2d.php +++ b/var/cache/twig/a8/a8a112b9f839398a4c36c8749dbe2f2d.php @@ -109,68 +109,67 @@ class __TwigTemplate_1bca1bf826c65d946ceb9c6169e6cfec extends Template

Annuler

"; - // line 47 - if (((array_key_exists("post", $context) && !(null === ($context["post"] ?? null))) && (CoreExtension::getAttribute($this->env, $this->source, ($context["post"] ?? null), "id", [], "any", false, false, false, 47) > 0))) { - // line 48 + // line 48 + if (((array_key_exists("post", $context) && !(null === ($context["post"] ?? null))) && (CoreExtension::getAttribute($this->env, $this->source, ($context["post"] ?? null), "id", [], "any", false, false, false, 48) > 0))) { + // line 49 yield "
Créé le : "; - // line 50 - yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate(CoreExtension::getAttribute($this->env, $this->source, ($context["post"] ?? null), "createdAt", [], "any", false, false, false, 50), "d/m/Y à H:i"), "html", null, true); + // line 51 + yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate(CoreExtension::getAttribute($this->env, $this->source, ($context["post"] ?? null), "createdAt", [], "any", false, false, false, 51), "d/m/Y à H:i"), "html", null, true); yield "
Modifié le : "; - // line 51 - yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate(CoreExtension::getAttribute($this->env, $this->source, ($context["post"] ?? null), "updatedAt", [], "any", false, false, false, 51), "d/m/Y à H:i"), "html", null, true); + // line 52 + yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate(CoreExtension::getAttribute($this->env, $this->source, ($context["post"] ?? null), "updatedAt", [], "any", false, false, false, 52), "d/m/Y à H:i"), "html", null, true); yield "
"; } - // line 54 + // line 55 yield " "; yield from []; } - // line 57 + // line 58 /** * @return iterable */ public function block_scripts(array $context, array $blocks = []): iterable { $macros = $this->macros; - // line 58 + // line 59 yield " "; yield from []; @@ -215,7 +219,7 @@ class __TwigTemplate_1bca1bf826c65d946ceb9c6169e6cfec extends Template */ public function getDebugInfo(): array { - return array ( 169 => 58, 162 => 57, 156 => 54, 150 => 51, 146 => 50, 142 => 48, 140 => 47, 133 => 42, 129 => 40, 125 => 38, 123 => 37, 114 => 31, 105 => 25, 98 => 22, 94 => 19, 90 => 17, 86 => 15, 84 => 14, 80 => 12, 73 => 11, 66 => 7, 62 => 5, 60 => 4, 53 => 3, 42 => 1,); + return array ( 168 => 59, 161 => 58, 155 => 55, 149 => 52, 145 => 51, 141 => 49, 139 => 48, 132 => 43, 128 => 41, 124 => 39, 122 => 38, 114 => 32, 105 => 25, 98 => 22, 94 => 19, 90 => 17, 86 => 15, 84 => 14, 80 => 12, 73 => 11, 66 => 7, 62 => 5, 60 => 4, 53 => 3, 42 => 1,); } public function getSourceContext(): Source diff --git a/var/cache/twig/e0/e0b9aff4ba5a590eadfd3a590206e0b2.php b/var/cache/twig/e0/e0b9aff4ba5a590eadfd3a590206e0b2.php deleted file mode 100644 index 9247b7c..0000000 --- a/var/cache/twig/e0/e0b9aff4ba5a590eadfd3a590206e0b2.php +++ /dev/null @@ -1,182 +0,0 @@ - - */ - private array $macros = []; - - public function __construct(Environment $env) - { - parent::__construct($env); - - $this->source = $this->getSourceContext(); - - $this->blocks = [ - 'title' => [$this, 'block_title'], - 'content' => [$this, 'block_content'], - ]; - } - - protected function doGetParent(array $context): bool|string|Template|TemplateWrapper - { - // line 1 - return "layout.twig"; - } - - protected function doDisplay(array $context, array $blocks = []): iterable - { - $macros = $this->macros; - $this->parent = $this->load("layout.twig", 1); - yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks)); - } - - // line 3 - /** - * @return iterable - */ - public function block_title(array $context, array $blocks = []): iterable - { - $macros = $this->macros; - yield "Admin – Gestion des articles"; - yield from []; - } - - // line 5 - /** - * @return iterable - */ - public function block_content(array $context, array $blocks = []): iterable - { - $macros = $this->macros; - // line 6 - yield "

Gestion des articles

- - -

- + Ajouter un article -

- -"; - // line 13 - if ((($tmp = !Twig\Extension\CoreExtension::testEmpty(($context["posts"] ?? null))) && $tmp instanceof Markup ? (string) $tmp : $tmp)) { - // line 14 - yield " - - - - - - - - - - "; - // line 24 - $context['_parent'] = $context; - $context['_seq'] = CoreExtension::ensureTraversable(($context["posts"] ?? null)); - foreach ($context['_seq'] as $context["_key"] => $context["post"]) { - // line 25 - yield " - - - - - - "; - } - $_parent = $context['_parent']; - unset($context['_seq'], $context['_key'], $context['post'], $context['_parent']); - $context = array_intersect_key($context, $_parent) + $_parent; - // line 46 - yield " -
TitreCréé leModifié leActions
- "; - // line 27 - yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["post"], "title", [], "any", false, false, false, 27), "html", null, true); - yield " - "; - // line 28 - if ((($tmp = CoreExtension::getAttribute($this->env, $this->source, $context["post"], "isRecent", [7], "method", false, false, false, 28)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) { - // line 29 - yield " Nouveau - "; - } - // line 31 - yield " "; - // line 32 - yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate(CoreExtension::getAttribute($this->env, $this->source, $context["post"], "createdAt", [], "any", false, false, false, 32), "d/m/Y H:i"), "html", null, true); - yield ""; - // line 33 - yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate(CoreExtension::getAttribute($this->env, $this->source, $context["post"], "updatedAt", [], "any", false, false, false, 33), "d/m/Y H:i"), "html", null, true); - yield " - env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["post"], "id", [], "any", false, false, false, 35), "html", null, true); - yield "\" class=\"btn btn-sm btn-secondary\">Éditer - -
env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["post"], "id", [], "any", false, false, false, 37), "html", null, true); - yield "\" style=\"display:inline;\"> - -
-
-"; - } else { - // line 49 - yield "

Aucun article à gérer.

-"; - } - yield from []; - } - - /** - * @codeCoverageIgnore - */ - public function getTemplateName(): string - { - return "pages/admin.twig"; - } - - /** - * @codeCoverageIgnore - */ - public function isTraitable(): bool - { - return false; - } - - /** - * @codeCoverageIgnore - */ - public function getDebugInfo(): array - { - return array ( 148 => 49, 143 => 46, 128 => 37, 123 => 35, 118 => 33, 114 => 32, 111 => 31, 107 => 29, 105 => 28, 101 => 27, 97 => 25, 93 => 24, 81 => 14, 79 => 13, 70 => 6, 63 => 5, 52 => 3, 41 => 1,); - } - - public function getSourceContext(): Source - { - return new Source("", "pages/admin.twig", "/home/julien/Documents/Git/julien/blog-slim/views/pages/admin.twig"); - } -} diff --git a/views/pages/post_form.twig b/views/pages/post_form.twig index 8e1d793..9307422 100644 --- a/views/pages/post_form.twig +++ b/views/pages/post_form.twig @@ -29,7 +29,7 @@ Créer un article

@@ -60,7 +60,7 @@ Créer un article {% endblock %} \ No newline at end of file