本文整理汇总了PHP中utils::getSemanticQuery方法的典型用法代码示例。如果您正苦于以下问题:PHP utils::getSemanticQuery方法的具体用法?PHP utils::getSemanticQuery怎么用?PHP utils::getSemanticQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类utils
的用法示例。
在下文中一共展示了utils::getSemanticQuery方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
private function run()
{
global $wgServerName, $wgScriptPath;
$params = $this->extractRequestParams();
wfDebugLog('p2p', 'ApiQueryPatch params ' . $params['patchId']);
$array = array(1 => 'id', 2 => 'onPage', 3 => 'operation', 4 => 'previous', 5 => 'siteID', 6 => 'mime', 7 => 'size', 8 => 'url', 9 => 'DateAtt', 10 => 'siteUrl', 11 => 'causal');
$array1 = array(1 => 'patchID', 2 => 'onPage', 3 => 'hasOperation', 4 => 'previous', 5 => 'siteID', 6 => 'mime', 7 => 'size', 8 => 'url', 9 => 'DateAtt', 10 => 'siteUrl', 11 => 'causal');
$query = '';
for ($j = 1; $j <= count($array1); $j++) {
$query = $query . '?' . $array1[$j] . '
';
}
$res = utils::getSemanticQuery('[[patchID::' . $params['patchId'] . ']]', $query);
$count = $res->getCount();
for ($i = 0; $i < $count; $i++) {
$row = $res->getNext();
if ($row === false) {
break;
}
for ($j = 1; $j <= count($array); $j++) {
if ($j == 3) {
$col = $row[$j]->getContent();
// SMWResultArray object
foreach ($col as $object) {
// SMWDataValue object
$wikiValue = $object->getWikiValue();
$op[] = $wikiValue;
}
$results[$j] = $op;
} else {
$col = $row[$j]->getContent();
// SMWResultArray object
foreach ($col as $object) {
// SMWDataValue object
$wikiValue = $object->getWikiValue();
$results[$j] = $wikiValue;
}
}
}
}
$result = $this->getResult();
// $data = str_replace('"', '', $data);
// $data = explode('!',$data);
if ($results[1]) {
for ($i = 1; $i <= count($array); $i++) {
if ($results[$i] != null) {
if ($i == 2) {
$title = trim($results[$i], ":");
$result->addValue(array('query', $this->getModuleName()), $array[$i], $title);
} elseif ($i == 3) {
$op = $results[$i];
$result->setIndexedTagName($op, $array[$i]);
$result->addValue('query', $this->getModuleName(), $op);
} else {
$result->addValue(array('query', $this->getModuleName()), $array[$i], $results[$i]);
}
}
}
}
}
示例2: run
private function run()
{
global $wgServerName, $wgScriptPath;
wfDebugLog('p2p', '@@@@@@@@@@@@@@@@@@@@ ApiQueryChangeSet : $wgServerName, $wgScriptPath');
$params = $this->extractRequestParams();
$res = utils::getSemanticQuery('[[inPushFeed::PushFeed:' . $params['pushName'] . ']][[previousChangeSet::' . $params['changeSet'] . ']]', '?changeSetID
?hasPatch');
$count = $res->getCount();
$results = array();
for ($i = 0; $i < $count; $i++) {
$row = $res->getNext();
if ($row === false) {
break;
}
$changesetId = $row[1];
$col = $changesetId->getContent();
//SMWResultArray object
foreach ($col as $object) {
//SMWDataValue object
$wikiValue = $object->getWikiValue();
$results[1] = $wikiValue;
}
$hasPatch = $row[2];
$col = $hasPatch->getContent();
//SMWResultArray object
foreach ($col as $object) {
//SMWDataValue object
$wikiValue = $object->getWikiValue();
$patches[] = $wikiValue;
}
$results[2] = $patches;
}
$result = $this->getResult();
if (isset($results[1])) {
$CSID = $results[1];
} else {
$CSID = null;
}
wfDebugLog('p2p', ' -> CSID : ' . $CSID);
if ($CSID) {
$data = $results[2];
$result->setIndexedTagName($data, 'patch');
$result->addValue(array('query', $this->getModuleName()), 'id', $CSID);
$result->addValue('query', $this->getModuleName(), $data);
}
}
示例3: run
private function run()
{
global $wgServerName, $wgScriptPath;
$params = $this->extractRequestParams();
wfDebugLog('p2p', ' - ApiQueryPatchPushed params ' . $params['pushName']);
$publishedInPush = getPublishedPatches($params['pushName']);
$published = null;
// filtered on published patch on page title
if (isset($params['pageName'])) {
foreach ($publishedInPush as $patch) {
$patches = array();
$res = utils::getSemanticQuery('[[Patch:+]][[patchID::' . $patch . ']][[onPage::' . $params['pageName'] . ']]');
$count = $res->getCount();
for ($i = 0; $i < $count; $i++) {
$row = $res->getNext();
if ($row === false) {
break;
}
$row = $row[0];
$col = $row->getContent();
// SMWResultArray object
foreach ($col as $object) {
// SMWDataValue object
$wikiValue = $object->getWikiValue();
$patches[] = $wikiValue;
}
}
if (count($patches)) {
$published[] = $patch;
}
}
wfDebugLog('p2p', ' -> isset($params[pageName]');
} else {
$published = $publishedInPush;
wfDebugLog('p2p', ' -> not isset($params[pageName]');
}
$result = $this->getResult();
if (!is_null($published)) {
$result->setIndexedTagName($published, 'patch');
$result->addValue('query', $this->getModuleName(), $published);
$result->addValue(array('query', $this->getModuleName()), 'pushFeed', $params['pushName']);
}
}
示例4: getRequestedPages
/**
* Returns an array of page titles received via the request.
*
* @return array
*/
protected function getRequestedPages($request)
{
$results = array();
$res = utils::getSemanticQuery($request);
$count = $res->getCount();
for ($i = 0; $i < $count; $i++) {
$row = $res->getNext();
if ($row === false) {
break;
}
$row = $row[0];
$col = $row->getContent();
// SMWResultArray object
foreach ($col as $object) {
// SMWDataValue object
$wikiValue = $object->getWikiValue();
$results[] = $wikiValue;
}
}
return $results;
}
示例5: getPushURL
/**
* Gets the URL of the pushfeed where the pullfeed has subscribed
*
* @global <String> $wgServerName
* @global <String> $wgScriptPath
* @param <String> $name pullfeed name
* @return <String> Pushfeed Url
*/
function getPushURL($name)
{
// pullfeed name with NS
$results = array();
$res = utils::getSemanticQuery('[[PullFeed:+]] [[name::' . $name . ']]', '?pushFeedServer');
if ($res === false) {
return false;
}
$count = $res->getCount();
for ($i = 0; $i < $count; $i++) {
$row = $res->getNext();
if ($row === false) {
break;
}
$row = $row[1];
$col = $row->getContent();
// SMWResultArray object
foreach ($col as $object) {
// SMWDataValue object
$wikiValue = $object->getWikiValue();
$results[] = $wikiValue;
}
}
if (empty($results)) {
return false;
} else {
return $results[0];
}
}
示例6: getPageConcernedByPull
/**
* Used to get the list of article titles concerned by the given pullfeed
* @param <string> $pfname pullfeed name
* @return <array> array of page titles
*/
static function getPageConcernedByPull($pfname)
{
$patchs = utils::getPulledPatches($pfname);
$tabPage = array();
foreach ($patchs as $patch) {
$onPage = array();
$res = utils::getSemanticQuery('[[Patch:+]][[patchID::' . $patch . ']]', '?onPage');
if ($res === false) {
return false;
}
$count = $res->getCount();
for ($i = 0; $i < $count; $i++) {
$row = $res->getNext();
if ($row === false) {
break;
}
$row = $row[1];
$col = $row->getContent();
//SMWResultArray object
foreach ($col as $object) {
//SMWDataValue object
$wikiValue = $object->getWikiValue();
$onPage[] = $wikiValue;
}
}
if (!empty($onPage)) {
$tabPage[$onPage[0]] = 0;
}
}
return $tabPage;
}