Subversion Repositories php-qbpwcf

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 liveuser 1
<?php
2
 
3
namespace Guzzle\Parser\UriTemplate;
4
 
5
use Guzzle\Common\Exception\RuntimeException;
6
 
7
/**
8
 * Expands URI templates using the uri_template pecl extension (pecl install uri_template-beta)
9
 *
10
 * @link http://pecl.php.net/package/uri_template
11
 * @link https://github.com/ioseb/uri-template
12
 */
13
class PeclUriTemplate implements UriTemplateInterface
14
{
15
    public function __construct()
16
    {
17
        if (!extension_loaded('uri_template')) {
18
            throw new RuntimeException('uri_template PECL extension must be installed to use PeclUriTemplate');
19
        }
20
    }
21
 
22
    public function expand($template, array $variables)
23
    {
24
        return uri_template($template, $variables);
25
    }
26
}