当前位置: 首页>>代码示例>>PHP>>正文


PHP DatabaseHandler::loadTables方法代码示例

本文整理汇总了PHP中DatabaseHandler::loadTables方法的典型用法代码示例。如果您正苦于以下问题:PHP DatabaseHandler::loadTables方法的具体用法?PHP DatabaseHandler::loadTables怎么用?PHP DatabaseHandler::loadTables使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DatabaseHandler的用法示例。


在下文中一共展示了DatabaseHandler::loadTables方法的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');
    }
}
开发者ID:Grprashanthkumar,项目名称:ColfusionWeb,代码行数:26,代码来源:import_dump_parallel.php

示例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());
        }
    }
}
开发者ID:Grprashanthkumar,项目名称:ColfusionWeb,代码行数:22,代码来源:wizardFromDBController.php


注:本文中的DatabaseHandler::loadTables方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。