fredjuvaux/silex-less-provider
Composer 安装命令:
composer require fredjuvaux/silex-less-provider
包简介
Simple less php service provider for Silex
README 文档
README
Simple less php service provider for Silex that uses https://github.com/leafo/lessphp as parser.
You'll find the following topics in this README:
Dependencies
- Silex
- PHP 5.3.2 and above
- LESS compiler written in PHP
Installation
You basically have three options to add this extension to your Silex project. We'd strongly recommend the first option!
composer.json
http://packagist.org/packages/fredjuvaux/silex-less-provider
php composer.phar require fredjuvaux/silex-less-provider dev-master
Or add to the dependencies in your projects composer.json file and update your dependencies::
"fredjuvaux/silex-less-provider": "dev-master"
php composer.phar update
This is by far the easiest way, since it automatically adds the Doctrine dependencies and adds everything to the autoloading mechanism supplied by Composer.
More information on Composer can be found on getcomposer.org.
Git
Another option is to clone the project:
cd /path/to/your_project/vendor
git clone git@github.com:fredjuvaux/silex-less-provider.git
Or you can add it as a submodule if your project is in a git repository too:
cd /path/to/your_project
git submodule add git@github.com:fredjuvaux/silex-less-provider.git
This will require you to manually install all the dependencies. Also note that you'll need to add the provider to the Silex autoloader (or whatever autoloading mechanism) by hand. More on both subjects can be found below.
Download an archive
GitHub also gives you the option to download an ZIP-archive, which you can extract in your vendor folder. This method will also require you to manually install all the dependencies and add everything to your autoloader.
Configuration
Registering the Less Service Provider is rather straight forward:
<?php /* ... */ use Less\Provider\LessServiceProvider; $app->register(new LessServiceProvider(), array( 'less.source_dir' => array(__DIR__.'/../web/less/'), // specify one or serveral directories for sources 'less.cache_dir' => __DIR__.'/../var/cache/', // specify one directory for caching files 'less.target_dir' => __DIR__.'/../web/css/', // specify one directory for compiled files ));
Use
The Less files have to be in sources directories. The files are cached and regenerated if it's needed.
In the Twig view, you have to call the css generated files (in less.target_dir).
fredjuvaux/silex-less-provider 适用场景与选型建议
fredjuvaux/silex-less-provider 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 627 次下载、GitHub Stars 达 1, 最近一次更新时间为 2014 年 12 月 27 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「silex」 「less」 「provider」 「lessphp」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 fredjuvaux/silex-less-provider 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 fredjuvaux/silex-less-provider 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 fredjuvaux/silex-less-provider 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Time provider, providing consistent current date, time, datetime and timezone across the request.
ZF2 module that allows automation of compiling your LESS with the extra of minifying the files.
An Zend Expressive module for loading ZF2 or ZF3 modules.
Object-oriented CRUD for Doctrine DBAL
A fast and intuitive dependency injection container.
Command bus implementation: Commands and domain events
统计信息
- 总下载量: 627
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 10
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-12-27