log('debug',sprintf(($o ? 'Executing: %s' : 'Class doesnt exist: %s'),$c)); return $o; } } public function __construct(Server $so,array $args=[]) { $this->so = $so; // Boot control, preparing anything before keyboard entry $this->boot(); $this->so->log('info',sprintf('Initialised control %s',get_class($this))); } public function __get(string $key): mixed { switch ($key) { case 'complete': return $this->complete; case 'name': return get_class($this); default: throw new \Exception(sprintf('%s:! Unknown key: %s',static::LOGKEY,$key)); } } // Default boot method if a child class doesnt have one. protected function boot() { $this->state['mode'] = FALSE; } /** * Has control completed? * @deprecated use $this->complete; */ public function complete() { return $this->complete; } /** * 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; } }