Esempio n. 1
0
 /**
  * @param int $item_id
  * @param int|null $node_id - укаывается для кеширования.
  *
  * @return mixed|\SmartCore\Module\Texter\Entity\Item
  */
 public function get($item_id, $node_id = null)
 {
     $cache_key = 'smart_module.texter' . $item_id;
     if (false == ($item = $this->cache->get($cache_key))) {
         $item = $this->em->find('TexterModule:Item', $item_id);
         if ($node_id) {
             $this->cache->set($cache_key, $item, ['smart_module.texter', 'node_' . $node_id]);
         }
     }
     return $item;
 }
Esempio n. 2
0
 public function __construct($NameSpace, $Options)
 {
     parent::__construct($NameSpace, $Options);
     $this->Memcache = new \Memcache();
     foreach ($Options['servers'] as $Server) {
         list($Host, $Port, $Weight) = explode(":", $Server);
         $this->Memcache->addServer($Host, $Port, true, $Weight);
     }
 }
Esempio n. 3
0
 public function __construct($NameSpace, $Options)
 {
     parent::__construct($NameSpace, $Options);
 }
Esempio n. 4
0
 public function __construct($NameSpace, $Options)
 {
     parent::__construct($NameSpace, $Options);
     $this->InitDBFile();
 }
Esempio n. 5
0
 public function __construct($NameSpace, $Options)
 {
     parent::__construct($NameSpace, $Options);
     $this->CacheBaseDir = $Options['cache_dir'];
 }