2017 © Pedro Peláez
 

library module-console

This is the "Console" module for Nails.

image

nailsapp/module-console

This is the "Console" module for Nails.

  • Friday, July 20, 2018
  • by hellopablo
  • Repository
  • 2 Watchers
  • 0 Stars
  • 2,926 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 5 % Grown

The README.md

Console Module for Nails

This is the "Console" module for nails, it provides a centralsied touchpoint for command line based actions., (*1)

http://nailsapp.co.uk/modules/console, (*2)

This tool is simply a wrapper for the excellent Console Component provided by Symfony. It looks for valid Console compatible classes in each installed module's src/Console/Command directory and loads them into the main application., (*3)

Defining Console Applications

Your module must be PSR-4 ready in order for the class to be loaded correctly. You should do this in the module's composer.json file. In addition you must also specify the module's root namespace in composer.json. Example:, (*4)

{
    "name": "my-vendor/my-module",
    "homepage": "http://example.com",
    "description": "This is my excellent module for Nails",
    "autoload":
    {
        "psr-4": {"MyVendor\\MyModule\\": "src/"}
    },
    "extra":
    {
        "nails" :
        {
            "moduleName": "mymodule",
            "type": "module",
            "namespace": "MyVendor\\MyModule\\"
        }
    }
}

Example directory structure:, (*5)

myvendor
|__ mymodule
|____ src
|______ Console
|________ Command
|__________ MyCommand.php
|__________ MyOtherCommand.php

Example Class (MyCommand.php), (*6)

<?php

namespace MyVendor\MyModule\Console\Command;

class MyCommand
{
    protected function configure()
    {
        $this->setName('mymodule-mycommand');
        $this->setDescription('Does something exciting');
    }

    // --------------------------------------------------------------------------

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $output->writeln('Did something!');
    }
}

Note the definition of the command, try and make it something which won't likely clash with another installed module. Also note the namespace - the console wrapper will automatically append \Console\Command when loading the class., (*7)

Roadmap

  • [ ] Prevent or detect command collisions

The Versions

20/07 2018

dev-develop

dev-develop http://nailsapp.co.uk/modules/console

This is the "Console" module for Nails.

  Sources   Download

MIT

The Requires

 

The Development Requires

cli codeigniter nails shed collective console module

03/11 2017

dev-feature/upgrading-ci

dev-feature/upgrading-ci http://nailsapp.co.uk/modules/console

This is the "Console" module for Nails.

  Sources   Download

MIT

The Requires

 

The Development Requires

cli codeigniter nails shed collective console module

02/03 2016

dev-master

9999999-dev http://nailsapp.co.uk/modules/console

This is the "Console" module for Nails.

  Sources   Download

MIT

The Requires

 

The Development Requires

cli codeigniter nails shed collective console module

02/03 2016

0.1.0

0.1.0.0 http://nailsapp.co.uk/modules/console

This is the "Console" module for Nails.

  Sources   Download

MIT

The Requires

 

The Development Requires

cli codeigniter nails shed collective console module