本文整理汇总了PHP中upgrade_rename_old_backup_files_using_shortname函数的典型用法代码示例。如果您正苦于以下问题:PHP upgrade_rename_old_backup_files_using_shortname函数的具体用法?PHP upgrade_rename_old_backup_files_using_shortname怎么用?PHP upgrade_rename_old_backup_files_using_shortname使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了upgrade_rename_old_backup_files_using_shortname函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: xmldb_main_upgrade
//.........这里部分代码省略.........
upgrade_main_savepoint(true, 2012091700.0);
}
if ($oldversion < 2012092100.01) {
// Some folders still have a sortorder set, which is used for main files but is not
// supported by the folder resource. We reset the value here.
$sql = 'UPDATE {files} SET sortorder = ? WHERE component = ? AND filearea = ? AND sortorder <> ?';
$DB->execute($sql, array(0, 'mod_folder', 'content', 0));
// Main savepoint reached.
upgrade_main_savepoint(true, 2012092100.01);
}
if ($oldversion < 2012092600.0) {
// Define index idname (unique) to be added to tag
$table = new xmldb_table('tag');
$index = new xmldb_index('idname', XMLDB_INDEX_UNIQUE, array('id', 'name'));
// Conditionally launch add index idname
if (!$dbman->index_exists($table, $index)) {
$dbman->add_index($table, $index);
}
// Main savepoint reached
upgrade_main_savepoint(true, 2012092600.0);
}
if ($oldversion < 2012101500.01) {
// Find all orphaned blog associations that might exist.
$sql = "SELECT ba.id\n FROM {blog_association} ba\n LEFT JOIN {post} p\n ON p.id = ba.blogid\n WHERE p.id IS NULL";
$orphanedrecordids = $DB->get_records_sql($sql);
// Now delete these associations.
foreach ($orphanedrecordids as $orphanedrecord) {
$DB->delete_records('blog_association', array('id' => $orphanedrecord->id));
}
upgrade_main_savepoint(true, 2012101500.01);
}
if ($oldversion < 2012101800.02) {
// Renaming backups using previous file naming convention.
upgrade_rename_old_backup_files_using_shortname();
// Main savepoint reached.
upgrade_main_savepoint(true, 2012101800.02);
}
if ($oldversion < 2012103001.0) {
// create new event_subscriptions table
$table = new xmldb_table('event_subscriptions');
$table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);
$table->add_field('url', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null);
$table->add_field('courseid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');
$table->add_field('groupid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');
$table->add_field('userid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');
$table->add_field('pollinterval', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');
$table->add_field('lastupdated', XMLDB_TYPE_INTEGER, '10', null, null, null, null);
$table->add_field('name', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null);
$table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));
if (!$dbman->table_exists($table)) {
$dbman->create_table($table);
}
// Main savepoint reached
upgrade_main_savepoint(true, 2012103001.0);
}
if ($oldversion < 2012103002.0) {
// Add subscription field to the event table
$table = new xmldb_table('event');
$field = new xmldb_field('subscriptionid', XMLDB_TYPE_INTEGER, '10', null, null, null, null, 'timemodified');
// Conditionally launch add field subscriptionid
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}
upgrade_main_savepoint(true, 2012103002.0);
}
if ($oldversion < 2012103003.0) {
示例2: xmldb_main_upgrade
//.........这里部分代码省略.........
upgrade_main_savepoint(true, 2012091700.0);
}
if ($oldversion < 2012092100.01) {
// Some folders still have a sortorder set, which is used for main files but is not
// supported by the folder resource. We reset the value here.
$sql = 'UPDATE {files} SET sortorder = ? WHERE component = ? AND filearea = ? AND sortorder <> ?';
$DB->execute($sql, array(0, 'mod_folder', 'content', 0));
// Main savepoint reached.
upgrade_main_savepoint(true, 2012092100.01);
}
if ($oldversion < 2012092600.0) {
// Define index idname (unique) to be added to tag
$table = new xmldb_table('tag');
$index = new xmldb_index('idname', XMLDB_INDEX_UNIQUE, array('id', 'name'));
// Conditionally launch add index idname
if (!$dbman->index_exists($table, $index)) {
$dbman->add_index($table, $index);
}
// Main savepoint reached
upgrade_main_savepoint(true, 2012092600.0);
}
if ($oldversion < 2012101500.01) {
// Find all orphaned blog associations that might exist.
$sql = "SELECT ba.id\n FROM {blog_association} ba\n LEFT JOIN {post} p\n ON p.id = ba.blogid\n WHERE p.id IS NULL";
$orphanedrecordids = $DB->get_records_sql($sql);
// Now delete these associations.
foreach ($orphanedrecordids as $orphanedrecord) {
$DB->delete_records('blog_association', array('id' => $orphanedrecord->id));
}
upgrade_main_savepoint(true, 2012101500.01);
}
if ($oldversion < 2012101800.02) {
// Renaming backups using previous file naming convention.
upgrade_rename_old_backup_files_using_shortname();
// Main savepoint reached.
upgrade_main_savepoint(true, 2012101800.02);
}
if ($oldversion < 2012103001.0) {
// create new event_subscriptions table
$table = new xmldb_table('event_subscriptions');
$table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);
$table->add_field('url', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null);
$table->add_field('courseid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');
$table->add_field('groupid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');
$table->add_field('userid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');
$table->add_field('pollinterval', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');
$table->add_field('lastupdated', XMLDB_TYPE_INTEGER, '10', null, null, null, null);
$table->add_field('name', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null);
$table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));
if (!$dbman->table_exists($table)) {
$dbman->create_table($table);
}
// Main savepoint reached
upgrade_main_savepoint(true, 2012103001.0);
}
if ($oldversion < 2012103002.0) {
// Add subscription field to the event table
$table = new xmldb_table('event');
$field = new xmldb_field('subscriptionid', XMLDB_TYPE_INTEGER, '10', null, null, null, null, 'timemodified');
// Conditionally launch add field subscriptionid
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}
upgrade_main_savepoint(true, 2012103002.0);
}
if ($oldversion < 2012103003.0) {
示例3: xmldb_main_upgrade
//.........这里部分代码省略.........
upgrade_main_savepoint(true, 2012091700.0);
}
if ($oldversion < 2012092100.01) {
// Some folders still have a sortorder set, which is used for main files but is not
// supported by the folder resource. We reset the value here.
$sql = 'UPDATE {files} SET sortorder = ? WHERE component = ? AND filearea = ? AND sortorder <> ?';
$DB->execute($sql, array(0, 'mod_folder', 'content', 0));
// Main savepoint reached.
upgrade_main_savepoint(true, 2012092100.01);
}
if ($oldversion < 2012092600.0) {
// Define index idname (unique) to be added to tag
$table = new xmldb_table('tag');
$index = new xmldb_index('idname', XMLDB_INDEX_UNIQUE, array('id', 'name'));
// Conditionally launch add index idname
if (!$dbman->index_exists($table, $index)) {
$dbman->add_index($table, $index);
}
// Main savepoint reached
upgrade_main_savepoint(true, 2012092600.0);
}
if ($oldversion < 2012101500.01) {
// Find all orphaned blog associations that might exist.
$sql = "SELECT ba.id\n FROM {blog_association} ba\n LEFT JOIN {post} p\n ON p.id = ba.blogid\n WHERE p.id IS NULL";
$orphanedrecordids = $DB->get_records_sql($sql);
// Now delete these associations.
foreach ($orphanedrecordids as $orphanedrecord) {
$DB->delete_records('blog_association', array('id' => $orphanedrecord->id));
}
upgrade_main_savepoint(true, 2012101500.01);
}
if ($oldversion < 2012101800.02) {
// Renaming backups using previous file naming convention.
upgrade_rename_old_backup_files_using_shortname();
// Main savepoint reached.
upgrade_main_savepoint(true, 2012101800.02);
}
if ($oldversion < 2012103001.0) {
// create new event_subscriptions table
$table = new xmldb_table('event_subscriptions');
$table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);
$table->add_field('url', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null);
$table->add_field('courseid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');
$table->add_field('groupid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');
$table->add_field('userid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');
$table->add_field('pollinterval', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');
$table->add_field('lastupdated', XMLDB_TYPE_INTEGER, '10', null, null, null, null);
$table->add_field('name', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null);
$table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));
if (!$dbman->table_exists($table)) {
$dbman->create_table($table);
}
// Main savepoint reached
upgrade_main_savepoint(true, 2012103001.0);
}
if ($oldversion < 2012103002.0) {
// Add subscription field to the event table
$table = new xmldb_table('event');
$field = new xmldb_field('subscriptionid', XMLDB_TYPE_INTEGER, '10', null, null, null, null, 'timemodified');
// Conditionally launch add field subscriptionid
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}
upgrade_main_savepoint(true, 2012103002.0);
}
if ($oldversion < 2012103003.0) {