本文整理汇总了PHP中DatabaseHandler::getDriver方法的典型用法代码示例。如果您正苦于以下问题:PHP DatabaseHandler::getDriver方法的具体用法?PHP DatabaseHandler::getDriver怎么用?PHP DatabaseHandler::getDriver使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DatabaseHandler
的用法示例。
在下文中一共展示了DatabaseHandler::getDriver方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: importDataFromDumpFile
function importDataFromDumpFile($sid, DatabaseHandler $dbHandler, $userId, $filePath, $my_pligg_base_no_slash)
{
$ktrExeDao = new KTRExecutorDAO();
$tableNames = $dbHandler->loadTables();
$logIds = array();
foreach ($tableNames as $tableName) {
$logIds[$tableName] = $ktrExeDao->addExecutionInfoTuple($sid, $tableName, $userId);
}
try {
$dbImporter = DatabaseImporterFactory::createDatabaseImporter($dbHandler->getDriver(), $sid, $my_pligg_base_no_slash);
$dbImporter->importDbData($filePath);
foreach ($logIds as $logId) {
$ktrExeDao->updateExecutionInfoStatus($logId, 'success');
}
} catch (Exception $e) {
foreach ($logIds as $logId) {
$ktrExeDao->updateExecutionInfoStatus($logId, 'error');
$ktrExeDao->updateExecutionInfoErrorMessage($logId, $e->getMessage());
}
}
$queryEngine = new QueryEngine();
foreach ($logIds as $tableName => $logId) {
$numProcessed = $queryEngine->GetTotalNumberTuplesInTableBySidAndNameFromExternalDB($sid, $tableName);
$ktrExeDao->updateExecutionInfoTupleAfterPanTerminated($logId, 0, '', $numProcessed, 'success');
}
}
示例2: importDataFromDumpFile
function importDataFromDumpFile($sid, DatabaseHandler $dbHandler, $userId, $filePath)
{
$ktrExeDao = new KTRExecutorDAO();
$tables = $dbHandler->loadTables();
$logIds = array();
foreach ($tables as $table) {
$logIds[] = $ktrExeDao->addExecutionInfoTuple($sid, $table, $userId);
}
try {
$dbImporter = DatabaseImporterFactory::createDatabaseImporter($dbHandler->getDriver(), $sid, "colfusion");
$dbImporter->importDbData($filePath);
foreach ($logIds as $logId) {
$ktrExeDao->updateExecutionInfoTimeEnd($logId);
$ktrExeDao->updateExecutionInfoStatus($logId, 'success');
}
} catch (Exception $e) {
foreach ($logIds as $logId) {
$ktrExeDao->updateExecutionInfoStatus($logId, 'error');
$ktrExeDao->updateExecutionInfoErrorMessage($logId, $e->getMessage());
}
}
}