• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP XML_Unserializer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中XML_Unserializer的典型用法代码示例。如果您正苦于以下问题:PHP XML_Unserializer类的具体用法?PHP XML_Unserializer怎么用?PHP XML_Unserializer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了XML_Unserializer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: __construct

 function __construct($gmlSource)
 {
     parent::__construct();
     include_once "libs/class_xml_check.php";
     $check = new XML_check();
     if ($check->check_string($gmlSource)) {
         print "GML is well-formed\n";
         //print("Elements      : ".$check->get_xml_elements());
         //print("Attributes    : ".$check->get_xml_attributes());
         //print("Size          : ".$check->get_xml_size());
         //print("Text sections : ".$check->get_xml_text_sections());
         //print("Text size     : ".$check->get_xml_text_size());
     } else {
         print "GML is not well-formed. ";
         print $check->get_full_error() . "\n";
         print "Script terminated\n";
         die;
     }
     $this->gmlSource = $gmlSource;
     $this->gmlCon = new gmlConverter();
     require_once "XML/Unserializer.php";
     $unserializer_options = array('parseAttributes' => TRUE);
     $unserializer = new XML_Unserializer($unserializer_options);
     // Serialize the data structure
     $status = $unserializer->unserialize($this->gmlSource);
     $this->gmlArray = $unserializer->getUnserializedData();
     print date('l jS \\of F Y h:i:s A') . " GML serialized\n";
     // Check if XML is a ServiceException
     if ($unserializer->getRootName() == "ServiceExceptionReport") {
         print "The server returned an exception:\n";
         print $this->gmlSource . "\n";
         print "Script terminated\n";
         die;
     }
 }
开发者ID:ronaldoof,项目名称:geocloud2,代码行数:35,代码来源:gmlparser.php


示例2: fetchData

 function fetchData($username, $password)
 {
     switch ($this->options['cryptType']) {
         case 'blowfish':
             include_once 'Crypt/Blowfish.php';
             $bf = new Crypt_Blowfish($this->options['cryptKey']);
             $password = $bf->encrypt($password);
             $password = base64_encode($password);
             break;
         default:
             if (function_exists($this->options['cryptType'])) {
                 $password = $this->options['cryptType']($password);
             }
             break;
     }
     $req = new HTTP_Request();
     $req->setURL($this->options['URL']);
     $req->setMethod(HTTP_REQUEST_METHOD_GET);
     $req->addQueryString($this->options['usernameKey'], $username);
     $req->addQueryString($this->options['passwordKey'], $password);
     if (!PEAR::isError($req->sendRequest())) {
         $response = $req->getResponseBody();
     } else {
         return false;
     }
     $unserializer = new XML_Unserializer();
     if ($unserializer->unserialize($response)) {
         $this->result_value = $unserializer->getUnserializedData();
         if ($this->result_value[$this->options['resultKey']] == $this->options['correctValue']) {
             return true;
         }
     }
     return false;
 }
开发者ID:KimuraYoichi,项目名称:PukiWiki,代码行数:34,代码来源:REST_XML.php


示例3: testRootName

 /**
  * Test extracting the root name
  */
 public function testRootName()
 {
     $u = new XML_Unserializer();
     $xml = '<xml>data</xml>';
     $u->unserialize($xml);
     $this->assertEquals('xml', $u->getRootName());
 }
开发者ID:quangbt2005,项目名称:vhost-kis,代码行数:10,代码来源:Unserializer_Scalars_TestCase.php


示例4: _loadAcronymList

function _loadAcronymList()
{
    $unser = new XML_Unserializer(array('parseAttributes' => TRUE, 'attributesArray' => '_attrs'));
    $unser->unserialize(PATH_INCLUDE . "xslt/inc/acronyms.xml", true);
    $dat = $unser->getUnserializedData();
    return $dat['word'];
}
开发者ID:BackupTheBerlios,项目名称:openweb-cms-svn,代码行数:7,代码来源:Acronyms.lib.php


示例5: read

 protected function read($filename)
 {
     $xml = file_get_contents($filename);
     $unserializer = new XML_Unserializer();
     $unserializer->unserialize($xml);
     return $unserializer->getUnserializedData();
 }
开发者ID:dracony,项目名称:forked-php-orm-benchmark,代码行数:7,代码来源:Definition.php


示例6: testIndexed

 /**
  * Test unserializing an indexed array
  */
 public function testIndexed()
 {
     $u = new XML_Unserializer();
     $u->setOption(XML_UNSERIALIZER_OPTION_COMPLEXTYPE, 'array');
     $xml = '<xml><foo>bar</foo><foo>tomato</foo></xml>';
     $u->unserialize($xml);
     $this->assertEquals(array('foo' => array('bar', 'tomato')), $u->getUnserializedData());
 }
开发者ID:pear,项目名称:xml_serializer,代码行数:11,代码来源:Unserializer_ArraysTest.php


示例7: readData

 function readData()
 {
     require_once 'XML/Unserializer.php';
     $xmlEngine = new XML_Unserializer();
     if ($xmlEngine->unserialize($this->getFile())) {
         return $xmlEngine->getUnserializedData();
     }
     return false;
 }
开发者ID:radicaldesigns,项目名称:amp,代码行数:9,代码来源:XMLFields.inc.php


示例8: testUtf8ToIso

 /**
  * Test unserializing from UTF-8 to ISO-8859-1
  */
 public function testUtf8ToIso()
 {
     $u = new XML_Unserializer();
     $u->setOption(XML_UNSERIALIZER_OPTION_ENCODING_SOURCE, 'UTF-8');
     $u->setOption(XML_UNSERIALIZER_OPTION_ENCODING_TARGET, 'ISO-8859-1');
     $xml = '<xml>' . utf8_encode('A string containing ü ä Ãê') . '</xml>';
     $u->unserialize($xml);
     $this->assertEquals('A string containing ü ä Ãê', $u->getUnserializedData());
 }
开发者ID:quangbt2005,项目名称:vhost-kis,代码行数:12,代码来源:Unserializer_Option_Encodings_TestCase.php


示例9: executeIndex

 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
 public function executeIndex(sfWebRequest $request)
 {
     $b = new sfWebBrowser();
     $b->post(sfConfig::get('sf_takutomo_get_reserved_driver_url'), array('guid' => 'mixi,' . MixiAppMobileApi::$ownerId));
     $options = array('complexType' => 'array', 'parseAttributes' => TRUE);
     $Unserializer = new XML_Unserializer($options);
     //$Unserializer->setOption('parseAttributes', TRUE);
     $status = $Unserializer->unserialize($b->getResponseText());
     $this->list = $Unserializer->getUnserializedData();
 }
开发者ID:pontuyo,项目名称:takutomo-mixi-appli,代码行数:15,代码来源:actions.class.php


示例10: executeIndex

 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
 public function executeIndex(sfWebRequest $request)
 {
     $this->form = new sfForm();
     //xmlを連想配列に変換
     $options = array('complexType' => 'array');
     $b = new sfWebBrowser();
     $b->post(sfConfig::get('sf_takutomo_get_profile_url'), array('id' => $this->getRequestParameter('m_id')));
     $Unserializer = new XML_Unserializer($options);
     $status = $Unserializer->unserialize($b->getResponseText());
     $this->profile = $Unserializer->getUnserializedData();
 }
开发者ID:pontuyo,项目名称:takutomo-mixi-appli,代码行数:16,代码来源:actions.class.php


示例11: doUnpack

 /**
  * Unpack definition procedure
  *
  * @return array
  * @author Sergey Startsev
  */
 protected function doUnpack($definition)
 {
     $unserializer = new XML_Unserializer($this->unserialize_options);
     // check unserialize status
     $status = $unserializer->unserialize(trim($definition), false);
     if (!$status) {
         throw new afsXmlDefinitionException($status->getMessage());
     }
     // get unserialized data
     return $unserializer->getUnserializedData();
 }
开发者ID:cbsistem,项目名称:appflower_studio,代码行数:17,代码来源:afsXmlDefinition.class.php


示例12: testSetterMethod

 /**
  * Test unserializing with a setter method
  */
 public function testSetterMethod()
 {
     $u = new XML_Unserializer();
     $u->setOption(XML_UNSERIALIZER_OPTION_COMPLEXTYPE, 'object');
     $u->setOption(XML_UNSERIALIZER_OPTION_DEFAULT_CLASS, 'Foo');
     $xml = '<SetterExample><foo>tomato</foo></SetterExample>';
     $u->unserialize($xml);
     $result = new SetterExample();
     $result->setFoo('tomato');
     $this->assertEquals($result, $u->getUnserializedData());
 }
开发者ID:pear,项目名称:xml_serializer,代码行数:14,代码来源:Unserializer_ObjectsTest.php


示例13: executeIndex

 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
 public function executeIndex(sfWebRequest $request)
 {
     $b = new sfWebBrowser();
     $b->get(sfConfig::get('sf_takutomo_get_attend_event_url'), array('guid' => 'DEBUG,sample_member_001'));
     //xmlを連想配列に変換
     $options = array('complexType' => 'array');
     $Unserializer = new XML_Unserializer($options);
     $status = $Unserializer->unserialize($b->getResponseText());
     //if ($status === true) {
     $this->get_attend_event_list = $Unserializer->getUnserializedData();
 }
开发者ID:pontuyo,项目名称:takutomo-mixi-appli,代码行数:16,代码来源:actions.class.php


示例14: setEventDetail

 private function setEventDetail()
 {
     $b = new sfWebBrowser();
     $b->post(sfConfig::get('sf_takutomo_get_event_detail_url'), array('event_id' => $this->getRequestParameter('event_id')));
     if ((int) $xml->status->code >= 1000) {
         $this->form->getErrorSchema()->addError(new sfValidatorError(new sfValidatorPass(), (string) $xml->status->description));
     } else {
         $Unserializer = new XML_Unserializer($this->options);
         $status = $Unserializer->unserialize($b->getResponseText());
         $this->event_detail = $Unserializer->getUnserializedData();
     }
 }
开发者ID:pontuyo,项目名称:takutomo-mixi-appli,代码行数:12,代码来源:actions.class.php


示例15: randomPerson

function randomPerson()
{
    $dir = 'collectedData';
    $files = glob($dir . '/*.*');
    $file = array_rand($files);
    $us = new XML_Unserializer();
    $options = array(XML_UNSERIALIZER_OPTION_TAG_MAP => array('util' => 'XML_Util'), XML_UNSERIALIZER_OPTION_ATTRIBUTE_CLASS => '_classname');
    $us->setOptions($options);
    $us->setOption(XML_UNSERIALIZER_OPTION_COMPLEXTYPE, 'object');
    $result = $us->unserialize($files[$file], true);
    return $us->_unserializedData;
}
开发者ID:sakonet,项目名称:kunstquiz,代码行数:12,代码来源:random.php


示例16: executeIndex

 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
 public function executeIndex(sfWebRequest $request)
 {
     //$mixi_persistence = $persistence->entry->{'mixi.jp:'.MixiAppMobileApi::$ownerId};
     $b = new sfWebBrowser();
     $b->get(sfConfig::get('sf_takutomo_get_attend_event_url'), array('guid' => 'mixi,' . MixiAppMobileApi::$ownerId));
     //xmlを連想配列に変換
     $options = array('complexType' => 'array');
     $Unserializer = new XML_Unserializer($options);
     $status = $Unserializer->unserialize($b->getResponseText());
     //if ($status === true) {
     $this->get_attend_event_list = $Unserializer->getUnserializedData();
 }
开发者ID:pontuyo,项目名称:takutomo-mixi-appli,代码行数:17,代码来源:actions.class.php


示例17: unserialize

 /**
  * 
  * @param string $xml
  * @return array
  */
 public static function unserialize($xml)
 {
     if ($xml instanceof ZendT_Type) {
         $xml = $xml->get();
     }
     $unserializer = new XML_Unserializer();
     $status = $unserializer->unserialize($xml);
     if ($status) {
         $array = $unserializer->getUnserializedData();
     }
     return $array;
 }
开发者ID:rtsantos,项目名称:mais,代码行数:17,代码来源:Xml.php


示例18: getAttendEventList

 /**
  * 相乗りリストを返す 
  * errorの場合 null
  */
 private function getAttendEventList()
 {
     $b = new sfWebBrowser();
     $b->get(sfConfig::get('sf_takutomo_get_attend_event_url'), array('guid' => 'mixi,' . MixiAppMobileApi::$ownerId));
     //xmlを連想配列に変換
     $options = array('complexType' => 'array');
     $Unserializer = new XML_Unserializer($options);
     $status = $Unserializer->unserialize($b->getResponseText());
     if ($status === true) {
         return $Unserializer->getUnserializedData();
     } else {
         return null;
     }
 }
开发者ID:pontuyo,项目名称:takutomo-mixi-appli,代码行数:18,代码来源:actions.class.php


示例19: executeIndex

 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
 public function executeIndex(sfWebRequest $request)
 {
     $b = new sfWebBrowser();
     $b->post(sfConfig::get('sf_takutomo_get_profile_url'), array('id' => $this->getRequestParameter('id')));
     if ((int) $xml->status->code >= 1000) {
         $this->form->getErrorSchema()->addError(new sfValidatorError(new sfValidatorPass(), (string) $xml->status->description));
     } else {
         //xmlを連想配列に変換
         $options = array('complexType' => 'array');
         $Unserializer = new XML_Unserializer($options);
         $status = $Unserializer->unserialize($b->getResponseText());
         $this->member = $Unserializer->getUnserializedData();
     }
 }
开发者ID:pontuyo,项目名称:takutomo-mixi-appli,代码行数:19,代码来源:actions.class.php


示例20: readData

 function readData()
 {
     require_once 'XML/Unserializer.php';
     $xmlEngine = new XML_Unserializer();
     $file_data = $this->getFile();
     if (!$file_data) {
         return false;
     }
     $status = $xmlEngine->unserialize($file_data);
     if (!PEAR::isError($status)) {
         return $xmlEngine->getUnserializedData();
     }
     trigger_error($status->getMessage());
     return false;
 }
开发者ID:radicaldesigns,项目名称:amp,代码行数:15,代码来源:XMLEngine.inc.php



注:本文中的XML_Unserializer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP XML_Util类代码示例发布时间:2022-05-23
下一篇:
PHP XML_Serializer类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap