Change to:

if (defined('PARTNER_FLAG')) {
    $dbText .= "  define ('PARTNER_FLAG', PARTNER_FLAG);\n";
}