<commit_before><?php

namespace Bl2\Util;

use Doctrine\Common\Annotations\AnnotationRegistry;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Tools\Setup;

/**
 * Class providing access to a shared singleton instance of an {@link EntityManager}.
 */
final class EntityManagerFactory {

    /**
     * @var EntityManager
     */
    private static $entityManager;

    /**
     * private constructor to avoid instantiation of factory class.
     */
    private function __construct() {
    }

    public static function getEntityManager() {
        if (!isset(self::$entityManager)) {
            self::initEntityManager();
        }

        return self::$entityManager;
    }

    private static function initEntityManager() {
        // Create a simple "default" Doctrine ORM configuration for Annotations
        $isDevMode = true;
        $config = Setup::createAnnotationMetadataConfiguration(array(__DIR__ . "/src/Model"), $isDevMode, null, null,
            false);
//        $config = Setup::createAnnotationMetadataConfiguration(array("/opt/lampp/htdocs/bl2items-backend/src/Model"), $isDevMode, null, null,
//            false);
        AnnotationRegistry::registerAutoloadNamespace('JMS\Serializer\Annotation',
            __DIR__ . "/../../vendor/jms/serializer/src");

        // the connection configuration
        $conn = array(
            'driver' => DB_DRIVER,
            'user' => DB_USER,
            'password' => <PASSWORD>,
            'dbname' => DB_NAME<commit_msg>use relative path for doctrine entities<commit_after><?php

namespace Bl2\Util;

use Doctrine\Common\Annotations\AnnotationRegistry;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Tools\Setup;

/**
 * Class providing access to a shared singleton instance of an {@link EntityManager}.
 */
final class EntityManagerFactory {

    /**
     * @var EntityManager
     */
    private static $entityManager;

    /**
     * private constructor to avoid instantiation of factory class.
     */
    private function __construct() {
    }

    public static function getEntityManager() {
        if (!isset(self::$entityManager)) {
            self::initEntityManager();
        }

        return self::$entityManager;
    }

    private static function initEntityManager() {
        // Create a simple "default" Doctrine ORM configuration for Annotations
        $isDevMode = true;
        $config = Setup::createAnnotationMetadataConfiguration(array("../Model"), $isDevMode, null, null,
            false);
//        $config = Setup::createAnnotationMetadataConfiguration(array("/opt/lampp/htdocs/bl2items-backend/src/Model"), $isDevMode, null, null,
//            false);
        AnnotationRegistry::registerAutoloadNamespace('JMS\Serializer\Annotation',
            __DIR__ . "/../../vendor/jms/serializer/src");

        // the connection configuration
        $conn = array(
            'driver' => DB_DRIVER,
            'user' => DB_USER,
            'password' => <PASSWORD>,
            'dbname' => DB_NAME
{'fraction_non_alphanumeric': 0.11792138574283811, 'fraction_numerical': 0.0013324450366422385, 'mean_word_length': 2.6621951219512194, 'pattern_counts': {'":': 0, '<': 7, '<?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': '3202610', 'n_tokens_mistral': 785, 'n_tokens_neox': 774, 'n_words': 189}