so = $so; $this->fo = $fo; // Boot control, preparing anything before keyboard entry $this->boot(); } // Default boot method if a child class doesnt have one. protected function boot() { $this->state['mode'] = FALSE; } /** * Has control completed? */ public function complete() { return $this->complete; } // @todo Change to Dynamic Calls by the existence of files in App\Classes\Control public static function factory(string $name,Server $so,Frame $fo=NULL) { switch ($name) { case 'editframe': return new EditFrame($so,$fo); case 'register': return new Register($so); case 'telnet': return new Telnet($so); default: throw new \Exception('Unknown control method: '.$name); } } abstract public function handle(string $read); /** * If completing an Action frame, this will be called to submit the data. * * Ideally this should be overridden in a child class. */ public function process() { $this->complete = TRUE; } }