chrisdahl / star-wars-names-bundle
Generates random Star Wars names
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: 2025-06-11 23:49:08 UTC
README
Download and install the below listed programs/tools/scripts
- PHP 7.0.x
- Symfony 3.1
- PHPUnit 5.6
- Console Support for Symfony
- Module php-xml for PHP (Example:
sudo apt-get install php-xml
) - Optional: Docker 1.12.2 - if installation via Docker is prefered
Symfony Bundle Installation
Step 1a: Install the bundle via composer
composer require chrisdahl/star-wars-names-bundle
Step 1b: Install the project using Docker
Build the attached Dockerfile for an image containing everything
docker build Dockerfile
Run the image with interactive terminal and continue with the next step (
vim
is pre-installed)docker run -it
Step 2: Enable the Bundle
Then, enable the bundle by adding it to the list of registered bundles
in the app/AppKernel.php
file of your project:
<?php
// app/AppKernel.php
// ...
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
// ...
new Chrisdahl\StarWarsNamesBundle\ChrisdahlStarWarsNamesBundle(),
);
// ...
}
// ...
}
Run
Open a console and change to your Symfony project root directory and then execute one of the following commands:
Get all the names:
php bin/console starwarsnames:all
Get a random name:
php bin/console starwarsnames:random
Get three random names:
php bin/console starwarsnames:random 3
Testing
phpunit vendor/chrisdahl/star-wars-names-bundle/Tests/