本文整理汇总了PHP中WebRequest::getFuzzyBool方法的典型用法代码示例。如果您正苦于以下问题:PHP WebRequest::getFuzzyBool方法的具体用法?PHP WebRequest::getFuzzyBool怎么用?PHP WebRequest::getFuzzyBool使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebRequest
的用法示例。
在下文中一共展示了WebRequest::getFuzzyBool方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* @param ResourceLoader $resourceLoader
* @param WebRequest $request
*/
public function __construct(ResourceLoader $resourceLoader, WebRequest $request)
{
$this->resourceLoader = $resourceLoader;
$this->request = $request;
// Interpret request
// List of modules
$modules = $request->getVal('modules');
$this->modules = $modules ? self::expandModuleNames($modules) : array();
// Various parameters
$this->skin = $request->getVal('skin');
$this->user = $request->getVal('user');
$this->debug = $request->getFuzzyBool('debug', $resourceLoader->getConfig()->get('ResourceLoaderDebug'));
$this->only = $request->getVal('only');
$this->version = $request->getVal('version');
$this->raw = $request->getFuzzyBool('raw');
// Image requests
$this->image = $request->getVal('image');
$this->variant = $request->getVal('variant');
$this->format = $request->getVal('format');
$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();
// 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');
}
}
示例3: __construct
/**
* @param $resourceLoader ResourceLoader
* @param $request WebRequest
*/
public function __construct($resourceLoader, WebRequest $request)
{
global $wgDefaultSkin, $wgResourceLoaderDebug;
$this->resourceLoader = $resourceLoader;
$this->request = $request;
// Interpret request
// List of modules
$modules = $request->getVal('modules');
$this->modules = $modules ? self::expandModuleNames($modules) : array();
// Various parameters
$this->skin = $request->getVal('skin');
$this->user = $request->getVal('user');
$this->debug = $request->getFuzzyBool('debug', $wgResourceLoaderDebug);
$this->only = $request->getVal('only');
$this->version = $request->getVal('version');
// Wikia - change begin - @author: wladek
$this->sassParams = array();
foreach ($request->getValues() as $key => $value) {
if (startsWith($key, 'sass_')) {
$this->sassParams[substr($key, strlen('sass_'))] = $value;
}
}
ksort($this->sassParams);
// Wikia - change end
$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 = $wgDefaultSkin;
}
}
示例4: __construct
/**
* @param $resourceLoader ResourceLoader
* @param $request WebRequest
*/
public function __construct($resourceLoader, WebRequest $request)
{
global $wgDefaultSkin, $wgResourceLoaderDebug;
$this->resourceLoader = $resourceLoader;
$this->request = $request;
// Interpret request
// List of modules
$modules = $request->getVal('modules');
$this->modules = $modules ? self::expandModuleNames($modules) : array();
// Various parameters
$this->skin = $request->getVal('skin');
$this->user = $request->getVal('user');
$this->debug = $request->getFuzzyBool('debug', $wgResourceLoaderDebug);
$this->only = $request->getVal('only');
$this->version = $request->getVal('version');
$this->raw = $request->getFuzzyBool('raw');
$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 = $wgDefaultSkin;
}
}
示例5: __construct
public function __construct(ResourceLoader $resourceLoader, WebRequest $request)
{
global $wgDefaultSkin, $wgResourceLoaderDebug;
$this->resourceLoader = $resourceLoader;
$this->request = $request;
// Interpret request
// List of modules
$modules = $request->getVal('modules');
$this->modules = $modules ? self::expandModuleNames($modules) : array();
// Various parameters
$this->skin = $request->getVal('skin');
$this->user = $request->getVal('user');
$this->debug = $request->getFuzzyBool('debug', $wgResourceLoaderDebug);
$this->only = $request->getVal('only');
$this->version = $request->getVal('version');
if (!$this->skin) {
$this->skin = $wgDefaultSkin;
}
}