• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP wfLogWarning函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中wfLogWarning函数的典型用法代码示例。如果您正苦于以下问题:PHP wfLogWarning函数的具体用法?PHP wfLogWarning怎么用?PHP wfLogWarning使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: getSkinNames

 /**
  * Fetch the set of available skins.
  * @return array associative array of strings
  */
 static function getSkinNames()
 {
     global $wgValidSkinNames;
     static $skinsInitialised = false;
     if (!$skinsInitialised || !count($wgValidSkinNames)) {
         # Get a list of available skins
         # Build using the regular expression '^(.*).php$'
         # Array keys are all lower case, array value keep the case used by filename
         #
         wfProfileIn(__METHOD__ . '-init');
         global $wgStyleDirectory;
         $skinDir = dir($wgStyleDirectory);
         if ($skinDir !== false && $skinDir !== null) {
             # while code from www.php.net
             while (false !== ($file = $skinDir->read())) {
                 // Skip non-PHP files, hidden files, and '.dep' includes
                 $matches = array();
                 if (preg_match('/^([^.]*)\\.php$/', $file, $matches)) {
                     $aSkin = $matches[1];
                     // We're still loading core skins via the autodiscovery mechanism... :(
                     if (!in_array($aSkin, array('CologneBlue', 'Modern', 'MonoBook', 'Vector'))) {
                         wfLogWarning("A skin using autodiscovery mechanism, {$aSkin}, was found in your skins/ directory. " . "The mechanism will be removed in MediaWiki 1.25 and the skin will no longer be recognized. " . "See https://www.mediawiki.org/wiki/Manual:Skin_autodiscovery for information how to fix this.");
                     }
                     $wgValidSkinNames[strtolower($aSkin)] = $aSkin;
                 }
             }
             $skinDir->close();
         }
         $skinsInitialised = true;
         wfProfileOut(__METHOD__ . '-init');
     }
     return $wgValidSkinNames;
 }
开发者ID:Tarendai,项目名称:spring-website,代码行数:37,代码来源:Skin.php


示例2: __construct

 /**
  * @param EntityTitleLookup $titleLookup
  * @param EntityContentFactory $entityContentFactory
  * @param IContextSource $context
  */
 public function __construct(EntityTitleLookup $titleLookup, EntityContentFactory $entityContentFactory, IContextSource $context)
 {
     if (!$context instanceof MutableContext) {
         wfLogWarning('$context is not an instanceof MutableContext.');
         $context = new DerivativeContext($context);
     }
     $this->titleLookup = $titleLookup;
     $this->entityContentFactory = $entityContentFactory;
     $this->context = $context;
 }
开发者ID:Benestar,项目名称:mediawiki-extensions-Wikibase,代码行数:15,代码来源:EditFilterHookRunner.php


示例3: getDiff

 /**
  * @since 0.1
  *
  * @param string $cache set to 'cache' to cache the unserialized diff.
  *
  * @return Diff
  */
 public function getDiff($cache = 'no')
 {
     $info = $this->getInfo($cache);
     if (!array_key_exists('diff', $info)) {
         // This shouldn't happen, but we should be robust against corrupt, incomplete
         // obsolete instances in the database, etc.
         wfLogWarning('Cannot get the diff when it has not been set yet.');
         return new Diff();
     } else {
         return $info['diff'];
     }
 }
开发者ID:Benestar,项目名称:mediawiki-extensions-Wikibase,代码行数:19,代码来源:DiffChange.php


示例4: runHook

 /**
  * @param ItemId $itemId
  * @param array $sidebar
  *
  * @return array
  */
 private function runHook(ItemId $itemId, array $sidebar)
 {
     $newSidebar = $sidebar;
     Hooks::run('WikibaseClientOtherProjectsSidebar', array($itemId, &$newSidebar));
     if ($newSidebar === $sidebar) {
         return $sidebar;
     }
     if (!is_array($newSidebar) || !$this->isValidSidebar($newSidebar)) {
         wfLogWarning('Other projects sidebar data invalid after hook run.');
         return $sidebar;
     }
     return $newSidebar;
 }
开发者ID:Benestar,项目名称:mediawiki-extensions-Wikibase,代码行数:19,代码来源:OtherProjectsSidebarGenerator.php


示例5: getSiteLinkDiff

 /**
  * @since 0.3
  *
  * @return Diff
  */
 public function getSiteLinkDiff()
 {
     $diff = $this->getDiff();
     if (!$diff instanceof ItemDiff) {
         // This shouldn't happen, but we should be robust against corrupt, incomplete
         // or obsolete instances in the database, etc.
         $cls = $diff === null ? 'null' : get_class($diff);
         wfLogWarning('Cannot get sitelink diff from ' . $cls . '. Change #' . $this->getId() . ", type " . $this->getType());
         return new Diff();
     } else {
         return $diff->getSiteLinkDiff();
     }
 }
开发者ID:Benestar,项目名称:mediawiki-extensions-Wikibase,代码行数:18,代码来源:ItemChange.php


示例6: getEntityIdFromOutputPage

 /**
  * @param OutputPage $out
  *
  * @return EntityId|null
  */
 public function getEntityIdFromOutputPage(OutputPage $out)
 {
     if (!$this->entityContentFactory->isEntityContentModel($out->getTitle()->getContentModel())) {
         return null;
     }
     $jsConfigVars = $out->getJsConfigVars();
     if (array_key_exists('wbEntityId', $jsConfigVars)) {
         $idString = $jsConfigVars['wbEntityId'];
         try {
             return $this->entityIdParser->parse($idString);
         } catch (EntityIdParsingException $ex) {
             wfLogWarning('Failed to parse EntityId config var: ' . $idString);
         }
     }
     return null;
 }
开发者ID:Benestar,项目名称:mediawiki-extensions-Wikibase,代码行数:21,代码来源:OutputPageEntityIdReader.php


示例7: getValueBuilder

 /**
  * @param string|null $dataTypeId
  * @param string $dataValueType
  *
  * @return null|ValueSnakRdfBuilder
  */
 private function getValueBuilder($dataTypeId, $dataValueType)
 {
     if ($dataTypeId !== null) {
         if (isset($this->valueBuilders["PT:{$dataTypeId}"])) {
             return $this->valueBuilders["PT:{$dataTypeId}"];
         }
     }
     if (isset($this->valueBuilders["VT:{$dataValueType}"])) {
         return $this->valueBuilders["VT:{$dataValueType}"];
     }
     if ($dataTypeId !== null) {
         wfLogWarning(__METHOD__ . ": No RDF builder defined for data type {$dataTypeId} nor for value type {$dataValueType}.");
     } else {
         wfLogWarning(__METHOD__ . ": No RDF builder defined for value type {$dataValueType}.");
     }
     return null;
 }
开发者ID:Benestar,项目名称:mediawiki-extensions-Wikibase,代码行数:23,代码来源:DispatchingValueSnakRdfBuilder.php


示例8: getEntityRevision

 /**
  * @since 0.4
  * @see   EntityRevisionLookup::getEntityRevision
  *
  * @param EntityId $entityId
  * @param int|string $revisionId The desired revision id, or LATEST_FROM_SLAVE or LATEST_FROM_MASTER.
  *
  * @throws RevisionedUnresolvedRedirectException
  * @throws StorageException
  * @return EntityRevision|null
  */
 public function getEntityRevision(EntityId $entityId, $revisionId = self::LATEST_FROM_SLAVE)
 {
     wfDebugLog(__CLASS__, __FUNCTION__ . ': Looking up entity ' . $entityId . " (revision {$revisionId}).");
     // default changed from false to 0 and then to LATEST_FROM_SLAVE
     if ($revisionId === false || $revisionId === 0) {
         wfWarn('getEntityRevision() called with $revisionId = false or 0, ' . 'use EntityRevisionLookup::LATEST_FROM_SLAVE or EntityRevisionLookup::LATEST_FROM_MASTER instead.');
         $revisionId = self::LATEST_FROM_SLAVE;
     }
     /** @var EntityRevision $entityRevision */
     $entityRevision = null;
     if (is_int($revisionId)) {
         $row = $this->entityMetaDataAccessor->loadRevisionInformationByRevisionId($entityId, $revisionId);
     } else {
         $rows = $this->entityMetaDataAccessor->loadRevisionInformation(array($entityId), $revisionId);
         $row = $rows[$entityId->getSerialization()];
     }
     if ($row) {
         /** @var EntityRedirect $redirect */
         try {
             list($entityRevision, $redirect) = $this->loadEntity($row);
         } catch (MWContentSerializationException $ex) {
             throw new StorageException('Failed to unserialize the content object.', 0, $ex);
         }
         if ($redirect !== null) {
             throw new RevisionedUnresolvedRedirectException($entityId, $redirect->getTargetId(), (int) $row->rev_id, $row->rev_timestamp);
         }
         if ($entityRevision === null) {
             // This only happens when there is a problem with the external store.
             wfLogWarning(__METHOD__ . ': Entity not loaded for ' . $entityId);
         }
     }
     if ($entityRevision !== null && !$entityRevision->getEntity()->getId()->equals($entityId)) {
         // This can happen when giving a revision ID that doesn't belong to the given entity,
         // or some meta data is incorrect.
         $actualEntityId = $entityRevision->getEntity()->getId()->getSerialization();
         // Get the revision id we actually loaded, if none was passed explicitly
         $revisionId = is_int($revisionId) ? $revisionId : $entityRevision->getRevisionId();
         throw new BadRevisionException("Revision {$revisionId} belongs to {$actualEntityId} instead of expected {$entityId}");
     }
     if (is_int($revisionId) && $entityRevision === null) {
         // If a revision ID was specified, but that revision doesn't exist:
         throw new BadRevisionException("No such revision found for {$entityId}: {$revisionId}");
     }
     return $entityRevision;
 }
开发者ID:Benestar,项目名称:mediawiki-extensions-Wikibase,代码行数:56,代码来源:WikiPageEntityRevisionLookup.php


示例9: fixSubstructureDiff

 /**
  * Checks the type of a substructure diff, and replaces it if needed.
  * This is needed for backwards compatibility with old versions of
  * MapDiffer: As of commit ff65735a125e, MapDiffer may generate atomic diffs for
  * substructures even in recursive mode (bug 51363).
  *
  * @param array &$operations All change ops; This is a reference, so the
  *        substructure diff can be replaced if need be.
  * @param string $key The key of the substructure
  */
 protected function fixSubstructureDiff(array &$operations, $key)
 {
     if (!isset($operations[$key])) {
         return;
     }
     if (!$operations[$key] instanceof Diff) {
         $warning = "Invalid substructure diff for key {$key}: " . get_class($operations[$key]);
         if (function_exists('wfLogWarning')) {
             wfLogWarning($warning);
         } else {
             trigger_error($warning, E_USER_WARNING);
         }
         // We could look into the atomic diff, see if it uses arrays as values,
         // and construct a new Diff according to these values. But since the
         // actual old behavior of MapDiffer didn't cause that to happen, let's
         // just use an empty diff, which is what MapDiffer should have returned
         // in the actual broken case mentioned in bug 51363.
         $operations[$key] = new Diff(array(), true);
     }
 }
开发者ID:SRMSE,项目名称:cron-wikidata,代码行数:30,代码来源:EntityDiff.php


示例10: searchText

 /**
  * Search revisions with provided term.
  *
  * @param string $term Term to search
  * @return Status
  */
 public function searchText($term)
 {
     // full-text search
     $queryString = new QueryString($term);
     $queryString->setFields(array('revisions.text'));
     $this->query->setQuery($queryString);
     // add aggregation to determine exact amount of matching search terms
     $terms = $this->getTerms($term);
     $this->query->addAggregation($this->termsAggregation($terms));
     // @todo: abstract-away this config? (core/cirrus also has this - share it somehow?)
     $this->query->setHighlight(array('fields' => array(static::HIGHLIGHT_FIELD => array('type' => 'plain', 'order' => 'score', 'number_of_fragments' => 1, 'fragment_size' => 10000)), 'pre_tags' => array(static::HIGHLIGHT_PRE), 'post_tags' => array(static::HIGHLIGHT_POST)));
     // @todo: support insource: queries (and perhaps others)
     $searchable = Connection::getFlowIndex($this->indexBaseName);
     if ($this->type !== false) {
         $searchable = $searchable->getType($this->type);
     }
     $search = $searchable->createSearch($this->query);
     // @todo: PoolCounter config at PoolCounterSettings-eqiad.php
     // @todo: do we want this class to extend from ElasticsearchIntermediary and use its success & failure methods (like CirrusSearch/Searcher does)?
     // Perform the search
     $work = new PoolCounterWorkViaCallback('Flow-Search', "_elasticsearch", array('doWork' => function () use($search) {
         try {
             $result = $search->search();
             return Status::newGood($result);
         } catch (ExceptionInterface $e) {
             if (strpos($e->getMessage(), 'dynamic scripting for [groovy] disabled')) {
                 // known issue with default ES config, let's display a more helpful message
                 return Status::newFatal(new \RawMessage("Couldn't complete search: dynamic scripting needs to be enabled. " . "Please add 'script.disable_dynamic: false' to your elasticsearch.yml"));
             }
             return Status::newFatal('flow-error-search');
         }
     }, 'error' => function (Status $status) {
         $status = $status->getErrorsArray();
         wfLogWarning('Pool error searching Elasticsearch: ' . $status[0][0]);
         return Status::newFatal('flow-error-search');
     }));
     $result = $work->execute();
     return $result;
 }
开发者ID:TarLocesilion,项目名称:mediawiki-extensions-Flow,代码行数:45,代码来源:Searcher.php


示例11: coalesceRuns

 /**
  * Coalesce consecutive changes by the same user to the same entity into one.
  * A run of changes may be broken if the action performed changes (e.g. deletion
  * instead of update) or if a sitelink pointing to the local wiki was modified.
  *
  * Some types of actions, like deletion, will break runs.
  * Interleaved changes to different items will break runs.
  *
  * @param EntityChange[] $changes
  *
  * @return EntityChange[] grouped changes
  */
 private function coalesceRuns(array $changes)
 {
     $coalesced = array();
     $currentRun = array();
     $currentUser = null;
     $currentEntity = null;
     $currentAction = null;
     $breakNext = false;
     foreach ($changes as $change) {
         try {
             $action = $change->getAction();
             $meta = $change->getMetadata();
             $user = $meta['user_text'];
             $entityId = $change->getEntityId()->__toString();
             $break = $breakNext || $currentAction !== $action || $currentUser !== $user || $currentEntity !== $entityId;
             $breakNext = false;
             if (!$break && $change instanceof ItemChange) {
                 $siteLinkDiff = $change->getSiteLinkDiff();
                 if (isset($siteLinkDiff[$this->localSiteId])) {
                     // TODO: don't break if only the link's badges changed
                     $break = true;
                     $breakNext = true;
                 }
             }
             if ($break) {
                 if (!empty($currentRun)) {
                     try {
                         $coalesced[] = $this->mergeChanges($currentRun);
                     } catch (MWException $ex) {
                         // Something went wrong while trying to merge the changes.
                         // Just keep the original run.
                         wfWarn($ex->getMessage());
                         $coalesced = array_merge($coalesced, $currentRun);
                     }
                 }
                 $currentRun = array();
                 $currentUser = $user;
                 $currentEntity = $entityId;
                 $currentAction = $action === EntityChange::ADD ? EntityChange::UPDATE : $action;
             }
             $currentRun[] = $change;
             // skip any change that failed to process in some way (bug T51417)
         } catch (Exception $ex) {
             wfLogWarning(__METHOD__ . ':' . $ex->getMessage());
         }
     }
     if (!empty($currentRun)) {
         try {
             $coalesced[] = $this->mergeChanges($currentRun);
         } catch (MWException $ex) {
             // Something went wrong while trying to merge the changes.
             // Just keep the original run.
             wfWarn($ex->getMessage());
             $coalesced = array_merge($coalesced, $currentRun);
         }
     }
     return $coalesced;
 }
开发者ID:Benestar,项目名称:mediawiki-extensions-Wikibase,代码行数:70,代码来源:ChangeRunCoalescer.php


示例12: fixEditConflict

 /**
  * Attempts to fix an edit conflict by patching the intended change into the latest revision after
  * checking for conflicts. This modifies $this->newEntity but does not write anything to the
  * database. Saving of the new content may still fail.
  *
  * @return bool True if the conflict could be resolved, false otherwise
  */
 public function fixEditConflict()
 {
     $baseRev = $this->getBaseRevision();
     $latestRev = $this->getLatestRevision();
     if (!$latestRev) {
         wfLogWarning('Failed to load latest revision of entity ' . $this->newEntity->getId() . '! ' . 'This may indicate entries missing from thw wb_entities_per_page table.');
         return false;
     }
     $entityDiffer = new EntityDiffer();
     $entityPatcher = new EntityPatcher();
     // calculate patch against base revision
     // NOTE: will fail if $baseRev or $base are null, which they may be if
     // this gets called at an inappropriate time. The data flow in this class
     // should be improved.
     $patch = $entityDiffer->diffEntities($baseRev->getEntity(), $this->newEntity);
     if ($patch->isEmpty()) {
         // we didn't technically fix anything, but if there is nothing to change,
         // so just keep the current content as it is.
         $this->newEntity = $latestRev->getEntity()->copy();
         return true;
     }
     // apply the patch( base -> new ) to the latest revision.
     $patchedLatest = $latestRev->getEntity()->copy();
     $entityPatcher->patchEntity($patchedLatest, $patch);
     // detect conflicts against latest revision
     $cleanPatch = $entityDiffer->diffEntities($latestRev->getEntity(), $patchedLatest);
     $conflicts = $patch->count() - $cleanPatch->count();
     if ($conflicts > 0) {
         // patch doesn't apply cleanly
         if ($this->userWasLastToEdit($this->user, $this->newEntity->getId(), $this->getBaseRevisionId())) {
             // it's a self-conflict
             if ($cleanPatch->count() === 0) {
                 // patch collapsed, possibly because of diff operation change from base to latest
                 return false;
             } else {
                 // we still have a working patch, try to apply
                 $this->status->warning('wikibase-self-conflict-patched');
             }
         } else {
             // there are unresolvable conflicts.
             return false;
         }
     } else {
         // can apply cleanly
         $this->status->warning('wikibase-conflict-patched');
     }
     // remember the patched entity as the actual new entity to save
     $this->newEntity = $patchedLatest;
     return true;
 }
开发者ID:TU-Berlin,项目名称:WikidataMath,代码行数:57,代码来源:EditEntity.php


示例13: transformFilePath

 /**
  * Utility method for transformResourceFilePath().
  *
  * Caller is responsible for ensuring the file exists. Emits a PHP warning otherwise.
  *
  * @since 1.27
  * @param string $remotePath URL path that points to $localPath
  * @param string $localPath File directory exposed at $remotePath
  * @param string $file Path to target file relative to $localPath
  * @return string URL
  */
 public static function transformFilePath($remotePath, $localPath, $file)
 {
     $hash = md5_file("{$localPath}/{$file}");
     if ($hash === false) {
         wfLogWarning(__METHOD__ . ": Failed to hash {$localPath}/{$file}");
         $hash = '';
     }
     return "{$remotePath}/{$file}?" . substr($hash, 0, 5);
 }
开发者ID:OrBin,项目名称:mediawiki,代码行数:20,代码来源:OutputPage.php


示例14: decompressRevisionText

 /**
  * Re-converts revision text according to it's flags.
  *
  * @param mixed $text Reference to a text
  * @param array $flags Compression flags
  * @return string|bool Decompressed text, or false on failure
  */
 public static function decompressRevisionText($text, $flags)
 {
     if (in_array('gzip', $flags)) {
         # Deal with optional compression of archived pages.
         # This can be done periodically via maintenance/compressOld.php, and
         # as pages are saved if $wgCompressRevisions is set.
         $text = gzinflate($text);
         if ($text === false) {
             wfLogWarning(__METHOD__ . ': gzinflate() failed');
             return false;
         }
     }
     if (in_array('object', $flags)) {
         # Generic compressed storage
         $obj = unserialize($text);
         if (!is_object($obj)) {
             // Invalid object
             return false;
         }
         $text = $obj->getText();
     }
     global $wgLegacyEncoding;
     if ($text !== false && $wgLegacyEncoding && !in_array('utf-8', $flags) && !in_array('utf8', $flags)) {
         # Old revisions kept around in a legacy encoding?
         # Upconvert on demand.
         # ("utf8" checked for compatibility with some broken
         #  conversion scripts 2008-12-30)
         global $wgContLang;
         $text = $wgContLang->iconv($wgLegacyEncoding, 'UTF-8', $text);
     }
     return $text;
 }
开发者ID:OrBin,项目名称:mediawiki,代码行数:39,代码来源:Revision.php


示例15: getLegacySkinNames

 /**
  * @return array
  */
 private function getLegacySkinNames()
 {
     static $skinsInitialised = false;
     if (!$skinsInitialised || !count($this->legacySkins)) {
         # Get a list of available skins
         # Build using the regular expression '^(.*).php$'
         # Array keys are all lower case, array value keep the case used by filename
         #
         wfProfileIn(__METHOD__ . '-init');
         global $wgStyleDirectory;
         $skinDir = dir($wgStyleDirectory);
         if ($skinDir !== false && $skinDir !== null) {
             # while code from www.php.net
             while (false !== ($file = $skinDir->read())) {
                 // Skip non-PHP files, hidden files, and '.dep' includes
                 $matches = array();
                 if (preg_match('/^([^.]*)\\.php$/', $file, $matches)) {
                     $aSkin = $matches[1];
                     // Explicitly disallow loading core skins via the autodiscovery mechanism.
                     //
                     // They should be loaded already (in a non-autodicovery way), but old files might still
                     // exist on the server because our MW version upgrade process is widely documented as
                     // requiring just copying over all files, without removing old ones.
                     //
                     // This is one of the reasons we should have never used autodiscovery in the first
                     // place. This hack can be safely removed when autodiscovery is gone.
                     if (in_array($aSkin, array('CologneBlue', 'Modern', 'MonoBook', 'Vector'))) {
                         wfLogWarning("An old copy of the {$aSkin} skin was found in your skins/ directory. " . "You should remove it to avoid problems in the future." . "See https://www.mediawiki.org/wiki/Manual:Skin_autodiscovery for details.");
                         continue;
                     }
                     wfLogWarning("A skin using autodiscovery mechanism, {$aSkin}, was found in your skins/ directory. " . "The mechanism will be removed in MediaWiki 1.25 and the skin will no longer be recognized. " . "See https://www.mediawiki.org/wiki/Manual:Skin_autodiscovery for information how to fix this.");
                     $this->legacySkins[strtolower($aSkin)] = $aSkin;
                 }
             }
             $skinDir->close();
         }
         $skinsInitialised = true;
         wfProfileOut(__METHOD__ . '-init');
     }
     return $this->legacySkins;
 }
开发者ID:whysasse,项目名称:kmwiki,代码行数:44,代码来源:SkinFactory.php


示例16: getPage

 /**
  * Find the object with a given name and return it (or NULL)
  *
  * @param string $name Special page name, may be localised and/or an alias
  * @return SpecialPage|null SpecialPage object or null if the page doesn't exist
  */
 public static function getPage($name)
 {
     list($realName, ) = self::resolveAlias($name);
     if (isset(self::$pageObjectCache[$realName])) {
         return self::$pageObjectCache[$realName];
     }
     $specialPageList = self::getPageList();
     if (isset($specialPageList[$realName])) {
         $rec = $specialPageList[$realName];
         if (is_callable($rec)) {
             // Use callback to instantiate the special page
             $page = call_user_func($rec);
         } elseif (is_string($rec)) {
             $className = $rec;
             $page = new $className();
         } elseif (is_array($rec)) {
             $className = array_shift($rec);
             // @deprecated, officially since 1.18, unofficially since forever
             wfDeprecated("Array syntax for \$wgSpecialPages is deprecated ({$className}), " . "define a subclass of SpecialPage instead.", '1.18');
             $page = ObjectFactory::getObjectFromSpec(['class' => $className, 'args' => $rec, 'closure_expansion' => false]);
         } elseif ($rec instanceof SpecialPage) {
             $page = $rec;
             // XXX: we should deep clone here
         } else {
             $page = null;
         }
         self::$pageObjectCache[$realName] = $page;
         if ($page instanceof SpecialPage) {
             return $page;
         } else {
             // It's not a classname, nor a callback, nor a legacy constructor array,
             // nor a special page object. Give up.
             wfLogWarning("Cannot instantiate special page {$realName}: bad spec!");
             return null;
         }
     } else {
         return null;
     }
 }
开发者ID:claudinec,项目名称:galan-wiki,代码行数:45,代码来源:SpecialPageFactory.php


示例17: rebuild

 /**
  * @see Store::rebuild
  *
  * @since 0.1
  */
 public function rebuild()
 {
     $dbw = wfGetDB(DB_MASTER);
     // TODO: refactor selection code out (relevant for other stores)
     $pages = $dbw->select(array('page'), array('page_id', 'page_latest'), array('page_content_model' => WikibaseRepo::getDefaultInstance()->getEntityContentFactory()->getEntityContentModels()), __METHOD__, array('LIMIT' => 1000));
     foreach ($pages as $pageRow) {
         $page = WikiPage::newFromID($pageRow->page_id);
         $revision = Revision::newFromId($pageRow->page_latest);
         try {
             $page->doEditUpdates($revision, $GLOBALS['wgUser']);
         } catch (DBQueryError $e) {
             wfLogWarning('editUpdateFailed for ' . $page->getId() . ' on revision ' . $revision->getId() . ': ' . $e->getMessage());
         }
     }
 }
开发者ID:Benestar,项目名称:mediawiki-extensions-Wikibase,代码行数:20,代码来源:SqlStore.php


示例18: handleException

 /**
  * @param Exception $ex
  */
 private function handleException(Exception $ex)
 {
     if ($this->exceptionCallback) {
         call_user_func($this->exceptionCallback, $ex);
     } else {
         wfLogWarning($ex->getMessage());
     }
 }
开发者ID:MediaWiki-stable,项目名称:1.26.1,代码行数:11,代码来源:SiteImporter.php


示例19: doTitleMoveComplete

 /**
  * @param Title $oldTitle
  * @param Title $newTitle
  * @param User $user
  *
  * @return bool
  */
 private function doTitleMoveComplete(Title $oldTitle, Title $newTitle, User $user)
 {
     if (!$this->isWikibaseEnabled($newTitle->getNamespace())) {
         return true;
     }
     if ($this->propagateChangesToRepo !== true) {
         return true;
     }
     $updateRepo = new UpdateRepoOnMove($this->repoDatabase, $this->siteLinkLookup, $user, $this->siteGlobalID, $oldTitle, $newTitle);
     if (!$this->shouldBePushed($updateRepo)) {
         return true;
     }
     try {
         $updateRepo->injectJob($this->jobQueueGroup);
         // To be able to find out about this in the SpecialMovepageAfterMove hook
         $newTitle->wikibasePushedMoveToRepo = true;
     } catch (MWException $e) {
         // This is not a reason to let an exception bubble up, we just
         // show a message to the user that the Wikibase item needs to be
         // manually updated.
         wfLogWarning($e->getMessage());
         wfDebugLog('UpdateRepo', "OnMove: Failed to inject job: " . $e->getMessage());
     }
     return true;
 }
开发者ID:Benestar,项目名称:mediawiki-extensions-Wikibase,代码行数:32,代码来源:UpdateRepoHookHandlers.php


示例20: setBadgesProperty

 private function setBadgesProperty(ItemId $itemId, ParserOutput $out)
 {
     /** @var Item $item */
     $item = $this->entityLookup->getEntity($itemId);
     if (!$item || !$item->getSiteLinkList()->hasLinkWithSiteId($this->siteId)) {
         // Probably some sort of race condition or data inconsistency, better log a warning
         wfLogWarning('According to a SiteLinkLookup ' . $itemId->getSerialization() . ' is linked to ' . $this->siteId . ' while it is not or it does not exist.');
         return;
     }
     $siteLink = $item->getSiteLinkList()->getBySiteId($this->siteId);
     foreach ($siteLink->getBadges() as $badge) {
         $out->setProperty('wikibase-badge-' . $badge->getSerialization(), true);
     }
 }
开发者ID:Benestar,项目名称:mediawiki-extensions-Wikibase,代码行数:14,代码来源:ClientParserOutputDataUpdater.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP wfMakeUrlIndexes函数代码示例发布时间:2022-05-23
下一篇:
PHP wfLogProfilingData函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap