/[drupal]/contributions/modules/bitcache/bitcache.install
ViewVC logotype

Diff of /contributions/modules/bitcache/bitcache.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.10, Tue May 19 15:27:22 2009 UTC revision 1.11, Wed Jul 1 04:09:48 2009 UTC
# Line 341  function bitcache_update_6006() { Line 341  function bitcache_update_6006() {
341    return $updates;    return $updates;
342  }  }
343    
344    /**
345     * Rewrites the existing file system paths to use tokens.
346     *
347     * @since 6.x-1.0-beta3
348     */
349    function bitcache_update_6007() {
350      $updates = array();
351      $result = db_query("SELECT name, options FROM {bitcache_repositories} WHERE adapter = 'file' ORDER BY enabled, name");
352      while ($row = db_fetch_object($result)) {
353        $row->options = unserialize($row->options);
354        $row->options['location'] = preg_replace('!^' . preg_quote(file_directory_path()) . '$!', '[file-directory-path]', $row->options['location']);
355        $row->options['location'] = preg_replace('!^' . preg_quote(file_directory_path()) . '/!', '[file-directory-path]/', $row->options['location']);
356        $row->options = serialize($row->options);
357        $updates[] = bitcache_update_sql("UPDATE {bitcache_repositories} SET options = '%s' WHERE name = '%s'", $row->options, $row->name);
358      }
359      return $updates;
360    }
361    
362  //////////////////////////////////////////////////////////////////////////////  //////////////////////////////////////////////////////////////////////////////
363  // Database API helpers  // Database API helpers
364    

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

  ViewVC Help
Powered by ViewVC 1.1.2