Пример #1
0
 public static function setting_cache($pattern, $slug = false)
 {
     if ($slug) {
         Cache::request()->save(Cache::get_conf()->cache_prefix->{$pattern} . $slug, static::$flow[$pattern][$slug], Cache::get_conf()->cache_time->{$pattern});
     } else {
         Cache::request()->save(Cache::get_conf()->cache_prefix->{$pattern}, static::$flow[$pattern], Cache::get_conf()->cache_time->{$pattern});
     }
 }
Пример #2
0
 public static function get_seccion($slug)
 {
     $lista = Cache::request()->get('analitica.sugeridos.seccion.' . $slug . '-' . static::$user);
     if (!is_array($lista)) {
         $lista = array();
     }
     return $lista;
 }
Пример #3
0
 public function builder()
 {
     var_dump(SITESLUG . DIRS . $this->slug);
     $ranking[$this->slug] = $this->visitas_builder->addFilter(array('_id' => SITESLUG . DIRS . $this->slug))->load()->lista;
     if (!is_array($ranking[$this->slug])) {
         $ranking[$this->slug] = array();
     }
     print_r($ranking[$this->slug]);
     Cache::request()->save(Cache::get_conf()->cache_prefix->visitas . $this->slug, $ranking[$this->slug], Cache::get_conf()->cache_time->visitas);
 }
Пример #4
0
 public function calculate()
 {
     $key = "analytics.visit.nota.{$this->_nid}";
     if (empty(Cache::request()->get(MQ::get_conf()->cache_prefix->conteo_visitas_nota . $this->_nid))) {
         if (Cache::request()->status_connect()) {
             Cache::request()->save(MQ::get_conf()->cache_prefix->conteo_visitas_nota . $this->_nid, true, MQ::get_conf()->cache_time->conteo_visitas_nota);
             MQ::send_message(MQ::get_conf()->colas->visitas_por_nota, array("nid" => $this->_nid));
         }
     }
     return true;
 }
Пример #5
0
 public static function rebuild($user)
 {
     if (empty(Cache::request()->get('analitica.recomendadas.rebuild.' . $user))) {
         if (Cache::request()->status_connect()) {
             Cache::request()->save('analitica.recomendadas.rebuild' . $user, true, Cache::get_conf()->cache_time->analitica_user_recomendados_rebuild);
             MQ::send_message(MQ::get_conf()->colas->analitica_recomendadas, array("user" => $user));
         } else {
             return false;
         }
     }
     return true;
 }
Пример #6
0
 public function builder()
 {
     var_dump("Corrigiendo bug eliminar");
     $Pattern = $this->patternBuilder->addFilter(array('_id' => $this->nid, 'estado' => 'despublicado'))->build();
     $this->nota = $Pattern->load();
     foreach ($this->nota as $key => $value) {
         Cache::request()->save(Cache::get_conf()->cache_prefix->nota . $this->nid . '.' . $key, null, Cache::get_conf()->cache_time->nota);
         Cachejson::request()->save(Cachejson::get_conf()->cache_prefix->nota . $this->nid . '.' . $key, null, Cachejson::get_conf()->cache_time->nota);
     }
     Cache::request()->save(Cache::get_conf()->cache_prefix->nota . $this->nid . '.node', null, Cache::get_conf()->cache_time->nota);
     Cachejson::request()->save(Cachejson::get_conf()->cache_prefix->nota . $this->nid . '.node', null, Cachejson::get_conf()->cache_time->nota);
     \Rpp\Services\Get\Content::$content = null;
     \Rpp\Services\Get\Flow::$flow = null;
     $home = new \Rpp\Services\Publish\Dominio\Home();
     $home->make();
     //---flujo galerias----//
     if ($this->nota->tipo == 'galeria') {
         \Rpp\Services\Get\Gallery::home();
     } elseif ($this->nota->tipo == 'blog') {
         \Rpp\Services\Get\Flow::autor();
     } elseif ($this->nota->tipo == 'brandcontent') {
         \Rpp\Services\Get\Flow::brandcontent();
     }
     \Rpp\Services\Get\Instantarticle::flow();
     \Rpp\Services\Get\Instantarticle::flowupd();
     $seccion = new \Rpp\Services\Publish\Dominio\Seccion();
     var_dump($this->nota->categoria_slug);
     foreach ($this->nota->categoria_slug as $seccion_slug) {
         $seccion_slug = explode("/", $seccion_slug);
         unset($seccion_slug[0]);
         if (count($seccion_slug) > 0) {
             for ($i = count($seccion_slug); $i > 0; $i--) {
                 //var_dump('del:',implode('/',$seccion_slug));
                 $seccion->set_slug(implode('/', $seccion_slug));
                 $seccion->make();
                 unset($seccion_slug[$i]);
             }
         }
     }
     $tag = new \Rpp\Services\Publish\Dominio\Tag();
     foreach ($this->nota->tags as $tag_slug) {
         $tag->set_slug($tag_slug['slug']);
         $tag->make();
     }
     $this->viewCache->delete("portada.bodyopen.home");
     $this->viewCache->delete("portada.bodycentral.home");
     $this->viewCache->delete("portada.bodyclose.home");
     ###remaquetado##########
     $this->viewCache->delete("portada.body.open.home");
     $this->viewCache->delete("portada.body.central.home");
     $this->viewCache->delete("portada.body.close.home");
     if ($this->nota->tipo == 'galeria') {
         foreach ($this->nota->galeria as $v => $e) {
             $this->viewCache->delete("nota.header.geleria." . $this->nid . "." . $v);
             ###remaquetado##########
             $this->viewCache->delete("nota.header.galeria." . $this->nid . "." . $v);
         }
     }
     $this->viewCache->delete("nota.wrap.group." . $this->nid);
     ###remaquetado##########
     $this->viewCache->delete("nota.article.body." . $this->nid);
     var_dump("terminate.......");
 }
Пример #7
0
 public static function setting_cache()
 {
     Cache::request()->save('portada.resumen.hora', static::$last, 5);
 }
Пример #8
0
 private function reload_tag($tags)
 {
     foreach ($tags as $tag_slug) {
         \Rpp\Services\Get\Flow::tag($tag_slug['slug']);
         \Shared\Cache::request()->delete(\Shared\Cache::get_conf()->cache_prefix->tag . 'relatedtag.' . $tag_slug['slug']);
     }
 }
Пример #9
0
 private function load_sugeridas()
 {
     $user = $this->user;
     $sugeridas = array();
     $tags_list = array();
     $nids_top = array();
     if (!empty($user)) {
         Sugeridos::load($user);
         if (Cache::request()->exists('sugeridas:by:' . $this->nid . ':' . $user)) {
             return $sugeridas = Cache::request()->get('sugeridas:by:' . $this->nid . ':' . $user);
         }
         if (is_array(\Rpp\Services\Get\Content::part($this->nid, 'tags'))) {
             foreach (\Rpp\Services\Get\Content::part($this->nid, 'tags') as $tag) {
                 $tags_list[$tag['slug']] = Sugeridos::get_tag($tag['slug']);
                 foreach ($tags_list[$tag['slug']] as $nid) {
                     if (isset($nids_top[$nid])) {
                         $nids_top[$nid]++;
                     } else {
                         $nids_top[$nid] = 1;
                     }
                 }
             }
         }
         arsort($nids_top);
         unset($nids_top[$this->nid]);
         $nids_top = array_slice($nids_top, 0, 3, true);
         $nids_top = array_keys($nids_top);
         $nids_top = array_combine($nids_top, $nids_top);
         if (count($nids_top) >= 3) {
             $sugeridas = $nids_top;
         } else {
             $slug = explode('/', \Rpp\Services\Get\Content::part($this->nid, 'categoria')['slug']);
             $nids_by_seccion = Sugeridos::get_seccion($slug[1]);
             unset($nids_by_seccion[$this->nid]);
             $sugeridas = $nids_by_seccion + $nids_top;
             $sugeridas = array_slice($sugeridas, 0, 4, true);
         }
         Cache::request()->save('sugeridas:by:' . $this->nid . ':' . $user, $sugeridas, 72000);
     }
     return $sugeridas;
 }
Пример #10
0
 public static function setting_cache($slug)
 {
     Cache::request()->save(Cache::get_conf()->cache_prefix->destacados . $slug, static::$destacados[$slug], Cache::get_conf()->cache_time->destacados);
 }
Пример #11
0
 public static function setting_cache($nid, $part)
 {
     Cache::request()->save(Cache::get_conf()->cache_prefix->nota . $nid . '.' . $part, static::$content[$nid][$part], Cache::get_conf()->cache_time->nota);
     Cachejson::request()->save(Cachejson::get_conf()->cache_prefix->nota . $nid . '.' . $part, static::$content[$nid][$part], Cachejson::get_conf()->cache_time->nota);
 }
Пример #12
0
 public function cacheAction()
 {
     var_dump("start........");
     for ($i = 1; $i < 10; $i++) {
         //$data =  array('title' => 'kjfkjfdjkfdkjfd' , 'bajada'=> 'dsdsdsd sds ds dsdsd sdsd');
         \Shared\Cache::request()->save('test' . $i, $i, 3);
         var_dump("time");
     }
     var_dump("finish...........");
 }
Пример #13
0
 public static function setting_cache($tipo)
 {
     echo "cache: " . SITESLUG . '_widget_player_' . $tipo;
     Cache::request()->delete(SITESLUG . '_widget_player_' . $tipo);
     Cache::request()->save(SITESLUG . '_widget_player_' . $tipo, static::$player, Cache::get_conf()->cache_time->destacados);
 }
Пример #14
0
 public static function setting_cache($fecha)
 {
     Cache::request()->save('sondeos.elecciones.' . $fecha, static::$sondeos[$fecha], 60 * 60 * 24 * 7);
 }
Пример #15
0
 public function make()
 {
     $Pattern = $this->patternBuilder->addFields(array("_id"))->addFilter(array("tags.slug" => $this->slug))->build();
     Cache::request()->save(Cache::get_conf()->cache_prefix->tag . $this->slug, $Pattern->load(), Cache::get_conf()->cache_time->tag);
 }
Пример #16
0
 public static function setting_cache($slug, $tipo = 'categoria')
 {
     Cache::request()->save(Cache::get_conf()->cache_prefix->categorias_info . $tipo . '.' . $slug, static::${$tipo}[$slug], Cache::get_conf()->cache_time->categorias_info);
 }
Пример #17
0
 public static function setting_cache($slug)
 {
     Cache::request()->save(Cache::get_conf()->cache_prefix->visitas . $slug, static::$ranking[$slug], Cache::get_conf()->cache_time->visitas);
 }
Пример #18
0
 public static function setting_cache()
 {
     Cache::request()->save('portada.lista.temas', static::$temas, 18000);
 }
Пример #19
0
 public function make()
 {
     $Pattern = $this->patternBuilder->addFields(array("_id"))->addSlug($this->slug)->build();
     Cache::request()->save(Cache::get_conf()->cache_prefix->seccion . $this->slug, $Pattern->load(), Cache::get_conf()->cache_time->seccion);
 }
Пример #20
0
 public static function setting_cache()
 {
     $res = Cache::request()->save('widget_socialtv_' . static::$slug, static::$socialtv, Cache::get_conf()->cache_time->destacados);
 }
Пример #21
0
 public function recalculate()
 {
     if (empty(Cache::request()->get(MQ::get_conf()->cache_prefix->resultados_df . $this->torneo))) {
         if (Cache::request()->status_connect()) {
             Cache::request()->save(MQ::get_conf()->cache_prefix->resultados_df . $this->torneo, true, MQ::get_conf()->cache_time->resultados_df);
             MQ::send_message(MQ::get_conf()->colas->resultados_df, array("torneo" => $this->torneo, "site" => SITESLUG));
         } else {
             return false;
         }
     }
 }
Пример #22
0
 public static function setting_cache()
 {
     Cache::request()->save(SITESLUG . '_widget_alerta', static::$alert, Cache::get_conf()->cache_time->destacados);
     var_dump(Cache::request()->get(SITESLUG . '_widget_alerta'));
 }
Пример #23
0
 public static function setting_cache($slug)
 {
     Cache::request()->save(Cache::get_conf()->cache_prefix->tags_info . $slug, static::$tags[$slug], Cache::get_conf()->cache_time->tags_info);
 }
Пример #24
0
 public static function setting_cache($pcid)
 {
     //Cache::request()->delete(SITESLUG . '_podcast_' . $pcid);
     Cache::request()->save(SITESLUG . '_podcast_' . $pcid, static::$podcast, Cache::get_conf()->cache_time->destacados);
 }