grinder_php_minify 3.2.0

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 67

Grinder-PHP-Minify

Runtime Release License Coverage Build

Grinder plug-in minifying PHP source code by removing comments and whitespace.

Resources

License

Grinder-PHP-Minify is distributed under the MIT License.

Changelog

Version 3.2.0

  • Raised the Dart SDK constraint.
  • Updated the package dependencies.

Version 3.1.0

  • Added an example code.
  • Raised the Dart SDK constraint.
  • Updated the package dependencies.

Version 3.0.0

  • Breaking change: starting to use and support the Dart 2 SDK.
  • Breaking change: raised the required PHP version.
  • Added a user guide based on MkDocs.
  • Using optional const and new.
  • Using PHP 7.1 features, like void functions.
  • Updated the package dependencies.

Version 2.0.0

  • Breaking change: changed the signature of the Minifier and Transformer constructors.
  • Breaking change: renamed the Minifier.processDirectory() method to compressDirectory.
  • Breaking change: renamed the Minifier.processFile() method to compressFile.
  • Breaking change: splitted the phpMinify() function into the compressDirectory(), compressFile() and compressFiles() functions.
  • Added the Minifier.compressFiles() method.
  • Added the TransformMode enumeration.

Version 1.0.1

  • Fixed a bug with relative file paths.

Version 1.0.0

  • Breaking change: changed the signature of most class constructors.
  • Breaking change: merged the compress() and compressFile() functions into the phpMinify() function.
  • Breaking change: raised the required Dart version.
  • Breaking change: removed the binary and mode properties from the Minifier class.
  • Breaking change: the Minifier.transformer property is now final.
  • Added a factory constructor to the Transformer class.
  • Added new unit tests.
  • Changed licensing for the MIT License.
  • Updated the package dependencies.

Version 0.2.0

  • Breaking change: renamed the main script to grinder_php_minify.dart.

Version 0.1.0

  • Initial release.

example/main.dart

import 'dart:async';
import 'package:grinder/grinder.dart';
import 'package:grinder_php_minify/grinder_php_minify.dart' as php_minify;

@Task('Compresses the PHP scripts from a given directory')
Future<void> compressPhpDirectory() => php_minify.compressDirectory('path/to/src', 'path/to/out');

@Task('Compresses a given PHP script')
Future<void> compressPhpFile() => php_minify.compressFile('path/to/src.php', 'path/to/out.php');

@Task('Compresses a given set of PHP scripts')
Future<void> compressPhpFiles() {
  final sourceDir = getDir('path/to/src');
  final fileSet = FileSet.fromDir(sourceDir, pattern: '*.php', recurse: true);
  return php_minify.compressFiles(fileSet.files, 'path/to/out', base: sourceDir.path);
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  grinder_php_minify: ^3.2.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:grinder_php_minify/grinder_php_minify.dart';
  
Version Uploaded Documentation Archive
3.2.0 Aug 15, 2018 Go to the documentation of grinder_php_minify 3.2.0 Download grinder_php_minify 3.2.0 archive
3.1.0 Jul 21, 2018 Go to the documentation of grinder_php_minify 3.1.0 Download grinder_php_minify 3.1.0 archive
3.0.0 Jul 5, 2018 Go to the documentation of grinder_php_minify 3.0.0 Download grinder_php_minify 3.0.0 archive
2.0.0 Nov 6, 2017 Go to the documentation of grinder_php_minify 2.0.0 Download grinder_php_minify 2.0.0 archive
1.0.1 Oct 9, 2017 Go to the documentation of grinder_php_minify 1.0.1 Download grinder_php_minify 1.0.1 archive
1.0.0 Oct 5, 2017 Go to the documentation of grinder_php_minify 1.0.0 Download grinder_php_minify 1.0.0 archive
0.2.0 May 24, 2017 Go to the documentation of grinder_php_minify 0.2.0 Download grinder_php_minify 0.2.0 archive
0.1.0 May 24, 2017 Go to the documentation of grinder_php_minify 0.1.0 Download grinder_php_minify 0.1.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
36
Health:
Code health derived from static analysis. [more]
96
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
67
Learn more about scoring.

We analyzed this package on Aug 15, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.11.8

Platforms

Detected platforms: other

Primary library: package:grinder_php_minify/grinder_php_minify.dart with components: io, isolate, mirrors.

Suggestions

Format lib/src/fast_transformer.dart.

Run dartfmt to format lib/src/fast_transformer.dart.

Format lib/src/functions.dart.

Run dartfmt to format lib/src/functions.dart.

Fix additional 4 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/src/minifier.dart (Run dartfmt to format lib/src/minifier.dart.)
  • lib/src/safe_transformer.dart (Run dartfmt to format lib/src/safe_transformer.dart.)
  • lib/src/transform_mode.dart (Run dartfmt to format lib/src/transform_mode.dart.)
  • lib/src/transformer.dart (Run dartfmt to format lib/src/transformer.dart.)

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
grinder ^0.8.3 0.8.3
http ^0.11.3 0.11.3+17
path ^1.6.2 1.6.2
where ^4.3.1 4.3.1
Transitive dependencies
args 1.5.0
async 2.0.8
build_cli_annotations 1.0.0
charcode 1.1.2
cli_util 0.1.3+2
collection 1.14.11
glob 1.1.7
http_parser 3.1.3
json_annotation 1.1.0
meta 1.1.6
pub_semver 1.4.2
pubspec_parse 0.1.2+2
source_span 1.4.1
string_scanner 1.0.4
typed_data 1.1.6
yaml 2.1.15
Dev dependencies
coverage ^0.12.2
coveralls ^3.2.0
test ^1.3.0