Source for file Application.php
Documentation is available at Application.php
* "THE BEER-WARE LICENSE" (Revision 42):
* "Sven Strittmatter" <ausserirdisch@sven-space.de> wrote this file.
* As long as you retain this notice you can do whatever you want with
* this stuff. If we meet some day, and you think this stuff is worth it,
* you can buy me a beer in return.
* @package Console_Application
* @copyright Copyright (c) 2009 Sven Strittmatter
require_once('Console/Loader.php');
require_once('Console/Exception.php');
* Class for running a Console_Application_Abstract-Script.
* @package Console_Application
* @uses Console_Exception
* @copyright Copyright (c) 2009 Sven Strittmatter
* Loads a class named ${applicationName}Application in the direcotry
* ${directory} and executes it.
* @param string $applicationName
* @param string $direcotry Optional;
* @param int $maxExecutionTime Optional;
* @param string $memoryLimit Optional;
* @return Console_Application_Interface
* @throws Console_Exception If file is not readable
public static function execute($applicationName, $direcotry = '.', $maxExecutionTime = 60, $memoryLimit = '128M') {
$className = $applicationName . 'Application';
$fileName = $direcotry . DIRECTORY_SEPARATOR . $className . '.php';
$scriptName = strtolower($applicationName) . '.sh';
$application = new $className($scriptName, $maxExecutionTime, $memoryLimit);
throw new Console_Exception($className . ' must implement the interface Console_Application_Interface!');
|