GithubHelp home page GithubHelp logo

m-commander's Introduction

m-commander

Easy tool for executing your own module via command line

1.Install via Composer (best option, however you can use it without it)

"200mph/m-commander": "1.1.*"

2.Create your command line module class and extend AbstractCliModule() from m-commander vendor

namespace cli\MyTest;

use m-commander\AbstractCliModule;

class TestMe() extends AbstractCliModule 
{

    /**
     * We have to create execute() method (abstraction requirements)
     *
     * @return void
    /*
    protected function execute()
    {

        $this->successOutput('Hello World' . PHP_EOL);

    }
}

3.Run your module

./vendor/bin/m-commander cli\\MyTest\\TestMe -v

You can also use semi quotes to avoid double back slashes notation.

./vendor/bin/m-commander 'cli\MyTest\TestMe' -v

Above notation is recommended if command have to be executed in CRON, or another shell script.

For more examples please have a look in to ./examples folder

4.Default options

-h --help Display this page -v --verbose Verbose mode -w --write-output Write output in to file. Eg "./m-commander 'myNamespace\MyModule' -w /home/user/test.log" -l --lock Lock module process. Will not let you run another instance of this same module until current is finished. However you can execute script for another module.

m-commander's People

Contributors

200mph avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.