t1st3/php-json-minify 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

t1st3/php-json-minify

最新稳定版本:0.6.2

Composer 安装命令:

composer require t1st3/php-json-minify

包简介

无描述信息

关键字:

README 文档

README

Packagist version Build Status Dependency Status Percentage of issues still open

About

This JSON minifier written in PHP is based on the PHP part of JSON.minify script by Kyle Simspon. This project being functional entirely relies on Kyle's work: this project basically wraps Kyle's script in a class, and adds some fancy fashion to that class, such as publication on Packagist for availability with Composer and documentation generated with PhpDocumentor. See original author's blog post if you want to know more.

This minifier also removes comments from JSON. While the authors of php-json-minify and JSON.minify do not encourage the use of comments in JSON, they are glad to provide you a way to remove those comments anyway!

Usage

<?php require_once(dirname(__FILE__) . '/src/t1st3/JSONMin/JSONMin.php'); use t1st3\JSONMin\JSONMin as jsonMin; // Use static method $a = jsonMin::minify('{"a": "b"}'); echo $a; // get the minified JSON in a string $b = new jsonMin('{"c": "d"}'); echo $b->getMin(); // prints the minifed JSON $c = new jsonMin('{"e": "f"}'); $b->printMin(); ?> 

Build dependencies

In order to build your generated Composer project from its source, you will need Grunt and PHP on the command line.

So, you must install PHP 5.6 on your system. Test it on your command line:

php --help 

Note that the extension ext-dom is required by dev-dependencies. On Debian/Ubuntu, this extension is shipped by default with regular PHP installation. On Fedora/CentOS, you'll have to install the extension separately (yum install php-xml).

To install Grunt globally on the command line (and run the above build task), run:

npm install -g grunt-cli 

Then, with Grunt, you can install Composer. Just run once:

grunt init 

Then, you can install require-dev dependencies (PhpDocumentor, PhpUnit and PhpCPD) locally. Just run once:

php composer.phar install -v 

Finally, you should also install the PHP extension named Xdebug, which will be used by PhpUnit for code coverage.

Build the sources

Once all your dependencies are installed, you can build your project with Grunt:

grunt build 

The build process will run the following tasks:

  • PhpLint: runs php -l over the "src" folder
  • Runs the tests located in the "tests" folder with PHPUnit
  • Generates a PhpDocumentor documentation in the "doc" folder from the files of the "src" folder
  • Detects copy/paste of code in the files of the "src" folder with PhpCPD

Built with Grunt

Credits

php-json-minify was initiated with generator-composer, a Yeoman generator that builds a PHP Composer project.

This project is based on JSON.minify by Kyle Simspon, which is released under the MIT license.

This project uses the following as development dependencies:

License

License

统计信息

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

GitHub 信息

  • Stars: 14
  • Watchers: 3
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固