kk/chuck-command

一个简单的 Symfony2 扩展包,在每次控制台命令执行后显示一个随机的 Chuck Norris 冷知识。

安装: 521

依赖者: 0

建议者: 0

安全: 0

星标: 7

关注者: 1

分支: 0

类型:symfony-bundle

1.3.0 2016-01-23 18:40 UTC

This package is not auto-updated.

Last update: 2024-09-28 17:28:10 UTC


README

Build Status Scrutinizer Code Quality Latest Stable Version Code Coverage Total Downloads Monthly Downloads SensioLabsInsight

简单而愚蠢的 Symfony2 扩展包,在每次控制台命令执行后显示一个随机的 Chuck Norris 冷知识。

Chuck Norris Rules

##新增

版本 1.3.0

  • 新增配置选项:环境

版本 1.2.0

  • 修复了 ConnectException 问题

版本 1.1.0

  • 添加了对 Symfony 3 的支持

版本 1.0.0

  • Guzzle 6 实现
  • chuck:fact 控制台命令,在需要时获取一个事实
  • 超时配置参数

##安装

只需运行

composer require kk/chuck-command
composer update

并在您的 app/AppKernel.php 中注册该扩展包

// app/AppKernel.php
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new KK\Labs\ChuckConsoleBundle\KKLabsChuckConsoleBundle(),
        );

        // ...
    }
}

##使用与使用任何 app/console 命令一样简单。

Screenshot of ChuckConsoleBundle

在紧急情况下,也可以在真正需要时获取一个事实

app/console chuck:fact
#output : Fact: Chuck Norris doesn't consider it sex if the woman survives.
app/console chuck:fact Your boss
#output : Fact: Your boss doesn't consider it sex if the woman survives.

##在 config.yml 文件中进行自定义

kk_labs_chuck_console:
    who:
        #your first name or anyone's first name
        first_name: "Your first name"
        #your last name or anyone's last name
        last_name: "Your last name"
    #after n seconds, don't wait for response from Chuck API
    timeout: 5
    #environments enabled (default : 'dev')
    environments: ['dev', 'prod', 'custom']

##API 信用 API 信用归功于 The Internet Chuck Norris Database