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


PHP WikiFactory::getListOfWikisWithVar方法代码示例

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


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

示例1: execute

 function execute()
 {
     global $wgOut, $wgUser, $wgRequest, $wgTitle;
     $gVar = $wgRequest->getText('var');
     $gVal = $wgRequest->getVal('val', 'true');
     $gLikeVal = $wgRequest->getVal('likeValue', 'true');
     $gTypeVal = $wgRequest->getVal('searchType', 'bool');
     $wgOut->SetPageTitle(wfMsg('whereisextension'));
     $wgOut->setRobotpolicy('noindex,nofollow');
     if (!$wgUser->isAllowed('WhereIsExtension')) {
         $this->displayRestrictionError();
         return;
     }
     $this->values = array(0 => array('true', true, '='), 1 => array('false', false, '='), 2 => array('not empty', '', '!='));
     $tagName = $wgRequest->getVal('wikiSelectTagName', null);
     $tagWikis = $wgRequest->getArray('wikiSelected');
     $tagResultInfo = '';
     if ($wgRequest->wasPosted() && !empty($tagName) && count($tagWikis)) {
         $tagResultInfo = $this->tagSelectedWikis($tagName, $tagWikis);
     }
     $formData['vars'] = $this->getListOfVars($gVar == '');
     $formData['vals'] = $this->values;
     $formData['selectedVal'] = $gVal;
     $formData['likeValue'] = $gLikeVal;
     $formData['searchType'] = $gTypeVal;
     $formData['selectedGroup'] = $gVar == '' ? 27 : '';
     //default group: extensions (or all groups when looking for variable, rt#16953)
     $formData['groups'] = WikiFactory::getGroups();
     $formData['actionURL'] = $wgTitle->getFullURL();
     // by default, we don't need a paginator
     $sPaginator = '';
     if (!empty($gVar)) {
         $formData['selectedVar'] = $gVar;
         // assume an empty result
         $formData['count'] = 0;
         $formData['wikis'] = array();
         if (isset($this->values[$gVal][1]) && isset($this->values[$gVal][2])) {
             // check how many wikis meet the conditions
             $formData['count'] = WikiFactory::getCountOfWikisWithVar($gVar, $gTypeVal, $this->values[$gVal][2], $this->values[$gVal][1], $gLikeVal);
             // if there are any, get the list and create a Paginator
             if (0 < $formData['count']) {
                 // determine the offset (from the requested page)
                 $iPage = $wgRequest->getVal('page', 1);
                 $iOffset = ($iPage - 1) * self::ITEMS_PER_PAGE;
                 // the list
                 $formData['wikis'] = WikiFactory::getListOfWikisWithVar($gVar, $gTypeVal, $this->values[$gVal][2], $this->values[$gVal][1], $gLikeVal, $iOffset, self::ITEMS_PER_PAGE);
                 // the Paginator, if we need more than one page
                 if (self::ITEMS_PER_PAGE < $formData['count']) {
                     $oPaginator = Paginator::newFromArray(array_fill(0, $formData['count'], ''), self::ITEMS_PER_PAGE, 5);
                     $oPaginator->setActivePage($iPage - 1);
                     $sPager = $oPaginator->getBarHTML(sprintf('%s?var=%s&val=%s&likeValue=%s&searchType=%s&page=%%s', $wgTitle->getFullURL(), $gVar, $gVal, $gLikeVal, $gTypeVal));
                 }
             }
         }
     }
     $oTmpl = new EasyTemplate(dirname(__FILE__) . '/templates/');
     $oTmpl->set_vars(array('formData' => $formData, 'tagResultInfo' => $tagResultInfo, 'sPager' => $sPager));
     $wgOut->addHTML($oTmpl->render('list'));
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:59,代码来源:SpecialWhereIsExtension_body.php

示例2: getWikisWithVar

 protected function getWikisWithVar()
 {
     $wikiList = [];
     $list = WikiFactory::getListOfWikisWithVar(self::LICENSE_WIKI_FACTORY_VAR_ID, "full", '', '');
     foreach ($list as $wikiId => $val) {
         $wikiList[$wikiId] = array("id" => $wikiId, "url" => $val['u'], "host" => rtrim(ltrim($val['u'], "http://"), "/"), "db" => $val['d']);
     }
     return $wikiList;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:9,代码来源:LicensedWikisService.class.php

示例3: getCitiesForReviewList

 /**
  * Get list of wikis marked by wiki founders as directed at children
  * @return array citiesList
  */
 public function getCitiesForReviewList($limit = 20, $page = 0)
 {
     wfProfileIn(__METHOD__);
     if ($page < 0) {
         $page = 0;
     }
     $offset = $page * $limit;
     $aCities = array();
     if ($this->byFounderVarId) {
         $aCities = WikiFactory::getListOfWikisWithVar($this->byFounderVarId, 'bool', '=', true, '', $offset, $limit);
     }
     wfProfileOut(__METHOD__);
     return $aCities;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:18,代码来源:WDACReviewHelper.class.php

示例4: execute

 public function execute()
 {
     $wikiFactory = new WikiFactory();
     $varId = $wikiFactory->getVarIdByName(self::VAR_TO_SET);
     if ($varId === false) {
         throw new ErrorException('No such variable: ' . self::VAR_TO_SET);
     }
     $newTopWikiIds = $this->getTopWamWikiIds(self::TOP_NUMBER_OF_WIKIS);
     $oldTopWikiIds = array_keys($wikiFactory->getListOfWikisWithVar($varId, 'bool', '=', true));
     foreach ($newTopWikiIds as $wikiId) {
         if (array_search($wikiId, $oldTopWikiIds) === false) {
             $wikiFactory->setVarById($varId, $wikiId, true, __METHOD__);
             echo '+' . $wikiId . PHP_EOL;
         }
     }
     foreach ($oldTopWikiIds as $wikiId) {
         if (array_search($wikiId, $newTopWikiIds) === false) {
             $wikiFactory->removeVarById($varId, $wikiId, __METHOD__);
             echo '-' . $wikiId . PHP_EOL;
         }
     }
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:22,代码来源:identifyTopWamWikis.php

示例5: getIdsBlacklistedWikis

 protected function getIdsBlacklistedWikis()
 {
     $blacklistIds = WikiaDataAccess::cache(wfSharedMemcKey('wam_blacklist', self::MEMCACHE_VER), self::CACHE_DURATION, function () {
         $contentWarningWikis = $excludedWikis = [];
         // Exlude wikias with ContentWarning extension enabled
         $blacklistExtVarId = WikiFactory::getVarIdByName(self::WAM_BLACKLIST_EXT_VAR_NAME);
         if ($blacklistExtVarId) {
             $contentWarningWikis = array_keys(WikiFactory::getListOfWikisWithVar($blacklistExtVarId, 'bool', '=', true));
         }
         // Exclude wikias with an exclusion flag set to true
         $blacklistFlagVarId = WikiFactory::getVarIdByName(self::WAM_EXCLUDE_FLAG_NAME);
         if ($blacklistFlagVarId) {
             $excludedWikis = array_keys(WikiFactory::getListOfWikisWithVar($blacklistFlagVarId, 'bool', '=', true));
         }
         return array_merge($contentWarningWikis, $excludedWikis);
     });
     return $blacklistIds;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:18,代码来源:WAMService.class.php

示例6: getWhitelistedWikisFromWF

 protected function getWhitelistedWikisFromWF()
 {
     $this->wf->ProfileIn(__METHOD__);
     $key = wfMemcKey(__CLASS__, __METHOD__);
     $data = $this->wg->memc->get($key, null);
     if (!empty($data)) {
         $this->wf->ProfileOut(__METHOD__);
         return $data;
     }
     $oVariable = WikiFactory::getVarByName('wgImageReviewWhitelisted', 177);
     $fromWf = WikiFactory::getListOfWikisWithVar($oVariable->cv_variable_id, 'bool', '=', true);
     $this->wg->memc->set($key, $fromWf, 60 * 10);
     $this->wf->ProfileOut(__METHOD__);
     return $fromWf;
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:15,代码来源:PromoteImageReviewHelper.class.php

示例7: ini_set

 * @author: Inez
 *
 * Get familiar with "How_to_run_maintenance_script" article on internal to figure out how to run it.
 */
ini_set("include_path", dirname(__FILE__) . "/../");
require_once "commandLine.inc";
function enableVEUI($id)
{
    WikiFactory::setVarByName('wgEnableVisualEditorUI', $id, true);
    WikiFactory::clearCache($id);
}
function isVEenabled($id)
{
    $out = WikiFactory::getVarByName('wgEnableVisualEditorExt', $id);
    return $out ? unserialize($out->cv_value) : false;
}
$varid = WikiFactory::getVarIdByName('wgEnableVisualEditorExt', true);
$list = WikiFactory::getListOfWikisWithVar($varid, 'bool', '=', true);
foreach ($list as $id => $val) {
    echo "Wiki id: {$id}\n";
    $isVEenabled = isVEenabled($id);
    if ($isVEenabled) {
        // IMPORTANT! Uncomment line below if you really want it to work.
        //enableVEUI( $id );
        echo "Enabled VEUI\n";
    } else {
        echo "Not enabled VEUI because VE not enabled\n";
    }
    echo "########################################\n";
}
WikiFactory::clearInterwikiCache();
开发者ID:Tjorriemorrie,项目名称:app,代码行数:31,代码来源:enableVEUIforVEenabled.php

示例8: getCorporateSitesList

 /**
  * @desc Gets id of wgEnableWikiaHomePageExt variable and then loads and returns list of corporate sites
  * @return array
  */
 protected function getCorporateSitesList()
 {
     return WikiaDataAccess::cache(wfSharedMemcKey('corporate_pages_list', self::CITY_VISUALIZATION_CORPORATE_PAGE_LIST_MEMC_VERSION), WikiaResponse::CACHE_STANDARD, function () {
         // loads list of corporate sites (sites which have $wgEnableWikiaHomePageExt WF variable set to true)
         $wikiFactoryVarId = WikiFactory::getVarIdByName(self::WIKIA_HOME_PAGE_WF_VAR_NAME);
         if (is_int($wikiFactoryVarId)) {
             return WikiFactory::getListOfWikisWithVar($wikiFactoryVarId, 'bool', '=', true);
         } else {
             return [];
         }
     });
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:16,代码来源:CityVisualization.class.php

示例9: getWikisIncludedInCorporateFooterDropdown

 public function getWikisIncludedInCorporateFooterDropdown()
 {
     $wikiFactoryList = [];
     $varId = WikiFactory::getVarIdByName(self::IS_WIKI_INCLUDED_IN_CORPORATE_FOOTER_DROPDOWN_VAR_NAME);
     if (is_int($varId)) {
         $wikiFactoryList = WikiaDataAccess::cache(wfMemcKey('wikis_included_in_corporate_footer_dropdown', self::WIKIA_HOME_PAGE_HELPER_MEMC_VERSION), 24 * 60 * 60, function () use($varId) {
             $list = WikiFactory::getListOfWikisWithVar($varId, 'bool', '=', true);
             return $this->cleanWikisDataArray($list);
         }, WikiaDataAccess::REFRESH_CACHE);
     }
     return $wikiFactoryList;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:12,代码来源:WikiaHomePageHelper.class.php

示例10: isset

	$dryRun = ( isset($options['dry-run']) );
	$quiet = ( isset($options['quiet']) );
	$copyRVtoGlobalList = ( isset($options['copyRVtoGlobalList']) );

	if ( empty($wgCityId) ) {
		die( "Error: Invalid wiki id." );
	}

	echo "Base wiki: ".$wgCityId."\n";

	// get var id
	$var = WikiFactory::getVarByName( 'wgRelatedVideosPartialRelease', $wgCityId );
	echo "wgRelatedVideosPartialRelease ID: ".$var->cv_id."\n";

	// get list of wikis with wgRelatedVideosPartialRelease = false
	$wikis = WikiFactory::getListOfWikisWithVar( $var->cv_id, 'bool', '=' , false, true );
	$total = count( $wikis );
	echo "Total wikis (wgRelatedVideosPartialRelease = false): ".$total."\n";

	$counter = 0;
	$failed = 0;

	foreach( $wikis as $wikiId => $detail ) {
		$counter++;
		echo "[$counter of $total] Wiki $wikiId ";
		$wiki = WikiFactory::getWikiById( $wikiId );
		if ( !empty($wiki) && $wiki->city_public == 1 ) {
			$dbname = $wiki->city_dbname;

			echo "($dbname): \n";
开发者ID:schwarer2006,项目名称:wikia,代码行数:30,代码来源:getRelatedVideosArticles.php

示例11: getHubsWikis

 /**
  * Get list of hubs from Database
  *
  * @param $lang
  * @return array
  */
 private function getHubsWikis($lang)
 {
     $varId = WikiFactory::getVarIdByName(self::HUBS_V3_VARIABLE_NAME);
     $wikis = WikiFactory::getListOfWikisWithVar($varId, 'bool', '=', true);
     if (!empty($lang)) {
         foreach ($wikis as $wikiId => $wiki) {
             if ($wiki['l'] != $lang) {
                 unset($wikis[$wikiId]);
             }
         }
     }
     $out = [];
     foreach ($wikis as $wikiId => $wiki) {
         $out[$wikiId] = ['id' => $wikiId, 'name' => $wiki['t'], 'url' => $wiki['u'], 'language' => $wiki['l']];
     }
     return $out;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:23,代码来源:WikiaHubsApiController.class.php

示例12: getCuratedContentQuality

 public function getCuratedContentQuality()
 {
     $curatedContentQualityPerWiki = [];
     $curatedContentQualityTotal = ['totalNumberOfMissingImages' => 0, 'totalNumberOfTooLongTitles' => 0, 'totalNumberOfItems' => 0];
     $wikiID = $this->request->getInt('wikiID', null);
     $totalImages = $this->request->getBool('totalImages', false);
     $totalTitles = $this->request->getBool('totalTitles', false);
     $this->cacheResponseFor(1, self::DAYS);
     $this->getResponse()->setFormat(WikiaResponse::FORMAT_JSON);
     if (empty($wikiID)) {
         $wikiWithCC = WikiFactory::getListOfWikisWithVar(self::CURATED_CONTENT_WG_VAR_ID_PROD, "full", "LIKE", null, "true");
         foreach ($wikiWithCC as $wikiID => $wikiData) {
             $quality = $this->getCuratedContentQualityForWiki($wikiID);
             $curatedContentQualityTotal['totalNumberOfMissingImages'] += $quality['missingImagesCount'];
             $curatedContentQualityTotal['totalNumberOfTooLongTitles'] += $quality['tooLongTitlesCount'];
             $curatedContentQualityTotal['totalNumberOfItems'] += $quality['totalNumberOfItems'];
             $curatedContentQualityPerWiki[$wikiData['u']] = $quality;
         }
         if ($totalImages) {
             $this->response->setVal('item', $curatedContentQualityTotal['totalNumberOfMissingImages']);
             $this->response->setVal('min', ['value' => 0]);
             $this->response->setVal('max', ['value' => $curatedContentQualityTotal['totalNumberOfItems']]);
         } else {
             if ($totalTitles) {
                 $this->response->setVal('item', $curatedContentQualityTotal['totalNumberOfTooLongTitles']);
                 $this->response->setVal('min', ['value' => 0]);
                 $this->response->setVal('max', ['value' => $curatedContentQualityTotal['totalNumberOfItems']]);
             } else {
                 $this->response->setVal('curatedContentQualityTotal', $curatedContentQualityTotal);
                 $this->response->setVal('curatedContentQualityPerWiki', $curatedContentQualityPerWiki);
             }
         }
     } else {
         $quality = $this->getCuratedContentQualityForWiki($wikiID);
         $this->response->setVal('wikiQuality', $quality);
     }
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:37,代码来源:CuratedContentController.class.php


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