shlinkio/shlink-installer 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

shlinkio/shlink-installer

Composer 安装命令:

composer require shlinkio/shlink-installer

包简介

A PHP command line tool used to install shlink

README 文档

README

A PHP command line tool used to install shlink.

Build Status Code Coverage Latest Stable Version License Paypal donate

Shlink installer

Installation

Install this tool using composer.

composer install shlinkio/shlink-installer

Usage

This is the command line tool used by shlink to guide you through the installation process.

The tool expects the working directory to be a valid shlink instance.

In order to run it, use the built-in CLI entry point.

Run vendor/bin/shlink-installer to print all available commands.

Shlink installer

Usage:
  command [options] [arguments]

Options:
  -h, --help            Display help for the given command. When no command is given display help for the list command
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi|--no-ansi  Force (or disable --no-ansi) ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
  help        Display help for a command
  install     Guides you through the installation process, to get Shlink up and running.
  list        List commands
  set-option  Allows you to set new values for any config option.
  update      Helps you import Shlink's config from an older version to a new one.

The most important ones are these:

  • install: Used to set up Shlink from scratch.
  • update: Used to update an existing Shlink instance. Will allow importing the config, skipping the options that already have a value.
  • set-option: Allows to set the value for an individual option, in case you want to update it.

Customize options

Questions to ask the user

In order to retain backwards compatibility, it is possible to configure the installer to ask just a specific subset of questions.

Add a configuration file including a configuration like this:

<?php

declare(strict_types=1);

use Shlinkio\Shlink\Installer\Config\Option;

return [

    'installer' => [
        'enabled_options' => [
            Option\Database\DatabaseDriverConfigOption::class,
            Option\Database\DatabaseHostConfigOption::class,
            Option\BasePathConfigOption::class,
            Option\Redirect\Regular404RedirectConfigOption::class,
            Option\UrlShortener\ShortDomainHostConfigOption::class,
            Option\UrlShortener\ShortDomainSchemaConfigOption::class,
        ],
    ],

];

If installer.enabled_options is not provided at all, all the config options will be asked.

Commands to run after installation

After the user has been asked for all the config, the installer will run a set of scripts which will create/update the database, download assets, etc.

It is possible to overwrite those commands via configuration too, using a syntax like this:

<?php

declare(strict_types=1);

use Shlinkio\Shlink\Installer\Util\InstallationCommand;

return [

    'installer' => [
        'installation_commands' => [
            InstallationCommand::DB_CREATE_SCHEMA->value => [
                'command' => 'bin/shlink shlink:db:create',
            ],
            InstallationCommand::DB_MIGRATE->value => [
                'command' => 'bin/some-script some:command',
            ],
            InstallationCommand::ORM_PROXIES->value => [
                'command' => '-v', // Just print PHP version
            ],
        ],
    ],

];

This example shows all the currently available commands. They are run in the order they have been set here.

Important: Take into consideration that all the commands must be PHP scripts, since the installer will prefix all of them with the php binary.

shlinkio/shlink-installer 适用场景与选型建议

shlinkio/shlink-installer 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 77.12k 次下载、GitHub Stars 达 7, 最近一次更新时间为 2019 年 02 月 04 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 7
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-02-04