<commit_before><?php
/**This is included from unit tests to skip the test if DB is not available.
*
* LICENSE:
* This source file is subject to version 2.1 of the LGPL
* that is bundled with this package in the file LICENSE.
*
* COPYRIGHT:
* Empowered Media
* http://www.empoweredmedia.com
* 481 Eighth Avenue Suite 1530
* New York, NY 10001
*
* @copyright Empowered Media 2006
* @license http://www.gnu.org/copyleft/lesser.html  LGPL Version 2.1
* @author <NAME> <<EMAIL>>
* @package XML_Query2XML
* @version $Id$
*/

if (!@include_once 'DB.php') {
    print 'skip could not find DB.php';
    exit;
} else {
    require_once dirname(dirname(__FILE__)) . '/settings.php';
    $db = @DB::connect(DSN);
    if (PEAR::isError($db)) {
        print 'skip could not connect using DSN ' . DSN;
        exit;
    }
}
?><commit_msg>skip tests for DB if sqlite is used - DB cannot handle table.column format returned by sqlite<commit_after><?php
/**This is included from unit tests to skip the test if DB is not available.
*
* LICENSE:
* This source file is subject to version 2.1 of the LGPL
* that is bundled with this package in the file LICENSE.
*
* COPYRIGHT:
* Empowered Media
* http://www.empoweredmedia.com
* 481 Eighth Avenue Suite 1530
* New York, NY 10001
*
* @copyright Empowered Media 2006
* @license http://www.gnu.org/copyleft/lesser.html  LGPL Version 2.1
* @author <NAME> <<EMAIL>>
* @package XML_Query2XML
* @version $Id$
*/

require_once dirname(dirname(__FILE__)) . '/settings.php';
if (!@include_once 'DB.php') {
    print 'skip could not find DB.php';
    exit;
} elseif (strpos(DSN, 'sqlite:') === 0) {
    print 'skip PEAR DB does not remove table part of "table.column" format returned by sqlite driver';
    exit;
} else {
    $db = @DB::connect(DSN);
    if (PEAR::isError($db)) {
        print 'skip could not connect using DSN ' . DSN;
        exit;
    }
}
?>
{'fraction_non_alphanumeric': 0.1276595744680851, 'fraction_numerical': 0.022872340425531913, 'mean_word_length': 3.4785714285714286, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2956511', 'n_tokens_mistral': 656, 'n_tokens_neox': 614, 'n_words': 225}