Skip to content
forked from asartalo/Silly

A simple way to create commandline (CLI) scripts.

Notifications You must be signed in to change notification settings

nashlesigon/Silly

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Silly: The silly little CLI tool

Silly helps you create php-based commandline scripts.

Usage

<?php
// my-silly-test.php
require_once 'Silly\Silly.php'; // or wherever you placed Silly

// Define some tasks
class MyCoolTasks implements Tasks
{
    private $controller;

    public function getTaskNamespace() {
        return '';
    }

    public function setController(\Silly\Controller $controller) {
        $this->controller = $controller;
    }

    public function taskSayHello()
    {
        $this->controller->out('Hello!');
    }
}

// Get the silly little controller
$controller = \Silly\Silly::getController(new MyCoolTasks);
// Okay, run it!
$controller->execute($argv);
?>

Then on your terminal, run that silly little thing!

$ php my-silly-test.php say-hello

...then you'll get some sweet response.

$ Hello!

Cooool!

About

A simple way to create commandline (CLI) scripts.

Resources

Stars

Watchers

Forks

Packages

No packages published