Example #1
0
 public function loadWurfl(WURFL_Configuration_Config $config)
 {
     if ($config instanceof WURFL_Configuration_InMemoryConfig) {
         $config->cache("null");
     }
     $wurfl_factory = new WURFL_WURFLManagerFactory($config);
     $this->wurfl = $wurfl_factory->create();
 }
Example #2
0
 private function setWurflConfiguration(array $wurflConfig)
 {
     if (array_key_exists(WURFL_Configuration_Config::MAIN_FILE, $wurflConfig)) {
         $this->wurflFile = parent::getFullPath($wurflConfig[WURFL_Configuration_Config::MAIN_FILE]);
     }
     if (array_key_exists(WURFL_Configuration_Config::PATCHES, $wurflConfig)) {
         foreach ($wurflConfig[WURFL_Configuration_Config::PATCHES] as $wurflPatch) {
             $this->wurflPatches[] = parent::getFullPath($wurflPatch);
         }
     }
 }
Example #3
0
 /**
  * Converts given CSV $params to array of parameters
  * @param string $params Comma-seperated list of parameters
  * @return array Parameters
  */
 private function _toArray($params)
 {
     $paramsArray = array();
     foreach (explode(',', $params) as $param) {
         $paramNameValue = explode('=', $param);
         if (count($paramNameValue) > 1) {
             if (strcmp(WURFL_Configuration_Config::DIR, $paramNameValue[0]) == 0) {
                 $paramNameValue[1] = parent::getFullPath($paramNameValue[1]);
             }
             $paramsArray[trim($paramNameValue[0])] = trim($paramNameValue[1]);
         }
     }
     return $paramsArray;
 }
Example #4
0
 private function _toArray($params)
 {
     $paramsArray = array();
     foreach (explode(",", $params) as $param) {
         $paramNameValue = explode("=", $param);
         if (strcmp(WURFL_Configuration_Config::DIR, $paramNameValue[0]) == 0) {
             $paramNameValue[1] = parent::getFullPath($paramNameValue[1]);
         }
         $paramsArray[$paramNameValue[0]] = $paramNameValue[1];
     }
     return $paramsArray;
 }
Example #5
0
 private function setPersistenceConfiguration(array $persistenceConfig)
 {
     $this->persistence = $persistenceConfig;
     if (array_key_exists('params', $this->persistence) && array_key_exists(WURFL_Configuration_Config::DIR, $this->persistence['params'])) {
         $this->persistence['params'][WURFL_Configuration_Config::DIR] = parent::getFullPath($this->persistence['params'][WURFL_Configuration_Config::DIR]);
     }
 }