本文整理汇总了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'];
}
}
示例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;
}
}