コード例 #1
0
 public function notaserviceAction($slug = false, $init = 1)
 {
     $this->view->disable();
     $init = ($init - 1) * 3;
     $response = array();
     $tag_info = \Rpp\Services\Get\Tags::get_tag($slug);
     if (empty(@$tag_info->_id)) {
         echo json_encode($response);
         die;
     }
     foreach (\Rpp\Services\Get\LFlow::tag($slug, 3, $init) as $item) {
         if (empty($item->_id)) {
             continue;
         }
         $response[] = array('img' => \Rpp\Services\Get\UrlMedia::image(\Rpp\Services\Get\Content::node($item->_id)->imagen_portada['hash'], 'medium'), 'titulo' => \Rpp\Services\Get\Content::node($item->_id)->titulo, 'bajada' => \Rpp\Services\Get\Content::node($item->_id)->bajada, 'fecha' => date('Y-m-d H:i', \Rpp\Services\Get\Content::node($item->_id)->fecha_publicacion), 'categoria' => \Rpp\Services\Get\Content::node($item->_id)->categoria['nombre'], 'categoria_url' => str_replace(SITESLUG, '', \Rpp\Services\Get\Content::node($item->_id)->categoria['slug']), 'nota_url' => $this->view->host . \Rpp\Services\Get\Content::nurl($item->_id), 'tipo' => \Rpp\Services\Get\Content::node($item->_id)->tipo);
     }
     echo json_encode($response);
     die;
 }
コード例 #2
0
ファイル: TagschemaTask.php プロジェクト: tresemece/monte
 public function calculateAction()
 {
     $this->mqconf = new \Phalcon\Config\Adapter\Ini(CONFIG_PATH . DIRS . "ini/mq.ini");
     $connection = new AMQPConnection($this->mqconf->host, $this->mqconf->port, $this->mqconf->user, $this->mqconf->pasw);
     $channel = $connection->channel();
     $channel->queue_declare(SITESLUG . '_publicacion_tag_schema', false, true, false, false);
     echo ' [*] Servicio listener para la publicacion de Temas ,  CTRL+C para cancelar', "\n";
     $callback = function ($msg) {
         try {
             $node = json_decode($msg->body);
             print_r($node);
             $tag_info = \Rpp\Services\Get\Tags::get_tag($node->slug);
             var_dump($tag_info);
         } catch (\Exception $e) {
             var_dump($e);
         }
         die;
     };
     $channel->basic_consume(SITESLUG . '_publicacion_tag_schema', '', false, true, false, false, $callback);
     while (count($channel->callbacks)) {
         $channel->wait();
     }
 }
コード例 #3
0
 public function reloadAction()
 {
     $tag_info = \Rpp\Services\Get\Tags::get_tag('star-wars');
     var_dump($tag_info);
 }
コード例 #4
0
ファイル: Tag.php プロジェクト: tresemece/monte
 public function load_tag_info()
 {
     $this->tag_info = \Rpp\Services\Get\Tags::get_tag($this->slug);
 }