Exemplo n.º 1
0
 protected function cacheSave($objectId, $object)
 {
     if ($this->cache === null) {
         return;
     }
     $this->cache->save('FCACHE_' . $objectId, $object);
 }
 /**
  * Reload the WURFL Data into the persistence provider
  */
 private function reload()
 {
     $this->persistenceStorage->setWURFLLoaded(false);
     $this->invalidateCache();
     $this->init();
     $this->persistenceStorage->save(self::WURFL_API_STATE, $this->getState());
 }
Exemplo n.º 3
0
 /**
  * Saves the classified user agents in the persistence provider
  */
 public function persistData()
 {
     // we sort the array first, useful for doing ris match
     if (!empty($this->userAgentsWithDeviceID)) {
         ksort($this->userAgentsWithDeviceID);
         $this->persistenceProvider->save($this->getPrefix(), $this->userAgentsWithDeviceID);
     }
 }
Exemplo n.º 4
0
 /**
  * Reload the WURFL Data into the persistence provider
  */
 private function reload()
 {
     $this->persistenceStorage->setWURFLLoaded(false);
     $this->invalidateCache();
     $this->init();
     $mtime = filemtime($this->wurflConfig->wurflFile);
     $this->persistenceStorage->save(self::WURFL_LAST_MODIFICATION_TIME, $mtime);
 }
Exemplo n.º 5
0
 /**
  * Save given $device in the persistence provider.  This is called when loading the WURFL XML
  * data, directly after reading the complete device node.
  * @param WURFL_Xml_ModelDevice $device
  * @see WURFL_UserAgentHandlerChain::filter(), WURFL_Storage_Base::save()
  */
 private function classifyAndPersistDevice($device)
 {
     if ($this->validateDevice($device) === false) {
         return;
     }
     array_push($this->devices, $device->id);
     if ($device->fallBack != 'root') {
         $this->fallbacks[$device->fallBack] = $device->id;
     }
     $this->userAgentHandlerChain->filter($device->userAgent, $device->id);
     $this->persistenceProvider->save($device->id, $device);
 }
 /**
  * Save given $device in the persistence provider.  This is called when loading the WURFL XML
  * data, directly after reading the complete device node.
  * @param WURFL_Xml_ModelDevice $device
  * @see WURFL_UserAgentHandlerChain::filter(), WURFL_Storage_Base::save()
  */
 private function classifyAndPersistDevice($device)
 {
     $this->userAgentHandlerChain->filter($device->userAgent, $device->id);
     $this->persistenceProvider->save($device->id, $device);
 }