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


PHP ResourceLoader::makeCombinedStyles方法代码示例

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


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

示例1: getCSS

 /**
  * Get the stylesheet of the MediaWiki skin.
  *
  * @return string
  */
 public function getCSS()
 {
     global $wgStyleDirectory;
     $moduleNames = array('mediawiki.legacy.shared', 'mediawiki.skinning.interface');
     if (file_exists("{$wgStyleDirectory}/Vector/Vector.php")) {
         // Force loading Vector skin if available as a fallback skin
         // for whatever ResourceLoader wants to have as the default.
         // Include instead of require, as this will work without it, it will just look bad.
         // We need the 'global' statement for $wgResourceModules because the Vector skin adds the
         // definitions for its RL modules there that we use implicitly below.
         // @codingStandardsIgnoreStart
         global $wgResourceModules;
         // This is NOT UNUSED!
         // @codingStandardsIgnoreEnd
         include_once "{$wgStyleDirectory}/Vector/Vector.php";
         $moduleNames[] = 'skins.vector.styles';
     }
     $moduleNames[] = 'mediawiki.legacy.config';
     $resourceLoader = new ResourceLoader();
     $rlContext = new ResourceLoaderContext($resourceLoader, new FauxRequest(array('debug' => 'true', 'lang' => $this->getLanguageCode(), 'only' => 'styles')));
     $styles = array();
     foreach ($moduleNames as $moduleName) {
         /** @var ResourceLoaderFileModule $module */
         $module = $resourceLoader->getModule($moduleName);
         // Based on: ResourceLoaderFileModule::getStyles (without the DB query)
         $styles = array_merge($styles, ResourceLoader::makeCombinedStyles($module->readStyleFiles($module->getStyleFiles($rlContext), $module->getFlip($rlContext))));
     }
     return implode("\n", $styles);
 }
开发者ID:whysasse,项目名称:kmwiki,代码行数:34,代码来源:WebInstallerOutput.php

示例2: getCSS

 /**
  * Get the stylesheet of the MediaWiki skin.
  *
  * @return string
  */
 public function getCSS()
 {
     global $wgStyleDirectory;
     $moduleNames = array('mediawiki.legacy.shared', 'mediawiki.skinning.interface');
     $resourceLoader = new ResourceLoader();
     if (file_exists("{$wgStyleDirectory}/Vector/skin.json")) {
         // Force loading Vector skin if available as a fallback skin
         // for whatever ResourceLoader wants to have as the default.
         $registry = new ExtensionRegistry();
         $data = $registry->readFromQueue(array("{$wgStyleDirectory}/Vector/skin.json" => 1));
         if (isset($data['globals']['wgResourceModules'])) {
             $resourceLoader->register($data['globals']['wgResourceModules']);
         }
         $moduleNames[] = 'skins.vector.styles';
     }
     $moduleNames[] = 'mediawiki.legacy.config';
     $rlContext = new ResourceLoaderContext($resourceLoader, new FauxRequest(array('debug' => 'true', 'lang' => $this->getLanguageCode(), 'only' => 'styles')));
     $styles = array();
     foreach ($moduleNames as $moduleName) {
         /** @var ResourceLoaderFileModule $module */
         $module = $resourceLoader->getModule($moduleName);
         if (!$module) {
             // T98043: Don't fatal, but it won't look as pretty.
             continue;
         }
         // Based on: ResourceLoaderFileModule::getStyles (without the DB query)
         $styles = array_merge($styles, ResourceLoader::makeCombinedStyles($module->readStyleFiles($module->getStyleFiles($rlContext), $module->getFlip($rlContext))));
     }
     return implode("\n", $styles);
 }
开发者ID:MediaWiki-stable,项目名称:1.26.1,代码行数:35,代码来源:WebInstallerOutput.php


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