8000 build(php): updating to php 8 and twig 3 · ecomplus/ecomplus.github.io@2cf8459 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2cf8459

Browse files
committed
build(php): updating to php 8 and twig 3
1 parent 8d3cf3c commit 2cf8459

File tree

5 files changed

+109
-53
lines changed

5 files changed

+109
-53
lines changed

build/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Technology stack
2-
+ [PHP](http://php.net/) 7
2+
+ [PHP](http://php.net/) 8
33
+ [Composer](https://getcomposer.org/) dependency manager
4-
+ [Twig 2](https://twig.symfony.com/) template engine
4+
+ [Twig 3](https://twig.symfony.com/) template engine
55

66
# Setting up
77
```bash
8-
git clone https://github.com/ecomclub/ecomclub.github.io.git
9-
cd ecomclub.github.io/build
8+
git clone https://github.com/ecomplus/ecomplus.github.io.git
9+
cd ecomplus.github.io/build
1010
composer install
1111
```
1212

build/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"twig/twig": "^2.0",
3+
"twig/twig": "^3.0",
44
"erusev/parsedown": "^1.7"
55
}
66
}

build/composer.lock

Lines changed: 99 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/main.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
require __DIR__ . '/inc/get-json.php';
66
require __DIR__ . '/inc/apis.php';
77

8-
// Twig 2 for template rendering
8+
// Twig 3 for template rendering
99
// https://twig.symfony.com/doc/2.x/api.html
1010
$templates_dir = __DIR__ . '/templates';
11-
$loader = new Twig_Loader_Filesystem($templates_dir);
11+
$loader = new \Twig\Loader\FilesystemLoader($templates_dir);
1212
// setup twig object with no compilation cache
13-
$twig = new Twig_Environment($loader, array('strict_variables' => true));
13+
$twig = new \Twig\Environment($loader, array('strict_variables' => true));
1414

1515
$site_title = 'E-Com Plus Developers';
1616
// internal links (abstractions)

build/templates/base.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
See template files in the `build/templates` directory
55
-->
66

7-
{% spaceless %}
7+
{% apply spaceless %}
88
<html lang="en">
99
<head>
1010
<meta charset="utf-8">
@@ -220,4 +220,4 @@
220220
{% endif %}
221221
</body>
222222
</html>
223-
{% endspaceless %}
223+
{% endapply %}

0 commit comments

Comments
 (0)
0