diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 1166d3f..35f0154 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: true matrix: - php: [7.3, 7.4, 8.0] # 7.2, + php: [8.0] os: [ubuntu-latest, macOS-latest] # windows-latest, # include: # will not testing on php 7.2 # - os: 'ubuntu-latest' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e42d9b9..9e9c986 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: true matrix: - php: [7.4] + php: [8.0] steps: - name: Checkout @@ -32,11 +32,14 @@ jobs: with: php-version: ${{ matrix.php}} tools: pecl, php-cs-fixer, phpunit - extensions: mbstring, dom, fileinfo, mysql, openssl # , swoole-4.4.19 #optional, setup extensions + extensions: mbstring, dom, fileinfo, openssl # , swoole-4.4.19 #optional, setup extensions ini-values: post_max_size=56M, short_open_tag=On #optional, setup php.ini configuration coverage: none #optional, setup coverage driver: xdebug, none - - name: Install dependencies # eg: v1.0.3 + # Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" + # Docs: https://getcomposer.org/doc/articles/scripts.md + + - name: Install dependencies run: | echo $RELEASE_TAG echo $RELEASE_NAME @@ -44,27 +47,13 @@ jobs: echo "release tag: ${tag1}" composer update --no-progress - # Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" - # Docs: https://getcomposer.org/doc/articles/scripts.md - - # https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#steps-context - # - name: Generate changelog file - # id: changelog - # run: | - # php bin/kite gh cl prev $RELEASE_TAG --style gh-release --no-merges --fetch-tags --unshallow --file tmp/changelog-${RELEASE_TAG}.md - # cat tmp/changelog-${RELEASE_TAG}.md - - # https://github.com/meeDamian/github-release -# - name: Create release and upload assets -# uses: meeDamian/github-release@2.0 -# with: -# gzip: false -# token: ${{ secrets.GITHUB_TOKEN }} -# tag: ${{ env.RELEASE_TAG }} -# name: ${{ env.RELEASE_TAG }} -# body: | -# ${{ steps.changelog.outputs.CHLOGBODY }} -# files: kite-${{ env.RELEASE_TAG }}.phar + # more see https://github.com/inhere/kite + - name: Generate changelog file + id: changelog + run: | + wget -c -q https://github.com/inhere/kite/releases/latest/download/kite.phar + php kite.phar git cl prev last --style gh-release --no-merges --fetch-tags --unshallow --file changelog.md + cat changelog.md # https://github.com/softprops/action-gh-release - name: Create release and upload assets @@ -73,7 +62,7 @@ jobs: with: name: ${{ env.RELEASE_TAG }} tag_name: ${{ env.RELEASE_TAG }} - # body_path: tmp/changelog-${{ env.RELEASE_TAG }}.md + body_path: changelog.md # files: kite-${{ env.RELEASE_TAG }}.phar env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index a477beb..e84dc70 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,25 @@ # php-pkg-template -[![License](https://img.shields.io/packagist/l/inherelab/php-pkg-template.svg?style=flat-square)](LICENSE) -[![Php Version](https://img.shields.io/badge/php-%3E=7.2.0-brightgreen.svg?maxAge=2592000)](https://packagist.org/packages/inherelab/php-pkg-template) -[![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/inherelab/php-pkg-template)](https://github.com/inherelab/php-pkg-template) -[![Actions Status](https://github.com/inherelab/php-pkg-template/workflows/Unit-Tests/badge.svg)](https://github.com/inherelab/php-pkg-template/actions) +[![License](https://img.shields.io/packagist/l/phppkg/fasttpl.svg?style=flat-square)](LICENSE) +[![Php Version](https://img.shields.io/badge/php-%3E=7.4.0-brightgreen.svg?maxAge=2592000)](https://packagist.org/packages/phppkg/fasttpl) +[![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/phppkg/fasttpl)](https://github.com/phppkg/fasttpl) +[![Actions Status](https://github.com/phppkg/fasttpl/workflows/Unit-Tests/badge.svg)](https://github.com/phppkg/fasttpl/actions) -TODO: package description +⚡️ Simple and fast template engine for PHP ## Install **composer** ```bash -composer require inherelab/php-pkg-template +composer require phppkg/fasttpl ``` ## Usage - clone this repository to local - update readme description -- search all `inherelab/php-pkg-template` and replace to your package name. +- search all `phppkg/fasttpl` and replace to your package name. - update `composer.json` contents: name, description, require, autoload ## License diff --git a/composer.json b/composer.json index 30de95a..3b4dd7f 100644 --- a/composer.json +++ b/composer.json @@ -1,9 +1,9 @@ { - "name": "inherelab/php-pkg-template", - "description": "TODO: package description", + "name": "phppkg/fasttpl", + "description": "⚡️ Simple and fast template engine for PHP", "type": "template", "license": "MIT", - "homepage": "https://github.com/inherelab/php-pkg-template", + "homepage": "https://github.com/phppkg/fasttpl", "authors": [ { "name": "inhere", @@ -11,22 +11,22 @@ } ], "require": { - "php": ">7.1.0", + "php": ">7.4.0", "ext-mbstring": "*", "toolkit/cli-utils":"~1.0" }, "autoload": { "psr-4": { - "InhereLab\\PhpPkg\\": "src/" + "PhpPkg\\FastTpl\\": "src/" } }, "autoload-dev": { "psr-4": { - "InhereLab\\PhpPkgTest\\": "test/" + "PhpPkg\\FastTplTest\\": "test/" } }, "bin": [ - + ], "scripts": { "test": "php vender/bin/phpunit" diff --git a/test/BaseTestCase.php b/test/BaseTestCase.php index a282d70..d344c65 100644 --- a/test/BaseTestCase.php +++ b/test/BaseTestCase.php @@ -1,8 +1,12 @@ getMethod($method); - + $method = new \ReflectionMethod($class, $method); $method->setAccessible(true); @@ -54,6 +58,6 @@ protected function runAndGetException(callable $cb): Throwable return $e; } - return new RuntimeException('NO ERROR'); + return new RuntimeException('NO ERROR', -1); } } diff --git a/test/bootstrap.php b/test/bootstrap.php index 794628b..1249b52 100644 --- a/test/bootstrap.php +++ b/test/bootstrap.php @@ -8,8 +8,8 @@ $libDir = dirname(__DIR__); $npMap = [ - 'InhereLab\\PhpPkgTest\\' => $libDir . '/test/', - 'InhereLab\\PhpPkg\\' => $libDir . '/src/', + 'PhpPkg\\FastTplTest\\' => $libDir . '/test/', + 'PhpPkg\\FastTpl\\' => $libDir . '/src/', ]; spl_autoload_register(static function ($class) use ($npMap) {