public static function getController(Tasks $tasks, $cwd = null) { if (!$cwd) { $cwd = getcwd(); } $controller = new Controller(new Interpreter(), new Executor(new Utilities()), $cwd); $controller->register($tasks); return $controller; }
/** * constructor initializes the vars * * @param string config-file-location * * @access public * * @author patrick.kracht, thorsten.moll */ public function __construct($parameters = array()) { //Initialisieren $this->link_id = false; $this->query_id = false; $this->hostname = isset($parameters[0]) ? $parameters[0] : "localhost"; $this->hostport = isset($parameters[1]) ? $parameters[1] : 3306; $this->database = isset($parameters[2]) ? $parameters[2] : false; $this->username = isset($parameters[3]) ? $parameters[3] : false; $this->password = isset($parameters[4]) ? $parameters[4] : false; if (!$this->hostname || !$this->hostport || !$this->database || !$this->username || !$this->password) { throw new Exception("Es fehlt mindestens ein Parameter um die MsSQL-Verbindung herzustellen!", 101); } parent::register("Timer", array("MsSQL", true), "TIMER.MSSQL"); $this->init(); }
require_once 'controller/Controller.php'; session_start(); $_SESSION["errorRegisterParticipant"] = ""; $_SESSION["errorRegisterEvent"] = ""; $c = new Controller(); try { $participant = NULL; if (isset($_POST['participantspinner'])) { $participant = $_POST['participantspinner']; } $event = NULL; if (isset($_POST['eventspinner'])) { $event = $_POST['eventspinner']; } $c->register($participant, $event); } catch (Exception $e) { $errors = explode("@", $e->getMessage()); foreach ($errors as $error) { if (substr($error, 0, 1) == "1") { $_SESSION["errorRegisterParticipant"] = substr($error, 1); } if (substr($error, 0, 1) == "2") { $_SESSION["errorRegisterEvent"] = substr($error, 1); } } } ?> <!DOCTYPE html> <html>
public static function load() { Hook::listen('Application', new Module_Node_Listener_Application()); Controller::register('node', new Module_Node_Controller_Node()); }
public static function load() { Controller::register('index', new Module_App_Controller_Index()); }