Skip to content

Commit

Permalink
Merge pull request #341 from fenom-template/v3.0.0
Browse files Browse the repository at this point in the history
Migrate to php8
  • Loading branch information
bzick authored Feb 27, 2023
2 parents c7b8835 + e1601dc commit fbf4f46
Show file tree
Hide file tree
Showing 34 changed files with 1,829 additions and 3,097 deletions.
43 changes: 19 additions & 24 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: PHP Composer

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
on: push

permissions:
contents: read
Expand All @@ -15,22 +11,21 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run tests
run: vendor/bin/phpunit
- uses: actions/checkout@v3

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run tests
run: vendor/bin/phpunit
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ composer.phar
tests/resources/compile/*
!.gitkeep
tests/resources/template/*
sandbox/compiled/*
sandbox/compiled/*
/.phpunit.result.cache
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
Changelog
=========
## 3.0.0 (2023-02-23)

- Fenom supported php8+
- Remove `eval` from template compiler
- `strftime` -> `date` with fallback support.
- update tokenizer
- bugfixes and optimizations

## 2.11.0 (2016-06-09)

Expand Down
12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Fenom - Template Engine for PHP
* **Subject:** Template engine
* **Syntax:** Smarty-like
* **Documentation:** **[English](./docs/en/readme.md)**, **[Russian](./docs/ru/readme.md)**
* **PHP version:** 5.4+
* **State:** [![Build Status](https://travis-ci.org/fenom-template/fenom.svg?branch=master)](https://travis-ci.org/fenom-template/fenom) [![Coverage Status](https://coveralls.io/repos/fenom-template/fenom/badge.svg?branch=master)](https://coveralls.io/r/fenom-template/fenom?branch=master)
* **PHP version:** 8.0+
* **State:** [![PHP Composer](https://github.com/fenom-template/fenom/actions/workflows/php.yml/badge.svg?branch=master)](https://github.com/fenom-template/fenom/actions/workflows/php.yml) [![Coverage Status](https://coveralls.io/repos/fenom-template/fenom/badge.svg?branch=master)](https://coveralls.io/r/fenom-template/fenom?branch=master)
* **Version:** [![Latest Stable Version](https://poser.pugx.org/fenom/fenom/v/stable.png)](https://packagist.org/packages/fenom/fenom)
* **Packagist:** [fenom/fenom](https://packagist.org/packages/fenom/fenom) [![Total Downloads](https://poser.pugx.org/fenom/fenom/downloads.png)](https://packagist.org/packages/fenom/fenom)
* **Composer:** `composer require fenom/fenom`
Expand All @@ -22,16 +22,10 @@ Fenom - Template Engine for PHP
### Install

If you use composer in your project then you can to install Fenom as package.
However, if you are not using composer you have to configure _autoloader_ to work with Fenom.
Fenom implements the `PSR-0` PHP standard to load classes which are located in the `src/` directory.
Templater already has own autoload-function, to register call method `Fenom::registerAutoload`:
```php
Fenom::registerAutoload();
```

### Setup

There is two way to create Fenom instance:
There is two-way to create Fenom instance:

* Long way: use operator `new`
* Shot way: use static factory-method
Expand Down
10 changes: 6 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@
}
],
"require": {
"php": ">=5.3.0",
"php": ">=8.0.0",
"ext-tokenizer": "*"
},
"require-dev": {
"phpunit/phpunit": "<6.0",
"satooshi/php-coveralls": "*"
"phpunit/phpunit": "9.*"
},
"autoload": {
"psr-0": { "Fenom\\": "src/" },
"psr-4": { "Fenom\\": "src/Fenom" },
"classmap": [ "src/Fenom.php" ]
},
"autoload-dev": {
"classmap": [ "tests/cases" ]
}
}
Loading

0 comments on commit fbf4f46

Please sign in to comment.