本文整理汇总了PHP中XMLDBTable::findFieldInArray方法的典型用法代码示例。如果您正苦于以下问题:PHP XMLDBTable::findFieldInArray方法的具体用法?PHP XMLDBTable::findFieldInArray怎么用?PHP XMLDBTable::findFieldInArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XMLDBTable
的用法示例。
在下文中一共展示了XMLDBTable::findFieldInArray方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: xmldb_wiki_upgrade
//.........这里部分代码省略.........
$field = new XMLDBField('evaluation');
$field->setAttributes(XMLDB_TYPE_TEXT, 'medium', null, XMLDB_NOTNULL, null, null, null, '', 'groupid');
$result = add_field($table, $field);
// OLD SENTENCES
// execute_sql('ALTER TABLE `'.$CFG->prefix.'wiki` ADD `studentmode` tinyint(1) NOT NULL default 0');
// execute_sql('ALTER TABLE `'.$CFG->prefix.'wiki` ADD `teacherdiscussion` int(1) NOT NULL default 0');
// execute_sql('ALTER TABLE `'.$CFG->prefix.'wiki` ADD `studentdiscussion` int(1) NOT NULL default 0');
// execute_sql('ALTER TABLE `'.$CFG->prefix.'wiki` ADD `editanothergroup` tinyint(1) not null default 0');
// execute_sql('ALTER TABLE `'.$CFG->prefix.'wiki` ADD `editanotherstudent` tinyint(1) not null default 0');
//
// execute_sql('ALTER TABLE `'.$CFG->prefix.'wiki_pages` ADD `evaluation` MEDIUMTEXT default NULL AFTER `groupid`');
} else {
$table = new XMLDBTable('wiki_pages');
$field = new XMLDBField('evaluation');
$field->setAttributes(XMLDB_TYPE_TEXT, 'medium', null, null, null, null, null, '', 'ownerid');
$result = add_field($table, $field);
// OLD SENTENCE
// execute_sql('ALTER TABLE `'.$CFG->prefix.'wiki_pages` ADD `evaluation` MEDIUMTEXT default NULL AFTER `ownerid`');
}
$table = new XMLDBTable('wiki');
$field = new XMLDBField('evaluation');
$field->setAttributes(XMLDB_TYPE_CHAR, '40', null, null, null, null, null, 'noeval', 'studentdiscussion');
$result = $result && add_field($table, $field);
$field = new XMLDBField('notetype');
$field->setAttributes(XMLDB_TYPE_CHAR, '40', null, null, null, null, null, 'quant', 'evaluation');
$result = $result && add_field($table, $field);
// OLD SENTECES
// execute_sql('ALTER TABLE `'.$CFG->prefix.'wiki` ADD `evaluation` varchar(40) default "noeval" AFTER `studentdiscussion`');
// execute_sql('ALTER TABLE `'.$CFG->prefix.'wiki` ADD `notetype` varchar(40) default "quant" AFTER `evaluation`');
}
if ($result && $oldversion < 2006060702 && empty($fromoldwiki)) {
//make sure we don't have ownerid in the DB (backward compatibility)
$table = new XMLDBTable('wiki_pages');
$field = $table->findFieldInArray('ownerid');
if (empty($field)) {
$field = new XMLDBField('ownerid');
$field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'groupid');
$result = add_field($table, $field);
$key = new XMLDBKey('wiki_pages_uk');
$key->setAttributes(XMLDB_KEY_UNIQUE, array('pagename', 'version', 'dfwiki', 'groupid', 'userid'));
$result = $result && drop_key($table, $key);
$key = new XMLDBKey('wiki_pages_uk');
$key->setAttributes(XMLDB_KEY_UNIQUE, array('pagename', 'version', 'dfwiki', 'groupid', 'userid', 'ownerid'));
$result = $result && add_key($table, $key);
$table = new XMLDBTable('wiki_synonymous');
$field = new XMLDBField('userid');
$result = $result && drop_field($table, $field);
$field = new XMLDBField('ownerid');
$field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', null);
$result = $result && add_field($table, $field);
$key = new XMLDBKey('wiki_synonymous_uk');
$result = $result && drop_key($table, $key);
$key = new XMLDBKey('wiki_synonymous_uk');
$key->setAttributes(XMLDB_KEY_UNIQUE, array('syn', 'dfwiki', 'groupid', 'ownerid'));
$result = $result && add_key($table, $key);
// OLD SENTENCES
// //make sure we don't have ownerid in the DB (backward compatibility)
// if(!get_records_sql('SELECT ownerid FROM '.$CFG->prefix.'wiki_pages LIMIT 0 , 30')){
// //adding new ownerid replacing userid
//- execute_sql('ALTER TABLE `'.$CFG->prefix.'wiki_pages` ADD `ownerid` int(10) unsigned not null default 0 AFTER `groupid`');
//- execute_sql(" ALTER TABLE {$CFG->prefix}wiki_synonymous DROP userid;",false);
//- execute_sql('ALTER TABLE `'.$CFG->prefix.'wiki_synonymous` ADD `ownerid` int(10) unsigned not null default 0');
//
//- execute_sql(" ALTER TABLE {$CFG->prefix}wiki_pages DROP KEY wiki_pages_uk;",false);
//- execute_sql(" ALTER TABLE {$CFG->prefix}wiki_pages ADD UNIQUE KEY wiki_pages_uk (pagename, version, dfwiki, groupid, userid, ownerid);",false);
//