function path_redirect_update_2 in Path redirect 5
Same name and namespace in other branches
- 6 path_redirect.install \path_redirect_update_2()
Convert the type column to an integer to only store the status code.
File
- ./
path_redirect.install, line 81 - Install and uninstall schema and functions for the path_redirect module.
Code
function path_redirect_update_2() {
$ret = array();
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
$ret[] = update_sql("UPDATE {path_redirect} SET type = '300' WHERE type = 'HTTP/1.0 300 Multiple Choices'");
$ret[] = update_sql("UPDATE {path_redirect} SET type = '301' WHERE type = 'HTTP/1.0 301 Moved Permanently'");
$ret[] = update_sql("UPDATE {path_redirect} SET type = '302' WHERE type = 'HTTP/1.0 302 Found'");
$ret[] = update_sql("UPDATE {path_redirect} SET type = '303' WHERE type = 'HTTP/1.0 303 See Other'");
$ret[] = update_sql("UPDATE {path_redirect} SET type = '304' WHERE type = 'HTTP/1.0 304 Not Modified'");
$ret[] = update_sql("UPDATE {path_redirect} SET type = '305' WHERE type = 'HTTP/1.0 305 Use Proxy'");
$ret[] = update_sql("UPDATE {path_redirect} SET type = '307' WHERE type = 'HTTP/1.0 307 Temporary Redirect'");
$ret[] = update_sql("ALTER TABLE {path_redirect} MODIFY type int(10) NOT NULL");
break;
}
return $ret;
}