定制 techpivot/phalcon-ci-installer 二次开发

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

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

techpivot/phalcon-ci-installer

Composer 安装命令:

composer require techpivot/phalcon-ci-installer

包简介

Composer integration for PHP applications to install the Phalcon framework as an extension in the PHP runtime for various hosted CI services including TravisCI, CircleCI, Scrutinizer, Shippable and Codeship.

README 文档

README

CircleCI Travis CI Scrutinizer Codeship Shippable

Latest Version Total Downloads Software License

Composer integration for PHP applications to install the Phalcon framework as an extension in the PHP runtime for various hosted CI services including CircleCI, Travis CI, Scrutinizer, Codeship, and Shippable.

Features

  • Phalcon extension loaded in PHP runtime
  • Native cache support to prevent rebuilding Phalcon from source
  • Auto-detection of latest tagged Phalcon version
  • Install specific Phalcon versions, tags and releases (Since 1.0.2)
  • Supports PHP7 and Phalcon 3.0.x (Since 1.0.4)

Version Compatibility

The following table outlines general compability of Phalcon inside various CI environments.

PHP CI Version Phalcon Version(s) CI Environment
5.3 ✖ (Not supported) -
5.4 ✖ (Not supported) -
5.5 master, 2.0.x, 3.0.x ✔ CircleCI, Travis CI, Scrutinizer, Codeship, Shippable
5.6 master, 2.0.x, 3.0.x ✔ CircleCI, Travis CI, Scrutinizer, Codeship, Shippable
7.0 3.0.x ✔ CircleCI, Travis CI, Scrutinizer, Codeship, Shippable

Installation

  1. Add the techpivot/phalcon-ci-installer repository into the require-dev section of your composer.json as follows:
  "require-dev": {
      "techpivot/phalcon-ci-installer": "~1.0"
  }
  1. Update your CI script to execute the vendor/bin/install-phalcon.sh installer in the relevant section. See the examples below for various CI providers.

Options

The installer takes one optional argument that can be used to specify a specific branch or tag.

Examples:

# Install latest version from default branch
vendor/bin/install-phalcon.sh

# Install latest revision from branch "3.0.x"
vendor/bin/install-phalcon.sh 3.0.x

# Install specific release tag "phalcon-v2.0.9"
vendor/bin/install-phalcon.sh phalcon-v2.0.9

Note: The Phalcon CI installer is designed to cache the resulting binaries that correspond to the Phalcon/PHP version. Specifing a release or tagged version will result in the best performance as subsequent builds (depending on CI container/settings) will be cached. Building from a branch (including the default master option) will result in a Phalcon rebuild every time the installer detects a new version that is not yet cached.

CI Environments

CircleCI

circle.yml

machine:
  php:
    version: 5.6.14

dependencies:
  cache_directories:
    - vendor
    - ~/cphalcon

  post:
    - vendor/bin/install-phalcon.sh phalcon-v2.0.13

test:
  override:
    - vendor/bin/phpunit

Note: In order to cache data for faster builds, ensure the cache_directories directives are specified as outlined above.

Note: Ensure that the vendor/bin/circleci-install-phalcon.sh is executed in the post phase, which will allow for the inclusion of the techpivot/phalcon-ci-installer repository during the composer installation at inference or override phase.

Reference: CircleCI PHP Versions – Ubuntu 14.04Ubuntu 12.04

Travis CI

.travis.yml

language: php

php:
  - 5.5
  - 5.6
  - 7.0

cache:
  directories:
    - vendor
    - ~/.composer/cache
    - ~/cphalcon

before_install:
  - composer install --prefer-source --no-interaction
  - vendor/bin/install-phalcon.sh 3.0.x

script:
  - vendor/bin/phpunit

notifications:
  email: false

Note: Multiple PHP versions can be specified and each one will be cached independently; however, the phalcon target ref (branch or tag) will be applied for all builds

Reference: TravisCI PHP Versions

Scrutinizer

.scrutinizer.yml

build:
    environment:
        php:
            version: 7.0.8

    cache:
        directories:
            - ~/cphalcon

    dependencies:
        override:
            - composer install --prefer-source --no-interaction
        after: 
            - vendor/bin/install-phalcon.sh 3.0.x

Note: No need to include the vendor/ cache directory as this is cached automatically.

Reference: ScrutinizerCI PHP Versions

Codeship

Sample Setup Commands

phpenv local 5.6
php --version
composer install --prefer-source --no-interaction
vendor/bin/install-phalcon.sh

Reference: Codeship CI PHP Versions

Shippable

shippable.yml

language: php
php:
  - 7.0

build:
  cache: true
    
  cache_dir_list:
    - $SHIPPABLE_BUILD_DIR/vendor
    - ~/cphalcon

  ci:
    - composer install --prefer-source --no-interaction
    - bin/install-phalcon.sh 3.0.x

Reference: Shippable PHP Versions

techpivot/phalcon-ci-installer 适用场景与选型建议

techpivot/phalcon-ci-installer 是一款 基于 Shell 开发的 Composer 扩展包,目前已累计 130.78k 次下载、GitHub Stars 达 26, 最近一次更新时间为 2015 年 10 月 17 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

围绕 techpivot/phalcon-ci-installer 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 130.78k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 27
  • 点击次数: 29
  • 依赖项目数: 11
  • 推荐数: 0

GitHub 信息

  • Stars: 26
  • Watchers: 4
  • Forks: 7
  • 开发语言: Shell

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-10-17