lmmtfy/lmmtfy-php

Lmmtfy API 客户端

1.0.0 2017-09-08 15:39 UTC

This package is not auto-updated.

Last update: 2024-09-28 15:54:50 UTC


README

安装

确保您已安装 Composer 并将其作为依赖项添加到lmmtfy-php。

# Add lmmtfy-php as a dependency
composer require lmmtfy/lmmtfy-php

接下来,在您的应用程序中引入Composer的自动加载器,以自动加载项目中的Lmmtfy客户端

require 'vendor/autoload.php';

使用方法

API客户端

// Start by initializing the API client 
$lmmtfy = new Lmmtfy\Lmmtfy();

// After that you can minify a string
$minified = $lmmtfy->css('body { color: #ff0000; }')->toString();

// Or the contents of a file
$minified = $lmmtfy->css(fopen('test.css', 'r'))->toString();

// And write the result directly to a file
$lmmtfy->css(fopen('test.css', 'r'))->saveTo('test.min.css');

待办事项

  • 添加测试
  • 改进文档和此README