public static function detect() { $m = new self(); $m->setUseragent(request::getUseragent('')); $m->setProfile(request::getHttpHeader('X-Wap-Profile', '')); //$m->setUseragent('NokiaN8-00/10.0.000 (Symbian/3; S60/5.2 Mozilla/5.0; Profile/MIDP-2.1 Configuration/CLDC-1.1) AppleWebkit/525 (KHTML, like Gecko) BrowserNG/7.2'); //$m->setProfile('http://nds1.nds.nokia.com/uaprof/NN8-00r100-3G.xml'); $m->dump(); }
/** * Dump YAML from PHP array statically. * * The dump method, when supplied with an array, will do its best * to convert the array into friendly YAML. Pretty simple. Feel free to * save the returned string as nothing.yaml and pass it around. * * Oh, and you can decide how big the indent is and what the wordwrap * for folding is. Pretty cool -- just pass in 'false' for either if * you want to use the default. * * Indent's default is 2 spaces, wordwrap's default is 40 characters. And * you can turn off wordwrap by passing in 0. * * @return string * * @param array $array PHP array * @param int $indent Pass in false to use the default, which is 2 * @param int $wordwrap Pass in 0 for no wordwrap, false for default (40) * @param int $no_opening_dashes Do not start YAML file with "---\n" */ public static function YAMLDump($array, $indent = false, $wordwrap = false, $no_opening_dashes = false) { $spyc = new self(); return $spyc->dump($array, $indent, $wordwrap, $no_opening_dashes); }
public static function test() { $context = new ZMQContext(); $output = new ZMQSocket($context, ZMQ::SOCKET_DEALER); //$output->setSockOpt(ZMQ::SOCKOPT_IDENTITY,"identity"); $output->bind("inproc://kvmsg_selftest"); $input = new ZMQSocket($context, ZMQ::SOCKET_ROUTER); $input->connect("inproc://kvmsg_selftest"); $kvmsg = new self(123); $kvmsg->set_key('key'); //$kvmsg->set_sequence(1); $kvmsg->set_uuid(); $kvmsg->set_prop("prop1", "value1"); $kvmsg->set_body('body'); $kvmsg->dump(); $kvmsg->send($output); $kvmsg_2 = new self(2); $kvmsg_2->route_recv($input); $kvmsg_2->dump(); }