定制 crypto_scythe/m_nify 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

crypto_scythe/m_nify

最新稳定版本:1.0.0

Composer 安装命令:

composer require crypto_scythe/m_nify

包简介

Simple JavaScript / CSS Minifier

README 文档

README

Simple PHP library for minifying and concatenating JavaScript and CSS files for use in my projects.

Installing

File composer.json

{
  "require": {
    "crypto_scythe/m_nify": "*"
  }
}

Then on command line:

composer install

Usage

<?php

require( 'vendor/autoload.php' );

new \crypto_scythe\m_nify();

?>

To minify the files just add the GET parameter files to the file which instantiates the m_nify object like this:

http://example.com/m_nify.php?files=/path/to/first_file.css,/path/to/second_file.css

Options

Per default m_nify uses the DOCUMENT_ROOT for fetching the file. If you have your files in a different location you need to define the path like this before instantiating the m_nify object.

define( 'M_NIFY_PATH', $_SERVER['DOCUMENT_ROOT'] . '/path/to/files' );

By using this you can shorten the paths or restrict it to a specific folder.

Additional Information

m_nify automatically removes ".." from given file paths and automatically adds "/" in front of them so make sure you don't use relative paths when specifying files. However the ".." is allowed in the M_NIFY_PATH constant.

License

m_nify is licensed under the MIT License. See the LICENSE file for details.

Used libraries

JShrink from Robert Hafner - Github
CssMin from Joe Scylla - Github / Google Code

统计信息

  • 总下载量: 20
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-05-04