chrisdahl/star-wars-names-bundle

生成随机的《星球大战》名称

安装: 16

依赖: 0

建议者: 0

安全: 0

星标: 0

分支: 1

类型:symfony-bundle

1.0.0 2016-10-17 12:44 UTC

This package is not auto-updated.

Last update: 2024-09-18 20:28:08 UTC


README

下载并安装以下列出的程序/工具/脚本

Symfony Bundle安装

步骤1a:通过composer安装bundle

composer require chrisdahl/star-wars-names-bundle

步骤1b:使用Docker安装项目

  • 构建包含所有内容的Dockerfile

    docker build Dockerfile

  • 运行带有交互式终端的镜像并继续下一步(已预装vim

    docker run -it

步骤2:启用Bundle

然后,通过将其添加到项目中app/AppKernel.php文件中已注册的bundle列表来启用该bundle

<?php
// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Chrisdahl\StarWarsNamesBundle\ChrisdahlStarWarsNamesBundle(),
        );
        // ...
    }	
    // ...
}

运行

打开控制台并切换到您的Symfony项目根目录,然后执行以下命令之一

获取所有名称

php bin/console starwarsnames:all

获取一个随机名称

php bin/console starwarsnames:random	

获取三个随机名称

php bin/console starwarsnames:random 3

测试

phpunit vendor/chrisdahl/star-wars-names-bundle/Tests/