so = $so; // 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; } public static function factory(string $name,Server $so,array $args=[]) { switch ($name) { case 'editframe': return new EditFrame($so,$args); case 'register': return new Register($so); case 'telnet': return new Telnet($so); default: $c = self::prefix.$name; $o = class_exists($c) ? new $c($so,$args) : FALSE; $so->log('debug',sprintf(($o ? 'Executing: %s' : 'Class doesnt exist: %s'),$c)); return $o; } } 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; } }