本文整理汇总了PHP中ResourceLoader::getLogger方法的典型用法代码示例。如果您正苦于以下问题:PHP ResourceLoader::getLogger方法的具体用法?PHP ResourceLoader::getLogger怎么用?PHP ResourceLoader::getLogger使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ResourceLoader
的用法示例。
在下文中一共展示了ResourceLoader::getLogger方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* @param ResourceLoader $resourceLoader
* @param WebRequest $request
*/
public function __construct(ResourceLoader $resourceLoader, WebRequest $request)
{
$this->resourceLoader = $resourceLoader;
$this->request = $request;
$this->logger = $resourceLoader->getLogger();
// Future developers: Avoid use of getVal() in this class, which performs
// expensive UTF normalisation by default. Use getRawVal() instead.
// Values here are either one of a finite number of internal IDs,
// or previously-stored user input (e.g. titles, user names) that were passed
// to this endpoint by ResourceLoader itself from the canonical value.
// Values do not come directly from user input and need not match.
// List of modules
$modules = $request->getRawVal('modules');
$this->modules = $modules ? self::expandModuleNames($modules) : [];
// Various parameters
$this->user = $request->getRawVal('user');
$this->debug = $request->getFuzzyBool('debug', $resourceLoader->getConfig()->get('ResourceLoaderDebug'));
$this->only = $request->getRawVal('only', null);
$this->version = $request->getRawVal('version', null);
$this->raw = $request->getFuzzyBool('raw');
// Image requests
$this->image = $request->getRawVal('image');
$this->variant = $request->getRawVal('variant');
$this->format = $request->getRawVal('format');
$this->skin = $request->getRawVal('skin');
$skinnames = Skin::getSkinNames();
// If no skin is specified, or we don't recognize the skin, use the default skin
if (!$this->skin || !isset($skinnames[$this->skin])) {
$this->skin = $resourceLoader->getConfig()->get('DefaultSkin');
}
}
示例2: __construct
/**
* @param ResourceLoader $resourceLoader
* @param WebRequest $request
*/
public function __construct(ResourceLoader $resourceLoader, WebRequest $request)
{
$this->resourceLoader = $resourceLoader;
$this->request = $request;
$this->logger = $resourceLoader->getLogger();
// List of modules
$modules = $request->getVal('modules');
$this->modules = $modules ? self::expandModuleNames($modules) : array();
// Various parameters
$this->user = $request->getVal('user');
$this->debug = $request->getFuzzyBool('debug', $resourceLoader->getConfig()->get('ResourceLoaderDebug'));
$this->only = $request->getVal('only', null);
$this->version = $request->getVal('version', null);
$this->raw = $request->getFuzzyBool('raw');
// Image requests
$this->image = $request->getVal('image');
$this->variant = $request->getVal('variant');
$this->format = $request->getVal('format');
$this->skin = $request->getVal('skin');
$skinnames = Skin::getSkinNames();
// If no skin is specified, or we don't recognize the skin, use the default skin
if (!$this->skin || !isset($skinnames[$this->skin])) {
$this->skin = $resourceLoader->getConfig()->get('DefaultSkin');
}
}