Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require ' vendor/autoload.php ';
- /**
- * Handles an HTTP request that contains information for registering/unregistering
- * a FNA application.
- *
- * The service must call add_matching_service() to retrieve the matching service.
- *
- * @uses function_http_bundles::add_register()
- */
- $app = new App();
- // All GET requests that come to add_register() will be sent to this service.
- $api = $app->include (' ');
- $api->register(new DbAppAndFNAAppRegistrationService());
- // Define any services to register. We will override any present in the external
- // DB have the class of .DAO .
- $service = new AppAndFNAAppService($app, [array(
- ' host ' => ' localhost '
- ) ]);
- $service->register($app, $api);
- $app->register($service);
- $app->register($this);
- // This application will actually register itself as a DbAppAndFNAAppRegistrationService.
- // That way we will be able to hook/build our own custom registration and callback
- // handlers that will be sent to the DbAppAndFNAAppRegistrationService.
- class Blah
- {
- public
- function register()
- {
- return new AppAndFNAAppRegistrationService($api, App::toTts());
- }
- /**
- * Create an FNA simple match API.
- */
- public
- function toTts()
- {
- if (!isset($this->api)) {
- return false;
- }
- if (!isset($api->registered)) {
- return false;
- }
- return $this->api->match($this->name, $this->arguments, 33);
- }
- /**
- * Dump the indices of registered and unregistered services.
- *
- * @return array Dump service indexes
- */
- protected
- function dump(array $services)
- {
- $service = new AppAndFNAAppService($api, $services);
- foreach($this->registered as $service) {
- foreach($api->registered as $service) {
- $components = $server_roundtrip->getComponents($service);
- if (is_bool($components instanceof FNAComponentsProvider)) {
- // FNA components are DummyService or IoComponentsProvider (no third party DB)
- foreach($components as $component) {
- $id = $component->ref();
- $component->run(VOICE_SIMPLIFIED);
- }
- }
- $services[$service->ref() ][$id] = true;
- $services[$service->ref() ][$id] = true;
- }
- }
- return $services;
- }
- /**
- * Register a custom handler to intercept MimeTags.
- *
- * @param IoApp $app An Io application.
- */
- public
- function registerMimeTagInterceptor(IoApp $app)
- {
- if (!isset($app->mixins[' $matchSpec '])) {
- $app->mixins[' $matchSpec '] = new MatchSpec(FNA_MANIFEST_REGEX, FILTER_DEFAULT, DB_EXTENSION_LIMIT);
- }
- $matchSpec = type_match_pattern(time(' mgmt ') , $sql, $app->use__gethostname());
- $match = new MimeTagFilter($matchSpec, $this, $app);
- $match->inputs = $this;
- // Sets the readystate for the match with the Perl DOM event.
- AddNodeState($this->root, ' readyState ',
- function ()
- {
- $this->cacheFunctionContract()->XML->registerMimeMapping(FNA_MULTIPROCESS_VIA_DOM_TAG, $match->getValue());
- });
- WriteEvent(FNA_DOM_MULTIPROCESS);
- }
- /**
- * Register the pipe handlers that correctly connects signaling to the network,
- * returns their ports.
- */
- }
- ?>
Add Comment
Please, Sign In to add comment