Lines Matching refs:this

11  * copy of this software and associated documentation files (the "Software"),
17 * The above copyright notice and this permission notice shall be included
127 * The cache has to be rebuilt in order to apply this option.
187 * Proxy settings are stored in this variable.
233 $this->cacheFilename = basename($cache_dir);
234 $this->cacheDir = dirname($cache_dir);
236 $this->cacheDir = $cache_dir;
239 $this->cacheDir .= DIRECTORY_SEPARATOR;
244 return $this->_source_version;
261 if (!$this->_cacheLoaded) {
262 $cache_file = $this->cacheDir . $this->cacheFilename;
263 $ini_file = $this->cacheDir . $this->iniFilename;
266 if ($this->doAutoUpdate && file_exists($ini_file)) {
274 if (file_exists($cache_file) && file_exists($ini_file) && ($interval <= $this->updateInterval))
276 if ($this->_loadCache($cache_file))
284 $this->updateCache();
288 touch($ini_file, time() - $this->updateInterval + $this->errorInterval);
289 } elseif ($this->silent) {
294 if (!$this->silent) {
299 if (!$this->_loadCache($cache_file))
301 throw new Exception("Cannot load this cache version - the cache format is not compatible.");
317 foreach ($this->_patterns as $pattern => $pattern_data) {
345 $this->_pregUnQuote($pattern, $simple_match ? false : $matches)
348 $browser = $value = $browser + unserialize($this->_browsers[$key]);
351 $value = unserialize($this->_browsers[$value[3]]);
356 $browser[3] = $this->_userAgents[$browser[3]];
371 $array[$this->_properties[$key]] = $value;
392 $this->addProxySettings($params['host'], $params['port'], $wrapper, $params['user'], $params['pass']);
421 $this->_streamContextOptions = array_merge(
422 $this->_streamContextOptions,
426 /* Return $this so we can chain addProxySettings() calls like this:
432 return $this;
438 * @param string $wrapper Remove settings from this wrapper only
444 $wrappers = isset($wrapper) ? array($wrapper) : array_keys($this->_streamContextOptions);
451 if (isset($this->_streamContextOptions[$wrapper]['proxy'])) {
453 unset($this->_streamContextOptions[$wrapper][$option]);
457 if (empty($this->_streamContextOptions[$wrapper])) {
458 unset($this->_streamContextOptions[$wrapper]);
475 return $this->_streamContextOptions;
487 $ini_path = $this->cacheDir . $this->iniFilename;
488 $cache_path = $this->cacheDir . $this->cacheFilename;
491 if ($this->_getUpdateMethod() == self::UPDATE_LOCAL) {
492 $url = $this->localFile;
494 $url = $this->remoteIniUrl;
497 $this->_getRemoteIniFile($url, $ini_path);
505 $this->_source_version = $browsers[self::BROWSCAP_VERSION_KEY]['Version'];
510 $this->_properties = array_keys($browsers['DefaultProperties']);
513 $this->_properties,
523 usort($tmp_user_agents, array($this, 'compareBcStrings'));
526 $properties_keys = array_flip($this->_properties);
534 $pattern = $this->_pregQuote($user_agent);
555 $this->_userAgents[$parent_key . '.0'] = $tmp_user_agents[$parent_key];
570 $this->_browsers[] = $browser;
575 $this->_patterns[$pattern] = $pattern_data;
578 $this->_patterns[$pattern_data['first']] = key($pattern_data);
582 $pattern_data = $this->deduplicateCompressionPattern($pattern_data, $pattern);
584 $this->_patterns[$pattern] = $pattern_data;
589 if ($this->lowercase) {
590 $this->_properties = array_map('strtolower', $this->_properties);
594 $cache = $this->_buildCache();
729 $this->_source_version = $source_version;
730 $this->_browsers = $browsers;
731 $this->_userAgents = $userAgents;
732 $this->_patterns = $patterns;
733 $this->_properties = $properties;
735 $this->_cacheLoaded = true;
749 $propertiesArray = $this->_array2string($this->_properties);
750 $patternsArray = $this->_array2string($this->_patterns);
751 $userAgentsArray = $this->_array2string($this->_userAgents);
752 $browsersArray = $this->_array2string($this->_browsers);
756 "'" . $this->_source_version . "'",
774 if (!isset($this->_streamContext) || true === $recreate) {
775 $this->_streamContext = stream_context_create($this->_streamContextOptions);
778 return $this->_streamContext;
796 if ($this->_getUpdateMethod() == self::UPDATE_LOCAL) {
797 $remote_tmstp = $this->_getLocalMTime();
799 $remote_tmstp = $this->_getRemoteMTime();
811 $browscap = $this->_getRemoteData($url);
847 $remote_datetime = $this->_getRemoteData($this->remoteVerUrl);
851 throw new Exception("Bad datetime format from {$this->remoteVerUrl}");
865 if (!is_readable($this->localFile) || !is_file($this->localFile)) {
869 return filemtime($this->localFile);
917 if ($this->updateMethod === null) {
918 if ($this->localFile !== null) {
919 $this->updateMethod = self::UPDATE_LOCAL;
921 $this->updateMethod = self::UPDATE_FOPEN;
923 $this->updateMethod = self::UPDATE_FSOCKOPEN;
925 $this->updateMethod = self::UPDATE_CURL;
927 $this->updateMethod = false;
931 return $this->updateMethod;
943 ini_set('user_agent', $this->_getUserAgent());
945 switch ($this->_getUpdateMethod()) {
956 $context = $this->_getStreamContext();
964 $remote_handler = fsockopen($remote_url['host'], 80, $c, $e, $this->timeout);
967 stream_set_timeout($remote_handler, $this->timeout);
977 $this->_getUserAgent()
1004 curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $this->timeout);
1005 curl_setopt($ch, CURLOPT_USERAGENT, $this->_getUserAgent());
1029 $ua = str_replace('%v', self::VERSION, $this->userAgent);
1030 $ua = str_replace('%m', $this->_getUpdateMethod(), $ua);