public function setUp() { $resourcesDir = realpath(dirname(__FILE__) . DIRECTORY_SEPARATOR . "../../resources"); $config = new WURFL_Configuration_InMemoryConfig(); $config->wurflFile($resourcesDir . "/wurfl_base.xml"); // Setup WURFL Persistence $this->persistenceDir = sys_get_temp_dir() . '/api_test'; WURFL_FileUtils::mkdir($this->persistenceDir); $config->persistence('file', array('dir' => $this->persistenceDir)); // Setup Caching $config->cache('null'); $wurflManagerFactory = new WURFL_WURFLManagerFactory($config); $this->wurflManager = $wurflManagerFactory->create(); }
/** * Initializes the Persistence Dir * * @param array of parameters for configuring the Persistence Provider */ function initialize($params) { if (is_array($params)) { if (!array_key_exists(self::DIR, $params)) { throw new WURFL_WURFLException("Specify a valid Persistence dir in the configuration file"); } // Check if the directory exist and it is also write access if (!is_writable($params[self::DIR])) { throw new WURFL_WURFLException("The diricetory specified <" . $params[self::DIR] . "> for the persistence provider does not exist or it is not writable\n"); } $this->_persistenceDir = $params[self::DIR] . DIRECTORY_SEPARATOR . $this->persistenceIdentifier; WURFL_FileUtils::mkdir($this->_persistenceDir); } }
function __construct($params) { if (is_array($params)) { if (!array_key_exists(self::DIR, $params)) { throw new WURFL_WURFLException("Specify a valid cache dir in the configuration file"); } // Check if the directory exist and it is also write access if (!is_writable($params[self::DIR])) { throw new WURFL_WURFLException("The diricetory specified <" . $params[self::DIR] . " > for the cache provider does not exist or it is not writable\n"); } $this->_cacheDir = $params[self::DIR] . DIRECTORY_SEPARATOR . $this->cacheIdentifier; $this->root = $params[self::DIR] . DIRECTORY_SEPARATOR . $this->cacheIdentifier; $this->expire = isset($params[WURFL_Cache_CacheProvider::EXPIRATION]) ? $params[WURFL_Cache_CacheProvider::EXPIRATION] : WURFL_Cache_CacheProvider::NEVER; WURFL_FileUtils::mkdir($this->_cacheDir); } }
public function setUp() { WURFL_FileUtils::mkdir(self::storageDir()); }
public function setUp() { WURFL_FileUtils::mkdir($this->cacheDir()); }