Generator::invoke PHP Method

invoke() public static method

public static invoke ( $type, $args )
    public static function invoke($type, $args)
    {
        if ($class = self::exists($type)) {
            $generator = new $class();
        } else {
            die('could not find generator ' . $type);
        }
        if (empty($args)) {
            self::printUsage($type);
            return false;
        } else {
            return call_user_func_array(array($generator, 'start'), $args);
        }
    }

Usage Example

Example #1
0
<?php

require dirname(dirname(__FILE__)) . '/config/bootstrap.php';
require 'lib/shell/Generator.php';
$filename = array_shift($argv);
$type = array_shift($argv);
Generator::invoke($type, $argv);