本文整理汇总了PHP中tools::cleanTableIdealoRealtimeUpdate方法的典型用法代码示例。如果您正苦于以下问题:PHP tools::cleanTableIdealoRealtimeUpdate方法的具体用法?PHP tools::cleanTableIdealoRealtimeUpdate怎么用?PHP tools::cleanTableIdealoRealtimeUpdate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tools
的用法示例。
在下文中一共展示了tools::cleanTableIdealoRealtimeUpdate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
$tools = new tools();
$this->login = $tools->getLogin();
$communication = new Communication($this->login);
if ($tools->checkActive() == "True") {
if ($this->timeGone()) {
$this->timeGone = true;
$communication->tools->newTimestamp();
$this->sendFailedRequests();
}
$this->checkUpdates();
$this->updateIdealo();
} else {
$communication->dropErrorTable();
}
$tools->cleanTableIdealoRealtimeUpdate();
echo 'DONE';
}
示例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;
}
}