diff --git a/.github/workflows/.ci.yml b/.github/workflows/.ci.yml index e6f05a3..401ae13 100644 --- a/.github/workflows/.ci.yml +++ b/.github/workflows/.ci.yml @@ -1,5 +1,4 @@ - -on: push +on: [push, pull_request] name: CI jobs: test: diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ddef9f..9e4a0f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,17 @@ - Put your changes here... +## 1.0.1 + +- Renamed package from `express-php-view-engine` to `php`. Thanks to Elmer Bulthuis for transferring the package name. +- Various dependencies bumped. + ## 1.0.0 -- Initial version. +- Initial version of superseding project. + - `express-php-view-engine` notably does not attempt to finish the work of the old `php` module. Instead it allows the native PHP parser to execute as a child process within Express applications. + +## 0.0.1 +- Initial version of original project. + - Originally the `php` module on npm was used by a separate project that attempted to implement a PHP parser in JavaScript for Node.js, but was never finished. One work in progress version was published, then the project remained stale for 8 years. diff --git a/README.md b/README.md index c79ec78..ab2c8ac 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,20 @@ # express-php-view-engine [![Build Status](https://github.com/rooseveltframework/express-php-view-engine/workflows/CI/badge.svg -)](https://github.com/rooseveltframework/express-php-view-engine/actions?query=workflow%3ACI) [![codecov](https://codecov.io/gh/rooseveltframework/express-php-view-engine/branch/master/graph/badge.svg)](https://codecov.io/gh/rooseveltframework/express-php-view-engine) [![npm](https://img.shields.io/npm/v/express-php-view-engine.svg)](https://www.npmjs.com/package/express-php-view-engine) +)](https://github.com/rooseveltframework/express-php-view-engine/actions?query=workflow%3ACI) [![codecov](https://codecov.io/gh/rooseveltframework/express-php-view-engine/branch/master/graph/badge.svg)](https://codecov.io/gh/rooseveltframework/express-php-view-engine) [![npm](https://img.shields.io/npm/v/php.svg)](https://www.npmjs.com/package/php) This module allows you to use [PHP](https://php.net) as a templating system for [Express framework](https://expressjs.com) applications. This module was built and is maintained by the [Roosevelt web framework](https://github.com/rooseveltframework/roosevelt) [team](https://github.com/orgs/rooseveltframework/people), but it can be used independently of Roosevelt as well. ## Usage -First declare `express-php-view-engine` as a dependency in your app. +First declare `php` as a dependency in your app. Then set PHP as a view engine in your Express app: ```js const express = require('express') const app = express() -const php = require('express-php-view-engine') +const php = require('php') // setup php templating engine app.set('views', path.join(__dirname, 'templates')) @@ -45,12 +45,12 @@ Note: This module presumes that the system you run this on has PHP installed and ## Configuration -As shown in the above example, `express-php-view-engine` will register values from the Express model as global variables in your PHP script by default. You can disable this behavior if desired two ways: +As shown in the above example, this module will register values from the Express model as global variables in your PHP script by default. You can disable this behavior if desired two ways: Disable registering globally: ```js -const php = require('express-php-view-engine') +const php = require('php') php.disableRegisterGlobalModel() // can be reenabled by calling php.enableRegisterGlobalModel() ``` @@ -65,4 +65,3 @@ app.get('/', (req, res) => { }) }) ``` - diff --git a/package-lock.json b/package-lock.json index d852d9b..9554829 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { - "name": "express-php-view-engine", - "version": "1.0.0", + "name": "php", + "version": "1.0.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -325,6 +325,12 @@ } } }, + "ansi-colors": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.4.tgz", + "integrity": "sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA==", + "dev": true + }, "ansi-escapes": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz", @@ -1302,6 +1308,15 @@ "lodash": "^4.13.1" } }, + "enquirer": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.5.tgz", + "integrity": "sha512-BNT1C08P9XD0vNg3J475yIUG+mVdp9T6towYFHUv897X0KoHBjB1shyrNmhmtHWKP17iSWgo7Gqh7BBuzLZMSA==", + "dev": true, + "requires": { + "ansi-colors": "^3.2.1" + } + }, "equal-length": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/equal-length/-/equal-length-1.0.1.tgz", @@ -1721,9 +1736,9 @@ "dev": true }, "eslint-scope": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz", - "integrity": "sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.0.tgz", + "integrity": "sha512-iiGRvtxWqgtx5m8EyQUJihBloE4EnYeGE/bz1wSPwJE6tZuJUtHlhqDM4Xj2ukE8Dyy1+HCZ4hE0fzIVMzb58w==", "dev": true, "requires": { "esrecurse": "^4.1.0", @@ -1740,20 +1755,20 @@ } }, "eslint-visitor-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", - "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.2.0.tgz", + "integrity": "sha512-WFb4ihckKil6hu3Dp798xdzSfddwKKU3+nGniKF6HfeW6OLd2OUDEPP7TcHtB5+QXOKg2s6B2DaMPE1Nn/kxKQ==", "dev": true }, "espree": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.0.0.tgz", - "integrity": "sha512-/r2XEx5Mw4pgKdyb7GNLQNsu++asx/dltf/CI8RFi9oGHxmQFgvLbc5Op4U6i8Oaj+kdslhJtVlEZeAqH5qOTw==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.1.0.tgz", + "integrity": "sha512-dcorZSyfmm4WTuTnE5Y7MEN1DyoPYy1ZR783QW1FJoenn7RailyWFsq/UL6ZAAA7uXurN9FIpYyUs3OfiIW+Qw==", "dev": true, "requires": { - "acorn": "^7.1.1", + "acorn": "^7.2.0", "acorn-jsx": "^5.2.0", - "eslint-visitor-keys": "^1.1.0" + "eslint-visitor-keys": "^1.2.0" } }, "esprima": { @@ -2650,12 +2665,12 @@ "dev": true }, "is-regex": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", - "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.0.tgz", + "integrity": "sha512-iI97M8KTWID2la5uYXlkbSDQIg4F6o1sYboZKKTDpnDQMLtUL86zxhgDet3Q2SriaYsyGqZ6Mn2SjbRKeLHdqw==", "dev": true, "requires": { - "has": "^1.0.3" + "has-symbols": "^1.0.1" } }, "is-regexp": { @@ -2837,9 +2852,9 @@ "dev": true }, "lint-staged": { - "version": "10.2.8", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-10.2.8.tgz", - "integrity": "sha512-36VUVhZuTJUG0yuSv66o+/Cep9Uwp+od6VkjNxQjHKWvHClVD0SjAZx++4H3zgdr6DxPoUl1y/PVygfPhzAXQQ==", + "version": "10.2.9", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-10.2.9.tgz", + "integrity": "sha512-ziRAuXEqvJLSXg43ezBpHxRW8FOJCXISaXU//BWrxRrp5cBdRkIx7g5IsB3OI45xYGE0S6cOacfekSjDyDKF2g==", "dev": true, "requires": { "chalk": "^4.0.0", @@ -2848,8 +2863,9 @@ "cosmiconfig": "^6.0.0", "debug": "^4.1.1", "dedent": "^0.7.0", + "enquirer": "^2.3.5", "execa": "^4.0.1", - "listr2": "^2.0.2", + "listr2": "^2.1.0", "log-symbols": "^4.0.0", "micromatch": "^4.0.2", "normalize-path": "^3.0.0", diff --git a/package.json b/package.json index 97cd59d..7268b08 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "express-php-view-engine", + "name": "php", "description": "Allows you to use PHP as a view engine for Express applications.", "author": "Roosevelt Framework Team ", "contributors": [ @@ -8,7 +8,7 @@ "url": "https://github.com/rooseveltframework/express-php-view-engine/graphs/contributors" } ], - "version": "1.0.0", + "version": "1.0.1", "files": [ "index.js", "loader.php"