<commit_before><?php

/**
 * Class Storage
 *
 * Manages connection to MongoDB
 * 
 * @author <NAME> <<EMAIL>>
 * 
 * @package MongoAppKit
 */

namespace MongoAppKit;

use MongoAppKit\Config;

class Storage {

    /**
     * Mongo object
     * @var Mongo
     */

    protected $_oMongo = null;

    /**
     * MongoDB object
     * @var MongoDB
     */

    protected $_oDatabase = null;

    /**
     * Sets up MongoDB connection and selects the given database
     *
     * @param Config
     */

    public function __construct(Config $oConfig) {
        $sMongoServer = $oConfig->getProperty('MongoServer');
        $iMongoPort = $oConfig->getProperty('MongoPort');
        $sMongoUser = $oConfig->getProperty('MongoUser');
        $sMongoPassword = $oConfig->getProperty('MongoPassword');

        $sMongoIdentification = (!empty($sMongoUser) && !empty($sMongoPassword)) ? "{$sMongoUser}:{$sMongoPassword}@" : '';

        $sHost = "mongodb://{$sMongoIdentification}{$sMongoServer}:{$iMongoPort}";
        $this->_oMongo = new \Mongo($sHost);

        $this->_oDatabase = $this->_oMongo->selectDB($oConfig->getProperty('MongoDatabase'));      
    }

    /**
     * Closes MongoDB connection if the object is destroyed
     */

    public function __destruct() {
        $this->_oMongo->close();
    }

    /**
     * Returns MongoDB object of selected Database
     *
     * @return MongoDB
     */

    public function getDatabase() {
        return $this->_oDatabase;
    }
}<commit_msg>removed hungarian notation<commit_after><?php

/**
 * Class Storage
 *
 * Manages connection to MongoDB
 * 
 * @author <NAME> <<EMAIL>>
 * 
 * @package MongoAppKit
 */

namespace MongoAppKit;

use MongoAppKit\Config;

class Storage {

    /**
     * Mongo object
     * @var Mongo
     */

    protected $_mongo = null;

    /**
     * MongoDB object
     * @var MongoDB
     */

    protected $_database = null;

    /**
     * Sets up MongoDB connection and selects the given database
     *
     * @param Config
     */

    public function __construct(Config $config) {
        $mongoServer = $config->getProperty('MongoServer');
        $mongoPort = $config->getProperty('MongoPort');
        $mongoUser = $config->getProperty('MongoUser');
        $mongoPassword = $config->getProperty('MongoPassword');

        $mongoIdentification = (!empty($mongoUser) && !empty($mongoPassword)) ? "{$mongoUser}:{$mongoPassword}@" : '';

        $host = "mongodb://{$mongoIdentification}{$mongoServer}:{$mongoPort}";
        $this->_mongo = new \Mongo($host);

        $this->_database = $this->_mongo->selectDB($config->getProperty('MongoDatabase'));
    }

    /**
     * Closes MongoDB connection if the object is destroyed
     */

    public function __destruct() {
        $this->_mongo->close();
    }

    /**
     * Returns MongoDB object of selected Database
     *
     * @return MongoDB
     */

    public function getDatabase() {
        return $this->_database;
    }
}
{'fraction_non_alphanumeric': 0.1452589105581708, 'fraction_numerical': 0.0, 'mean_word_length': 2.5973397823458284, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 33, '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': '4411485', 'n_tokens_mistral': 936, 'n_tokens_neox': 885, 'n_words': 184}