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(); }
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); } } }
/** * 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; }
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; }
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]); } }