<commit_before><?php
namespace Concrete\Core\Config;

use Concrete\Core\Database\Driver\PDOStatement;

class DatabaseLoader implements LoaderInterface
{

    /**
     * Load the given configuration group. Because it's the database, we ignore the environment.
     *
     * @param  string $environment
     * @param  string $group
     * @param  string $namespace
     * @return array
     */
    public function load($environment, $group, $namespace = null)
    {
        $result = array();

        $db = \Database::getActiveConnection();
        $query = $db->createQueryBuilder();

        $query
            ->select('configValue', 'configItem')
            ->from('Config', 'c')
            ->where('configGroup = ?')
            ->setParameter(0, $group);

        if ($namespace) {<commit_msg>Fix database loader and tests<commit_after><?php
namespace Concrete\Core\Config;

use Concrete\Core\Database\Driver\PDOStatement;
use Database;

class DatabaseLoader implements LoaderInterface
{

    /**
     * Load the given configuration group. Because it's the database, we ignore the environment.
     *
     * @param  string $environment
     * @param  string $group
     * @param  string $namespace
     * @return array
     */
    public function load($environment, $group, $namespace = null)
    {
        $result = array();

        $db = Database::getActiveConnection();
        $query = $db->createQueryBuilder();

        $query
            ->select('configValue', 'configItem')
            ->from('Config', 'c')
            ->where('configGroup = ?')
            ->setParameter(0, $group);

        if ($namespace) {
{'fraction_non_alphanumeric': 0.12768569674647023, 'fraction_numerical': 0.0012277470841006752, 'mean_word_length': 2.482905982905983, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '6334213', 'n_tokens_mistral': 440, 'n_tokens_neox': 431, 'n_words': 116}