コード例 #1
0
ファイル: image.php プロジェクト: gigikiri/curlwp
 function render($context, $stream)
 {
     $cache = h2o_cache($context->options);
     $term = $context->resolve(':term');
     $hack = $context->resolve(':hack');
     $url = $this->get_api_url($term, $hack);
     $feed = @$this->fetch($context, $url)->xpath('/searchresult/section/documentset/document');
     $context->set("images", $feed);
 }
コード例 #2
0
ファイル: video.php プロジェクト: gigikiri/curlwp
 function render($context, $stream)
 {
     $cache = h2o_cache($context->options);
     $term = $context->resolve(':term');
     $hack = 'site:youtube.com';
     $url = $this->get_api_url($term, $hack);
     $feed = @$this->fetch($context, $url)->xpath('//channel/item');
     $context->set("videos", $feed);
 }
コード例 #3
0
ファイル: image.php プロジェクト: gigikiri/wpagczone
 function render($context, $stream)
 {
     $cache = h2o_cache($context->options);
     $term = $context->resolve(':term');
     $hack = $context->resolve(':hack');
     $url = $this->get_api_url($term, $hack);
     $feed = @$this->fetch($context, $url);
     $feed = @$this->filter($feed);
     $context->set("images", $feed);
     $context->set("is_single_image", $this->is_single_image());
 }
コード例 #4
0
ファイル: api.php プロジェクト: jensonbetrail/wordpress
 function render($context, $stream)
 {
     $cache = h2o_cache($context->options);
     $term = $context->resolve(':term');
     $hack = $context->resolve(':hack');
     $url = $this->get_api_url($term, $hack);
     $feed = @$this->fetch($context, $url)->xpath('//channel/item');
     $feed = @$this->filter($feed);
     $context->set("api", $feed);
     $context->set("api_url", $url);
 }
コード例 #5
0
ファイル: cache.php プロジェクト: nielsvm/lxc-containers
 function __construct($argstring, $parser, $pos = 0)
 {
     if (!empty($argstring) && !preg_match($this->syntax, $argstring)) {
         throw TemplateSyntaxError('Please specify time to live value for this cache block');
     }
     $this->body = $parser->parse('endcache');
     $this->uid = md5($parser->filename . $pos);
     $this->ttl = (int) $argstring;
     $options = $parser->options;
     if ($this->ttl) {
         $options['cache_ttl'] = $this->ttl;
     }
     if (!$options['cache']) {
         $options['cache'] = 'file';
     }
     $this->cache = h2o_cache($options);
 }
コード例 #6
0
ファイル: loaders.php プロジェクト: JSilva/h2o-php
 function setOptions($options = array())
 {
     if (isset($options['cache']) && $options['cache']) {
         $this->cache = h2o_cache($options);
     }
 }