setTimezone(); $sequence->detect(); $sequence->getENV(); $sequence->Application->config(); $sequence->Application->Modules->load(); $sequence->Autoloader->register(); $sequence->loadContainer(); $sequence->setApplication = [$sequence->Application]; $sequence->Requesthandler->handleCliRequest(); $sequence->Requesthandler->handleHttpRequest(); $parent = $this->getParentForNode($node); $parent->children[] = $node; $node->parent = $parent; */ class Engine implements ProgramInterface {//RuntimeInterface, //use \Webfan\ngModuleTrait; protected $currentProcessorContextType = null; protected $Batch = null; protected $DataPayload = null; protected $ProgramPayload = null; protected $OID_TABLE = null; public function configure(?ConfigType $configurator = null, $payload) { match($configurator){ ConfigType::Batch => $this->withConfigurationBatch($payload), default => $this->withConfiguration($payload), }; } public function load( $payload){ return $this->loadWebApp($payload); } /* public function load(DescriptorType $program, $payload){ // print_r($payload);die(); match($program){ // DescriptorType::Pipeline => parent::__construct("Bad Request - Invalid Method", 400), DescriptorType::WebApp => $this->loadWebApp($payload), // DescriptorType::Timeout => parent::__construct("Bad Request - Timeout", 400) DescriptorType::Batch => $this->loadBatch($payload), // default => null !== $this->currentProcessor ? $this->currentProcessor->load($payload) : $this->add($payload), //$this->$currentProcessorContextType default => $this->defaultLoad($payload), }; } case START_PROGRAM = << $this->defaulExecutionHandlerWith($payload), ExecutionContextType::http => $this->defaulExecutionHandlerWith($payload), default => $this->defaulExecutionHandlerWith($payload), }; } public function defaulExecutionHandlerWith($payload) { $AppLauncher = new \Webfan\AppLauncherLegacy(\frdl\r\f::i()->StubRunner); return $this->loadWebApp($AppLauncher); } public function build(?DescriptorType $program = null, ...$payload) { print_r($payload); } public function withConfiguration($payload) { print_r($payload); } public function withConfigurationBatch($payload) { print_r($payload); } public function batch( Batch $newBatch = null ) : Batch { if(null === $this->Batch){ $this->Batch =new Batch(); } if(null !== $newBatch){ $this->Batch =new Batch($this->Batch->{'@@@'}.' -> '.$newBatch->{'@@@'}, $this->Batch->{'.'}, array_merge($this->Batch->{'@@'}, $newBatch->{'@@'})); } return $this->Batch; } public function info( Baum $newBatch = null ) : Baum { if(null === $this->OID_TABLE){ $this->OID_TABLE =new Baum('ProgramDescriptors', Baum::class); } if(null !== $newBatch){ $this->OID_TABLE->children[] = $newBatch; $newBatch->parent = $this->OID_TABLE; } return $this->OID_TABLE; } public function program( Baum $newBatch = null ) : Baum { if(null === $this->ProgramPayload){ $this->ProgramPayload =new Baum('ProgramDescriptors', Baum::class); } if(null !== $newBatch){ $this->ProgramPayload->children[] = $newBatch; $newBatch->parent = $this->ProgramPayload; } return $this->ProgramPayload; } public function data( Baum $newBatch = null ) : Baum { if(null === $this->DataPayload){ $this->DataPayload =new Baum('DataDescriptors', Baum::class); } if(null !== $newBatch){ $this->DataPayload->children[] = $newBatch; $newBatch->parent = $this->DataPayload; } return $this->DataPayload; } public function defaultLoad($payload) { print_r(__METHOD__); print_r($payload); } public function loadBatch($payload) { return ($this->batch(is_object($payload) && !is_null($payload) && true === $payload instanceof Batch ? $payload : null))->load(is_object($payload) && !is_null($payload) && true === $payload instanceof Batch ? null : $payload); } public function loadWebApp(StubHelperInterface | WebAppInterface | StubRunnerInterface $payload){ if($payload instanceof WebAppInterface){ $AppLauncher =$payload; }elseif($payload instanceof StubRunnerInterface){ $AppLauncher = new \Webfan\AppLauncherLegacy($payload); }elseif($payload instanceof StubHelperInterface){ $AppLauncher = new \Webfan\AppLauncherLegacy($payload->getRunner()); }else{ throw new InvalidArgumentException(sprintf('Invalid parameter in %s payload of %s given but %s expected', __METHOD__, is_object($payload) && !is_null($paylod) ? \get_class($payload) : gettype($payload), 'one of StubHelperInterface | WebAppInterface | StubRunnerInterface')); } if(\method_exists($AppLauncher, 'launch')){ $AppLauncher->launch(); }elseif(!$AppLauncher->KernelFunctions()->isCLI() ){ $response = $AppLauncher->handle($AppLauncher->getContainer()->get('request')); if(is_object($response) && $response instanceof \Psr\Http\Message\ResponseInterface){ (new \Laminas\HttpHandlerRunner\Emitter\SapiEmitter)->emit($response); } }elseif($AppLauncher->KernelFunctions()->isCLI() ){ return $AppLauncher->handleCliRequest(); }else{ throw new \Exception('Could not handle request ('.\PHP_SAPI.')'); } } }__halt_compiler();----SIGNATURE:----xru5/N7IZ18uDV4MGUfIetROa6rIr0c9ze6uPPBQRMkIQffIprkGTlUJ/ZHHl5cPmO45Yy0w3aJCl5ORogOMy2wCB0+Tk77J497Szmpzrk6XcgvtsSTN1jkh91xLgXC1YC9H/tOmRJIejF2cZciUs+gCOcyKpBrMy9W97Osq1naqTdpsWR4uY6ZGShgekXPnvhqwLsvJvDb6FGGH/B5H9tQVLPkwY8xsummSAfLqO53fzbMsgLz9ZHtg8Miy5BOZN30Z4EyCjPnm45s6XG1b3w/99E6VVIqrKCpt/elqnGm0MvNFENqgiA3sHCAM/86Lk7T3QwGaNYz1H+MODO834FyXsuyUiNBKcOgthCcYeXGg6445LN5badKWloc/vsBn9q5Ih/LBmuQnDr26MgW2xIMs2stE+wFXKJHk3s00xPEDXc046nFzt7d/6ZgMbwGaXc3D2PRpHR2qmeN8Zk1HQpkTvxAJBIImcXbxM0tVXJVO0+oR199gnsOOo9SHDyLzjejqDqdVh7Tsh0KD2pW0oBU66/G7bcVsfiGMtLvuNMA6kPyTlCDAFg3a1WEzfrRc4cb2HENJd+BRxUWsscne3j4jdldNx/+jyIzJCVBdB5zc40LXoE+2oDblUxtPeq56ak+ul0GijqYm5cbODMCilzT5KTn5NngObFC/aC4/GEk=----ATTACHMENT:----MTkxNzc2OTc2OTEwNzQxNyA2Mzk3MjA1NDY3Mjg3MTg2IDEwODIyNzE3NTcyNDMzNDM=