定制 naffiq/rocket-tools 二次开发

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

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

naffiq/rocket-tools

Composer 安装命令:

composer create-project naffiq/rocket-tools

包简介

RocketFirm tools to jumpstart with development

README 文档

README

This little php script helps you generate and manage nginx configuration for your project.

Installation

Via composer

Install this project globally by running

$ composer global require naffiq/rocket-tools

Make sure, that you have your composer's bin directory linked to your PATH environment variable.

Download PHAR executable

You can get the latest version this utility on releases page. Just grab rocket-tools.phar and put it to your /usr/local/bin directory (if you're on macOS/Linux) or just any folder listed in your PATH on Windows.

Usage

Check the version by running

$ rocket-tools --version

Generate nginx configurations

You can create nginx config in sites-available for your Yii2 project (basic for now) by running

$ rocket-tools nginx:generate <server-name> [<config-name>] [<document-root>] [<sites-available>] [<port>] [<fast-cgi-pass>]

This command takes following arguments:

  • server-name Domain (server_name) for newly created app
  • config-name File name for your config file. If not set first server-name is used
  • document-root Document root for your project. If not set, taken from run directory. default: "CURRENT/RUNNING/DIRECTORY"
  • sites-available Path of sites-available folder default: "/etc/nginx/sites-available"
  • port Listen port. default: 80
  • fast-cgi-pass Fast CGI pass. default: "unix:/var/run/php7.1-fpm.sock"

You can override defaults by configuring rocket-tools with [config:update](#Configuring RocketTools) command.

Link/unlink nginx sites available

Run this command to link config from sites-available to sites-enabled folder:

$ rocket-tools nginx:link <site-name> [<sites-available>] [<sites-enabled>] 

Arguments:

  • site-name Configuration file name
  • sites-available Sites available directory (without .conf) default: "/etc/nginx/sites-available"
  • sites-enabled Sites enabled directory default: "/etc/nginx/sites-enabled"

To unlink config run:

$ rocket-tools nginx:unlink <site-name> [<sites-enabled>]

Arguments:

  • site-name Configuration file name
  • sites-enabled Sites enabled directory default: "/etc/nginx/sites-enabled"

You can override defaults by configuring rocket-tools with [config:update](#Configuring RocketTools) command.

Configuring RocketTools

To override default configurations run:

$ config:update <config-name> <config-value>
$ config:set <config-name> <config-value>

Arguments:

  • config-name Configuration key
  • config-value Configuration value

So in order to override nginx:generate configurations simply take it's argument (for example sites-available), add nginx- prefix to it and use it as configuration key. The only exception is fast-cgi-pass, which is related to php-fpm and hand

Example:

$ config:update nginx-sites-available /usr/local/etc/nginx/sites-available

There is also a command for viewing your current configuration:

$ config:get [<config-name>]

Arguments:

  • config-name Configuration key. If not set, displays all config values.

Configuration files

All of the configuration files are stored in $HOME/.rocket-tools/ directory. If you want to change it, set ROCKET_TOOLS_HOME environment variable to desired path.

Updating RocketTools

If you are using composer run:

$ composer global update naffiq/rocket-tools

Just like composer.phar, rocket-tools.phar file contains self-update command, if you manually downloaded it from releases page.

Under the hood:

TODO:

  • Add default templates for nginx configs (Yii2 advanced, Laravel, Symfony)
  • Custom templates for nginx config
  • Apache2 config generator
  • Automated MySQL DB/User creation
  • Automated .env file generator
  • hosts file editor
  • All of the steps in one command master

License: MIT

Crafted with ♥

naffiq/rocket-tools 适用场景与选型建议

naffiq/rocket-tools 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 31 次下载、GitHub Stars 达 1, 最近一次更新时间为 2017 年 05 月 25 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 naffiq/rocket-tools 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-05-25