public function __construct($message = 'URL Factory') { parent::__construct($message); $factory = new h\uri\factory(); $factory->do_register_factory(h\string('a'), new tested_uri_factory($factory)); $this->providers[] = function () use($factory) { $uri = $factory->create(h\string('a:b')); return $uri; }; }
function create_generic() { $factory = new h\uri\factory(); $factory->do_register_factory(h\string('scheme'), new h\uri\scheme_factory($factory)); $factory->do_register_factory(h\string('http'), new h\http\uri_factory($factory)); $factory->do_register_factory(h\string('host'), new h\uri\host_factory($factory)); $factory->do_register_factory(h\string('port'), new h\uri\port_factory($factory)); $factory->do_register_factory(h\string('relative_path'), new h\uri\path_factory($factory)); $factory->do_register_factory(h\string('absolute_path'), new h\uri\path_factory($factory)); return $factory; }
public function __construct($message = 'URL Factory') { parent::__construct($message); $factory = new h\uri\factory(); $factory->do_register_factory(h\string('http'), new h\http\uri_factory($factory)); $factory->do_register_factory(h\string('net_path'), new h\uri\net_path_factory($factory)); $factory->do_register_factory(h\string('hierarchical_part'), new h\uri\hierarchical_part_factory($factory)); $factory->do_register_factory(h\string('host'), new h\uri\host_factory($factory)); $factory->do_register_factory(h\string('port'), new h\uri\port_factory($factory)); $factory->do_register_factory(h\string('absolute_path'), new h\uri\path_factory($factory)); $this->factory = $factory; $this->providers[] = function () { return 'http://localhost/'; }; $this->providers[] = function () { return 'http://projects.lupusmic.org/horn'; }; $this->providers[] = function () { return 'http://projects.lupusmic.org:8080/horn'; }; }