Browse Source

Updated the documentation

master
Cédric Belin 2 weeks ago
parent
commit
20e5ca35d4
5 changed files with 13 additions and 17 deletions
  1. +1
    -1
      README.md
  2. +0
    -4
      doc/about/see_also.md
  3. +2
    -2
      doc/index.md
  4. +5
    -5
      doc/installation.md
  5. +5
    -5
      doc/usage.md

+ 1
- 1
README.md View File

@@ -1,5 +1,5 @@
# Gulp-PHP-Minify
![Gulp](https://badgen.net/badge/gulp/%3E%3D4.0.0/green) ![Runtime](https://badgen.net/npm/node/@cedx/gulp-php-minify) ![Release](https://badgen.net/npm/v/@cedx/gulp-php-minify) ![Types](https://badgen.net/npm/types/@cedx/gulp-php-minify) ![License](https://badgen.net/npm/license/@cedx/gulp-php-minify) ![Downloads](https://badgen.net/npm/dt/@cedx/gulp-php-minify) ![Dependencies](https://badgen.net/david/dep/cedx/gulp-php-minify) ![Coverage](https://badgen.net/coveralls/c/github/cedx/gulp-php-minify) ![Build](https://badgen.net/github/checks/cedx/gulp-php-minify)
![Gulp](https://badgen.net/badge/gulp/%3E%3D4.0.0/green) ![Runtime](https://badgen.net/npm/node/@cedx/gulp-php-minify) ![Release](https://badgen.net/npm/v/@cedx/gulp-php-minify) ![Types](https://badgen.net/npm/types/@cedx/gulp-php-minify) ![License](https://badgen.net/npm/license/@cedx/gulp-php-minify) ![Downloads](https://badgen.net/npm/dt/@cedx/gulp-php-minify) ![Dependencies](https://badgen.net/david/dep/cedx/gulp-php-minify) ![Coverage](https://badgen.net/coveralls/c/github/cedx/gulp-php-minify) ![Build](https://badgen.net/github/checks/cedx/gulp-php-minify/main)

[Gulp](https://gulpjs.com) plug-in minifying [PHP](https://www.php.net) source code by removing comments and whitespace.



+ 0
- 4
doc/about/see_also.md View File

@@ -9,7 +9,3 @@
## Testing
- [Continuous integration](https://github.com/cedx/gulp-php-minify/actions)
- [Code coverage](https://coveralls.io/github/cedx/gulp-php-minify)

## Other implementations
- Dart: [Grinder-PHP-Minify](https://docs.belin.io/grinder-php-minify)
- PHP: [Robo-PHP-Minify](https://docs.belin.io/robo-php-minify)

+ 2
- 2
doc/index.md View File

@@ -1,12 +1,12 @@
# Gulp-PHP-Minify
![Gulp](https://badgen.net/badge/gulp/%3E%3D4.0.0/green) ![Runtime](https://badgen.net/npm/node/@cedx/gulp-php-minify) ![Release](https://badgen.net/npm/v/@cedx/gulp-php-minify) ![Types](https://badgen.net/npm/types/@cedx/gulp-php-minify) ![License](https://badgen.net/npm/license/@cedx/gulp-php-minify) ![Downloads](https://badgen.net/npm/dt/@cedx/gulp-php-minify) ![Dependencies](https://badgen.net/david/dep/cedx/gulp-php-minify) ![Coverage](https://badgen.net/coveralls/c/github/cedx/gulp-php-minify) ![Build](https://badgen.net/github/checks/cedx/gulp-php-minify)
![Gulp](https://badgen.net/badge/gulp/%3E%3D4.0.0/green) ![Runtime](https://badgen.net/npm/node/@cedx/gulp-php-minify) ![Release](https://badgen.net/npm/v/@cedx/gulp-php-minify) ![Types](https://badgen.net/npm/types/@cedx/gulp-php-minify) ![License](https://badgen.net/npm/license/@cedx/gulp-php-minify) ![Downloads](https://badgen.net/npm/dt/@cedx/gulp-php-minify) ![Dependencies](https://badgen.net/david/dep/cedx/gulp-php-minify) ![Coverage](https://badgen.net/coveralls/c/github/cedx/gulp-php-minify) ![Build](https://badgen.net/github/checks/cedx/gulp-php-minify/main)

[Gulp](https://gulpjs.com) plug-in minifying [PHP](https://www.php.net) source code by removing comments and whitespace.

## Quick start
Install the latest version of **Gulp-PHP-Minify** with [npm](https://www.npmjs.com):

```shell
``` shell
npm install @cedx/gulp-php-minify
```



+ 5
- 5
doc/installation.md View File

@@ -6,12 +6,12 @@ You also need the [Command Line Utility for Gulp](https://www.npmjs.com/package/
You can verify if you're already good to go with the following commands:

```shell
``` shell
node --version
# v14.5.0
# v15.1.0

npm --version
# 6.14.5
# 7.0.8

gulp --version
# CLI version: 2.2.0
@@ -27,13 +27,13 @@ gulp --version
### 1. Install it
From a command prompt, run:

```shell
``` shell
npm install @cedx/gulp-php-minify
```

### 2. Import it
Now in your [JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript) code, you can use:

```js
``` js
import {phpMinify} from '@cedx/gulp-php-minify';
```

+ 5
- 5
doc/usage.md View File

@@ -18,7 +18,7 @@ You have two possibles choices:

If you choose the second option, as long as Gulp does not natively support ES modules, you must load this package using an [`import` expression](https://nodejs.org/api/esm.html#esm_import_expressions):

```js
``` js
const {dest, series, src, task} = require('gulp');

let phpMinify;
@@ -30,7 +30,7 @@ task('compressPhp', series('phpMinify:import', 'phpMinify:run'));
## Programming interface
The plug-in takes a list of [PHP](https://www.php.net) scripts as input, and removes the comments and whitespace in these files by applying the [`php_strip_whitespace()`](https://www.php.net/manual/en/function.php-strip-whitespace.php) function on their contents:

```js
``` js
import {phpMinify} from '@cedx/gulp-php-minify';
import gulp from 'gulp';

@@ -52,7 +52,7 @@ The plug-in relies on the availability of the [PHP](https://www.php.net) executa

If the plug-in cannot find the default `php` binary, or if you want to use a different one, you can provide the path to the `php` executable by using the `binary` option:

```js
``` js
import {phpMinify} from '@cedx/gulp-php-minify';
import gulp from 'gulp';

@@ -68,7 +68,7 @@ The plug-in can work in two manners, which can be selected using the `mode` opti
- the `safe` mode: as its name implies, this mode is very reliable. But it is also very slow as it spawns a new PHP process for every file to be processed. This is the default mode.
- the `fast` mode: as its name implies, this mode is very fast, but it is not very reliable. It spawns a PHP web server that processes the input files, but on some systems this fails. This mode requires a [PHP](https://www.php.net) runtime version **7.2 or later**.

```js
``` js
import {phpMinify, TransformMode} from '@cedx/gulp-php-minify';
import gulp from 'gulp';

@@ -81,7 +81,7 @@ gulp.task('compressPhp', () => gulp.src('path/to/**/*.php', {read: false})
### **silent**: boolean = `false`
By default, the plug-in prints to the standard output the paths of the minified scripts. You can disable this output by setting the `silent` option to `true`.

```js
``` js
import {phpMinify} from '@cedx/gulp-php-minify';
import gulp from 'gulp';



Loading…
Cancel
Save