本文整理汇总了PHP中Sites::updateLatestRegexRevision方法的典型用法代码示例。如果您正苦于以下问题:PHP Sites::updateLatestRegexRevision方法的具体用法?PHP Sites::updateLatestRegexRevision怎么用?PHP Sites::updateLatestRegexRevision使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sites
的用法示例。
在下文中一共展示了Sites::updateLatestRegexRevision方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkRegexesUptoDate
/**
* @param $url
* @param $rev
* @param $nnid
*/
public function checkRegexesUptoDate($url, $rev, $nnid)
{
if ($url != "") {
if ($nnid != "") {
$nnid = "?newznabID=" . $nnid . "&rev=" . $rev;
}
$regfile = Utility::getUrl(['url' => $url . $nnid, 'method' => 'get', 'enctype' => 'gzip']);
if ($regfile !== false && $regfile != "") {
/*$Rev: 728 $*/
if (preg_match('/\\/\\*\\$Rev: (\\d{3,4})/i', $regfile, $matches)) {
$serverrev = intval($matches[1]);
if ($serverrev > $rev) {
$site = new Sites();
$queries = explode(";", $regfile);
$queries = array_map("trim", $queries);
foreach ($queries as $q) {
if ($q) {
$this->pdo->queryExec($q);
}
}
$site->updateLatestRegexRevision($serverrev);
echo "Updated regexes to revision " . $serverrev . "\n";
} else {
echo "Using latest regex revision " . $rev . "\n";
}
} else {
echo "Error Processing Regex File\n";
}
} else {
echo "Error Regex File Does Not Exist or Unable to Connect\n";
}
}
}
示例2: checkRegexesUptoDate
public function checkRegexesUptoDate($url, $rev, $echooutput = false)
{
if ($url != "") {
$regfile = getUrl($url);
if ($regfile !== false && $regfile != "") {
/*$Rev: 728 $*/
if (preg_match('/\\/\\*\\$Rev: (\\d{3,4})/i', $regfile, $matches)) {
$serverrev = intval($matches[1]);
if ($serverrev > $rev) {
$db = new DB();
$site = new Sites();
$queries = explode(";", $regfile);
$queries = array_map("trim", $queries);
foreach ($queries as $q) {
$db->query($q);
}
$site->updateLatestRegexRevision($serverrev);
if ($echooutput) {
echo "updated regexes to revision " . $serverrev . "\n";
}
} else {
if ($echooutput) {
echo "using latest regex revision " . $rev . "\n";
}
}
} else {
if ($echooutput) {
echo "Error Processing Regex File\n";
}
}
} else {
echo "Error Regex File Does Not Exist or Unable to Connect\n";
}
}
}