https://github.com/toolstack/minify-php-cli
A PHP script you can run from a command line to minify javascript files.
https://github.com/toolstack/minify-php-cli
Last synced: about 1 year ago
JSON representation
A PHP script you can run from a command line to minify javascript files.
- Host: GitHub
- URL: https://github.com/toolstack/minify-php-cli
- Owner: toolstack
- Created: 2016-07-12T19:49:57.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-09-13T20:12:10.000Z (over 9 years ago)
- Last Synced: 2025-02-06T04:41:20.746Z (about 1 year ago)
- Language: PHP
- Size: 3.91 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
Awesome Lists containing this project
README
# Minify PHP CLI
This script provides a CLI interface to Minify JavaScript/CSS files. It uses [@mcclay's](https://github.com/mrclay) PHP base [Minify code](https://github.com/mrclay/jsmin-php) to do the bulk of the work.
## Usage
`php cli.php <script> <dir>`
`<script>` can be any JavaScript file that ends in '.js' or '.css' (it is double checked before being added to the file queue).
`<dir>` can be any directory, the CLI script will look inside and find any '.js' or '.css' files and add them to the queue.
You can have as many `<script>` and `<dir>`'s as you like (until you run out of memory of course).
The script will minify each file, creating a '.min.js' or '.min.css' version of it.
If a minified file already exists, the last modified time of the unminified file and the minified file will be compared, if the minified file is newer, it will be skipped.
Output is a simple summary of how many files were found, processed and skipped.
The script will run on Windows or *nix (and anywhere else that PHP runs more than likely).