Code Duplication    Length = 9-11 lines in 2 locations

src/Intraface/Factory.php 1 location

@@ 39-47 (lines=9) @@
36
            throw new Exception($res->getUserInfo());
37
        }
38
39
        if ($db->getOption('debug')) {
40
            $db->setOption('log_line_break', "\n\n\n\n\t");
41
42
            $my_debug_handler = new MDB2_Debug_ExplainQueries($db);
43
            $db->setOption('debug_handler', array($my_debug_handler, 'collectInfo'));
44
45
            register_shutdown_function(array($my_debug_handler, 'executeAndExplain'));
46
            register_shutdown_function(array($my_debug_handler, 'dumpInfo'));
47
        }
48
49
        return $db;
50
    }

tests/unit/bootstrap.php 1 location

@@ 39-49 (lines=11) @@
36
$db->setOption('debug', 0);
37
$db->setOption('portability', MDB2_PORTABILITY_NONE);
38
39
if ($db->getOption('debug')) {
40
    $db->setOption('log_line_break', "\n\n\n\n\t");
41
42
    require_once 'MDB2/Debug/ExplainQueries.php';
43
44
    $my_debug_handler = new MDB2_Debug_ExplainQueries($db);
45
    $db->setOption('debug_handler', array($my_debug_handler, 'collectInfo'));
46
47
    register_shutdown_function(array($my_debug_handler, 'executeAndExplain'));
48
    register_shutdown_function(array($my_debug_handler, 'dumpInfo'));
49
}
50
51
Doctrine_Manager::getInstance()->setAttribute("use_dql_callbacks", true);
52
Doctrine_Manager::getInstance()->setAttribute(Doctrine::ATTR_VALIDATE, Doctrine::VALIDATE_TYPES | Doctrine::VALIDATE_CONSTRAINTS);