Downloads

Download pathcache-6.x-1.4.tar.gztar.gz 9.59 KB
MD5: b6601076ca1e81a4184640d44e244249
SHA-1: e7aaa4d1d250516a3420de381aa1aca53675019b
SHA-256: 77eafd7ad57e0f322f6ff3b1d8a0c0207bdb53152410611bf895eaa76a1e2192
Download pathcache-6.x-1.4.zipzip 11 KB
MD5: 1c501de6c8fa6a58678541ebdc1e3089
SHA-1: cb7acf153d324fa55eda473e51afc637786f0765
SHA-256: ff04164e4b5e6185e2d27bd4186c72f6850241e387234eb2c5ef942c46c34c0a

Release notes

#791830 by drewish: only do requirements check for presence of URL aliases at runtime
#711920 by jlboht: enable static caching

This release adds two lines to path.inc. The lines are shown below in case you want to put them in manually instead of re-patching.


      // Not in the static variable. Try cache.
      $cid = $path . $path_language;
      $cache = cache_get($cid, 'cache_pathdst');
      if ($cache) {
+       $map[$path_language][$path] = $cache->data;
        return $cache->data;
      }
      // Get the most fitting result falling back with alias without language.      
      $alias = db_result(db_query("SELECT dst FROM {url_alias} WHERE src = '%s' AND language IN('%s', '') ORDER BY language DESC", $path, $path_language));
      // Store in static variable in case we encounter the same system path again
      // during this request.
      $map[$path_language][$path] = $alias;
      // Store in cache.
      cache_set($cid, $alias, 'cache_pathdst', time() + variable_get('pathcache_expire', 43200)); // 12 hours
      return $alias;
    }
    // When action is 'source' we are given a URL alias and need to return the
    // Drupal path.
    // Check $no_src for this $path in case we've already determined that there
    // isn't a path that has this alias.
    elseif ($action == 'source' && !isset($no_src[$path_language][$path])) {
      $src = '';
      // Look for the value $path within the cached $map.
      if (!isset($map[$path_language]) || !($src = array_search($path, $map[$path_language]))) {
        $cid = $path . $path_language;
        $cache = cache_get($cid, 'cache_pathsrc');
        if ($cache) {
+         $map[$path_language][$cache->data] = $path;
          return $cache->data;
        }
Created by: jvandyk
Created on: 18 Jul 2010 at 03:16 UTC
Last updated: 18 Jul 2010 at 03:50 UTC
Bug fixes

Other releases