| 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 |
|
|