protected function loadActionResultTypes($actionName, ResultTypeService $service) { if (!$this->descriptor instanceof Descriptor) { return; } $results = array(); $map = $this->xmlActionResultsXmlMapFactory($actionName); foreach ($this->descriptor->getSourcesXml() as $xml) { $this->descriptor->set('packageDir', dirname($xml->getRealPath())); $parse = $map->execute($xml); $res = isset($parse['results']) ? $parse['results'] : array(); $results = array_merge($results, $res); } foreach ($results as $result => $data) { $service->register($actionName, $result, $data['type'], $data['params']); } $this->descriptor->set('packageDir', null); }
<?php require_once __DIR__ . '/../vendor/autoload.php'; use Fwk\Core\Components\Descriptor\Descriptor; $desc = new Descriptor(__DIR__ . '/../app/fwk.xml'); $app = $desc->execute('App'); $app->setDefaultAction('Home'); $response = $app->run(); if ($response instanceof \Symfony\Component\HttpFoundation\Response) { $response->send(); }