picocms / Pico

Pico is a stupidly simple, blazing fast, flat file CMS.
http://picocms.org/
MIT License
3.81k stars 616 forks source link

Twig 2.x and YAML 3.x not supported #685

Closed KanyonKris closed 6 months ago

KanyonKris commented 6 months ago

The current Pico 3.x alpha updates dependancies so Pico can run on PHP 8.x, which is good. But more dependancy updates are needed. Pico uses Twig 2.x which will be unsupported after December 2023. The current Twig 3.x dropped a lot of deprecated functions (https://twig.symfony.com/doc/2.x/deprecated.html). No idea how many of those Pico uses. Pico uses a really old version (3.x) of Symfony YAML. The current version is 7.x and all lower versions are unsupported. Would be nice if Pico were updated to use these newer versions (another 3.x alpha?). If I get some time I'll try installing the latest Twig and YAML and see how badly Pico blows up. I'm only a hack novice at PHP so most likely I won't be able to get Pico working. But Pico is too awesome to not try. Anyone want to give it a try? Help out?

github-actions[bot] commented 6 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in two days if no further activity occurs. Thank you for your contributions! :+1:

PhrozenByte commented 6 months ago

You might wanna upgrade to the pico-3.0 branch, containing the latest dev version of Pico 3.0 (even though it wasn't released, you can assume it as stable as Pico 2.1) using Twig 3.3 and Symfony YAML 5.4. You'll find info about how to use it (including a list of breaking changes) here on GitHub, just check a few of the more recent GitHub issues, this was discussed multiple times before.

KanyonKris commented 5 months ago

@PhrozenByte , I upgraded to 3.0 branch. Got an error the default theme was not found, so copied the default theme from my old version 2.x. Got an error the theme API was 3 and it expected 4, so edited pico-theme.yml to version 4. Got this error: Fatal error: Uncaught Twig\Error\SyntaxError: Unexpected token "name" of value "if" ("end of statement block" expected). in C:\Apache24\htdocs\pico3\themes\default\index.twig:46 Found the latest index.twig on your Github and it worked, no errors. Maybe I did the install wrong and didn't get the default theme installed. Here's what I did: composer create-project picocms/pico:dev-pico-3.0 pico3 I got it working but thought you might like to see how a composer newb screwed up.