当前位置: 首页>>代码示例>>PHP>>正文


PHP tools::getXML方法代码示例

本文整理汇总了PHP中tools::getXML方法的典型用法代码示例。如果您正苦于以下问题:PHP tools::getXML方法的具体用法?PHP tools::getXML怎么用?PHP tools::getXML使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tools的用法示例。


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

示例1: updateIdealo

 public function updateIdealo()
 {
     $tools = new tools();
     $tools->AllNeeded();
     $communication = new Communication($this->login);
     $count = count($this->update);
     $update = 0;
     $interval = $this->login['pagesize'];
     if ($count < $this->login['pagesize']) {
         $interval = $count;
     }
     while ($count > 0) {
         $tools->getXMLBegin($this->login['testmode']);
         for ($i = $update; $i < $update + $interval; $i++) {
             if ($this->update[$i]['event'] == 'DELETE') {
                 $tools->deleteProductAtIdealo($this->update[$i]['product']);
             } else {
                 $tools->getXML($this->update[$i]['product']);
             }
         }
         @$communication->sendRequest($tools->xml->saveXML());
         $count = $count - $this->login['pagesize'];
         $update = $update + $this->login['pagesize'];
     }
 }
开发者ID:shophelfer,项目名称:shophelfer.com-shop,代码行数:25,代码来源:idealo_realtime.php

示例2: process

 public function process($file)
 {
     if (isset($_POST['sendIdealoMail'])) {
         $this->sendMail();
     }
     $tools = new tools();
     $this->login = $tools->getLogin();
     $communication = new Communication($this->login);
     if ($this->saveSetting()) {
         @xtc_set_time_limit(0);
         $tools->cleanTableIdealoRealtimeUpdate();
         $tools->cleanTableIdealoRealtimeFailedRequest();
         $tools->cleanTestFile();
         $tools->AllNeeded();
         $this->login = $tools->getLogin();
         $xml = '';
         try {
             if ($this->login['testmode'] != '1') {
                 if (isset($_POST['hardReset'])) {
                     if ($_POST['hardReset'] == 'on') {
                         $communication->deleteAllFromIdealo();
                     } else {
                         $this->cleanIdealo();
                     }
                 } else {
                     $this->cleanIdealo();
                 }
             }
         } catch (Exception $e) {
         }
         if ($this->login['status'] == 'True') {
             $xml = '';
             $tools->newTimestamp();
             $communication = new Communication($this->login);
             $artikel_start = 0;
             $article_count = xtc_db_query("SELECT count(*) FROM `products`;");
             $article_count = xtc_db_fetch_array($article_count);
             $article_count = $article_count['count(*)'];
             $repetition = 0;
             if ($article_count > 0) {
                 if ($article_count <= $this->login['pagesize']) {
                     $repetition = 1;
                 } else {
                     $repetition = ceil($article_count / $this->login['pagesize']);
                 }
             }
             for ($i = 1; $i <= $repetition; $i++) {
                 $artikel = $this->getArtikelID($artikel_start, $this->login['pagesize']);
                 $xml = $tools->getXMLBegin($this->login['testmode']);
                 foreach ($artikel as $art) {
                     $xml .= $tools->getXML($art);
                 }
                 $xml .= $tools->getXMLEnd();
                 if (strpos($xml, '<offer>') !== false) {
                     @$communication->sendRequest($xml);
                 }
                 $artikel_start = $artikel_start + $this->login['pagesize'];
             }
             if ($this->login['testmode'] == '1') {
                 $this->backToBackend(substr($_SERVER['PHP_SELF'], 0, -24));
                 die;
             }
         }
     } else {
         $this->backToBackendFailed();
         die;
     }
 }
开发者ID:shophelfer,项目名称:shophelfer.com-shop,代码行数:68,代码来源:idealo_real.php


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