本文整理汇总了PHP中Embed\Request::match方法的典型用法代码示例。如果您正苦于以下问题:PHP Request::match方法的具体用法?PHP Request::match怎么用?PHP Request::match使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Embed\Request
的用法示例。
在下文中一共展示了Request::match方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: check
/**
* {@inheritdoc}
*/
public static function check(Request $request)
{
return $request->match(['https://line.do/*']);
}
示例2: getEndPointFromRequest
/**
* Returns the oembed link from the request
*
* @param Request $request
* @param array $config
*
* @return array|null
*/
protected static function getEndPointFromRequest(Request $request, array $config)
{
//Search the oembed provider using the domain
$class = 'Embed\\Providers\\OEmbed\\' . str_replace(' ', '', ucwords(strtolower(str_replace('-', ' ', $request->getDomain()))));
if (class_exists($class) && $request->match($class::getPatterns())) {
return ['endPoint' => $class::getEndpoint(), 'params' => $class::getParams($request)];
}
//Search using embedly
if (!empty($config['embedlyKey']) && $request->match(OEmbed\Embedly::getPatterns())) {
return ['endPoint' => OEmbed\Embedly::getEndpoint(), 'params' => OEmbed\Embedly::getParams($request) + ['key' => $config['embedlyKey']]];
}
}
示例3: check
/**
* {@inheritdoc}
*/
public static function check(Request $request)
{
return $request->isValid() && $request->match(['https?://soundcloud.com/*', 'https?://m.soundcloud.com/*']);
}
示例4: check
/**
* {@inheritdoc}
*/
public static function check(Request $request)
{
return $request->match(['https://maps.google.*', 'https://www.google.*/maps*']);
}
示例5: check
/**
* {@inheritdoc}
*/
public static function check(Request $request)
{
return $request->isValid([200, 429]) && $request->match(['https?://*.youtube.*']);
}
示例6: check
/**
* {@inheritdoc}
*/
public static function check(Request $request)
{
return $request->isValid() && $request->match(['https?://500px.com/photo/*']);
}
示例7: check
/**
* {@inheritdoc}
*/
public static function check(Request $request)
{
return $request->match(['https://maps.google.*', 'https://www.google.*/maps*', 'https://drive.google.com/file/*/view']);
}