chrisdahl / star-wars-names-bundle
生成随机的《星球大战》名称
1.0.0
2016-10-17 12:44 UTC
Requires
- php: >=7.0.0
- symfony/console: ~3.1
- symfony/symfony: 3.1.*
This package is not auto-updated.
Last update: 2024-09-18 20:28:08 UTC
README
下载并安装以下列出的程序/工具/脚本
- PHP 7.0.x
- Symfony 3.1
- PHPUnit 5.6
- Symfony的命令行支持
- PHP的php-xml模块(例如:
sudo apt-get install php-xml
) - 可选:如果您更喜欢通过Docker安装,请安装Docker 1.12.2
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/