承接 rtens/fido 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

rtens/fido

Composer 安装命令:

composer require rtens/fido

包简介

Asset fetcher for PHP

README 文档

README

#fido Build Status

A simple composer plugin that simplifies installing packages without dependency management support (e.g. assets from URLs or git repositories).

Installation

Because of composer's plugin system, you need to install fido globally

composer global require "rtens/fido:~1.0"

(there is a pull request to fix that)

Usage

The requirement definitions go into the extra object using the ke fido-fetch. Here is an example with two packages.

"extra": {
    "fido-fetch": {
        "base-dir": "web/assets/vendor", // defaults to "assets/vendor"
        "jquery": {
            "source": "https://code.jquery.com/jquery-2.1.1.js",
            "type": "file", // optional, inferred from source
            "target": "jquery.js" // Optional, defaults to file name
        },
        "phantom.js runner": {
            "source": "https://github.com/jonkemp/qunit-phantomjs-runner.git",
            "type": "git", // optional, inferred from source
            "target": "phantomjs-runner", // Optional, defaults to repository name
            "reference": "v1.2.0" // optional, defaults to "*"
        }
    }
}

This can be shortened in several steps. First, by leaving out the optional definitions.

"extra": {
    "fido-fetch": {
        "jquery": {
            "source": "https://code.jquery.com/jquery-2.1.1.js",
        },
        "phantom.js runner": {
            "source": "https://github.com/jonkemp/qunit-phantomjs-runner.git",
        }
    }
}

To shorten it even more, the value of source can be used as package names.

"extra": {
    "fido-fetch": {
        "https://code.jquery.com/jquery-2.1.1.js": {},
        "https://github.com/jonkemp/qunit-phantomjs-runner.git": {}
    }
}

Finally, these definitions can also be put into the require object (including versions for git repositories) by prefixing them with fido-fetch:.

"require": {
    "fido-fetch:https://code.jquery.com/jquery-2.1.1.js": "*",
    "fido-fetch:https://github.com/jonkemp/qunit-phantomjs-runner.git": "v1.2.0"
}

Dev Mode

You can also specify packages for dev-mode only using the fetch-fido-dev and require-dev objects.

Documentation

For a complete documentation, check out fido's executable documentation

But.. why?

Convenience, mostly.

There are of course several ways to get bootstrap, jquery and their likes into your project without bundling them with it. You could use bower or npm for example or, if you don't like javascript, you can get the the excellent bower/npm composer plugin.

But some packages, like the qunit-phantomjs-runner, don't support any dependency management system. For these cases exists composer's package type repository (thanks Igor for pointing that out).

Now if you would like to have these packages in another directory than vendor, you can either symlink to them or use the composer-custom-directory-installer plugin which lets you decide where certain packages should be installed.

This is how the composer.json looks like with if you would require bootstrap and the qunit-phantomjs-runner with this approach:

{
    "require": {
        "mnsami/composer-custom-directory-installer": "1.0.*",
        "jquery":"2.1.1",
        "jonkemp/qunit-phantomjs-runner":"1.1.0"
    },
    "extra": {
        "installer-paths":{
            "web/assets/jquery/jquery.js": ["jquery"],
            "web/assets/phantomjs-runner": ["jonkemp/qunit-phantomjs-runner"]
        }
    },
    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "jquery",
                "version": "2.1.1",
                "dist": {
                    "url": "https://code.jquery.com/jquery-2.1.1.js",
                    "type": "file"
                }
            }
        },
        {
            "type": "package",
            "package": {
                "name": "jonkemp/qunit-phantomjs-runner",
                "version": "1.1.0",
                "source": {
                    "url": "https://github.com/jonkemp/qunit-phantomjs-runner.git",
                    "type": "git",
                    "reference": "tags/v1.1.0"
                }
            }
        }
    ],
    "minimum-stability": "dev"
}

And this is actually (more or less) what fido compiles to, simply with a shorter, simpler syntax.

rtens/fido 适用场景与选型建议

rtens/fido 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3 次下载、GitHub Stars 达 1, 最近一次更新时间为 2014 年 10 月 30 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-10-30