定制 carlosio/compify 二次开发

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

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

carlosio/compify

Composer 安装命令:

composer require carlosio/compify

包简介

Including the tests and other useless information like .travis.yml in distributed packages is not a good idea. "Compify" tries to remove everything, in order to save bandwidth and disk usage, but the necessary code for the package to work in your app or library.

README 文档

README

Compify is a tool to save disk usage and bandwith in your composer vendor folder.

Maybe you haven't noticed, but if you take a look to your vendor folder after doing a php composer.phar install there are so much useless information like tests, .travis.yml like files that you just don't need in production.

Consider also packages installed from source (using git clone or svn checkout, not downloading a zip or methods base), they include folders like .git or .svn and, believe me, you don't want those folders in production.

In most of the cases, you will be deploying to production and storing different versions of your application, installing dependencies directly from your servers or rsyncing from a deployer machine. So, using compify you can save bandwith or time when deploying.

Installation

Locally

Download the compify.phar file and store it somewhere on your computer.

Globally

You can run these commands to easily acces compify from anywhere on your system:

$ sudo https://github.com/carlosbuenosvinos/compify/raw/master/compify.phar -O /usr/local/bin/compify

then:

$ sudo chmod a+x /usr/local/bin/compify

and:

$ sudo vi /etc/php/php.ini
# search for "basedir"
# add ":/usr/local/bin" at the end and save

Then, just run compify in order to run compify

Update

Locally

The self-update command tries to update compify itself:

$ php compify.phar self-update

Globally

You can update compify through this command:

$ sudo compify self-update

Usage

php compify.phar crush --help
Usage:
 crush [vendor-path]

Arguments:
 vendor-path  Composer vendor path (default: "./vendor")

Help:
 The crush command removes all the
 unnecessary files for each composer
 package in order to save disk usage
 and bandwidth.

How does it work

Compify goes through every local composer dependency installed in your machine and removes typical unnecessary files and folders (what we call generic rules) for that package. Also, we have identified specific rules for specific packages that will also merge with the generic rules.

public static $rules = array(
    'generic-rules' => array(
        '.git',
        '.svn',
        'test',
        'tests',
        'docs',
        'doc',
        '.gitattributes',
        '.gitmodules',
        '.gitignore',
        '.travis.yml',
        'CHANGELOG*',
        'README*',
        'phpunit.xml.*',
        'LICENSE*'
    ),
    'packages-rules' => array(
        'twig/twig' => array(
            '.editorconfig',
            'AUTHORS',
            'ext'
        )
    )
);

You can contribute adding new package specific rules or any code update obsviously.

Example

Let's assummed a small project with following composer.json

...
"require": {
    "twig/twig": ">=1.8,<2.0-dev",
    "symfony/twig-bridge": "2.1.*",
    "swiftmailer/swiftmailer": "4.3.x-dev",
    "symfony/console": "2.1.*",
    "doctrine/dbal": "2.3.*",
    "silex/silex": "1.0.*",
    "guzzle/guzzle": "3.0.*"
},
...

$ php compify.phar crush
Crushing vendors (by Carlos Buenosvinos)
Vendor size before crushing: 73M
Vendor size after crushing: 18M

Do you need more arguments?

More Information

For any issue use PR github system, for other info, send me an email to carlos.buenosvinos@gmail.com

License

Compify is licensed under the MIT license.

carlosio/compify 适用场景与选型建议

carlosio/compify 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 172 次下载、GitHub Stars 达 33, 最近一次更新时间为 2013 年 01 月 01 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「composer」 「bandwidth」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 carlosio/compify 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 carlosio/compify 我们能提供哪些服务?
定制开发 / 二次开发

基于 carlosio/compify 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 33
  • Watchers: 5
  • Forks: 1
  • 开发语言: PHP

其他信息

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