本文整理匯總了PHP中ImpExData::is_valid方法的典型用法代碼示例。如果您正苦於以下問題:PHP ImpExData::is_valid方法的具體用法?PHP ImpExData::is_valid怎麽用?PHP ImpExData::is_valid使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ImpExData
的用法示例。
在下文中一共展示了ImpExData::is_valid方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: resume
function resume(&$sessionobject, &$displayobject, &$Db_target, &$Db_source)
{
// Setup some working variables
$displayobject->update_basic('displaymodules', 'FALSE');
$target_db_type = $sessionobject->get_session_var('targetdatabasetype');
$target_table_prefix = $sessionobject->get_session_var('targettableprefix');
$source_db_type = $sessionobject->get_session_var('sourcedatabasetype');
$source_table_prefix = $sessionobject->get_session_var('sourcetableprefix');
$class_num = substr(get_class($this), -3);
$databasedone = true;
if (!$sessionobject->get_session_var($class_num . '_start')) {
$sessionobject->timing($class_num, 'start', $sessionobject->get_session_var('autosubmit'));
}
$displayobject->update_basic('title', 'Modifying database');
$displayobject->display_now("<h4>Altering tables</h4>");
$displayobject->display_now("<p>ImpEx will now Alter the tables in the vB database to include <i>import id numbers</i>.</p>");
$displayobject->display_now("This is needed during the import process for maintaining refrences between the tables during an import.");
$displayobject->display_now("If you have large tables (i.e. lots of posts) this can take some time.</p>");
$displayobject->display_now("<p> They will also be left after the import if you need to link back to the origional vB userid.</p>");
// Add an importids now
foreach ($this->_import_ids as $id => $table_array) {
foreach ($table_array as $tablename => $column) {
if ($this->add_import_id($Db_target, $target_db_type, $target_table_prefix, $tablename, $column)) {
$displayobject->display_now("\n<br /><b>{$tablename}</b> - {$column} <i>OK</i>");
} else {
$sessionobject->add_error('fatal', $this->_modulestring, get_class($this) . "::resume failed trying to modify table {$tablename} to add {$column}", 'Check database permissions');
}
}
}
// Add the importpostid for the attachment imports and the users for good measure
$this->add_index($Db_target, $target_db_type, $target_table_prefix, 'post');
$this->add_index($Db_target, $target_db_type, $target_table_prefix, 'user');
// Default import group
if ($sessionobject->get_session_var('added_default_group') != 'yup') {
$try = new ImpExData($Db_target, $sessionobject, 'usergroup');
$try->set_value('mandatory', 'importusergroupid', '69');
$try->set_value('nonmandatory', 'title', 'Imported users with no group');
$try->is_valid();
$try->import_usergroup($Db_target, $target_db_type, $target_table_prefix);
$sessionobject->add_session_var('added_default_group', 'yup');
unset($try);
}
// Check the database connection
$result = $this->check_database($Db_source, $source_db_type, $source_table_prefix, $sessionobject->get_session_var('sourceexists'));
$displayobject->display_now($result['text']);
if ($result['code']) {
$sessionobject->timing($class_num, 'stop', $sessionobject->get_session_var('autosubmit'));
$sessionobject->remove_session_var($class_num . '_start');
$displayobject->update_html($displayobject->module_finished($this->_modulestring, $sessionobject->return_stats($class_num, '_time_taken'), $sessionobject->return_stats($class_num, '_objects_done'), $sessionobject->return_stats($class_num, '_objects_failed')));
$sessionobject->add_session_var($class_num . '_objects_done', intval($sessionobject->get_session_var($class_num . '_objects_done')) + 1);
$sessionobject->set_session_var(substr(get_class($this), -3), 'FINISHED');
$sessionobject->set_session_var('module', '000');
$displayobject->update_basic('displaymodules', 'FALSE');
$displayobject->update_html($displayobject->print_redirect_001('index.php', $sessionobject->get_session_var('pagespeed')));
} else {
$sessionobject->add_session_var($class_num . '_objects_failed', intval($sessionobject->get_session_var($class_num . '_objects_failed')) + 1);
$displayobject->update_html($displayobject->make_description("{$displayobject->phrases['failed']} {$displayobject->phrases['check_db_permissions']}"));
$sessionobject->set_session_var('001', 'FAILED');
$sessionobject->set_session_var('module', '000');
$displayobject->update_html($displayobject->print_redirect_001('index.php', $sessionobject->get_session_var('pagespeed')));
}
}