<commit_before><?php
/**
 * This file contains the Naturskolan class that acts as a basic helper class for the Naturskolan-Database app
 */

namespace Fridde;

use Fridde\Entities\Group;
use Fridde\Entities\Hash;
use Fridde\Entities\Location;
use Fridde\Entities\Note;
use Fridde\Entities\School;
use Fridde\Entities\SystemStatus;
use Fridde\Entities\Topic;
use Fridde\Entities\User;
use Fridde\Entities\Visit;
use Fridde\Error\Error;
use Fridde\Error\NException;
use Fridde\Security\Authenticator;
use Fridde\Security\PasswordHandler as PWH;
use Fridde\Utility as U;
use Carbon\Carbon;
use dotzero\Googl;
use GuzzleHttp\Client;


/**
 * The basic class to assist most other classes in the Naturskolan-Database application
 */
class Naturskolan
{
    /** @var \Fridde\ORM A doctrine ORM wrapped in own class */
    public $ORM;
    /* @var \Doctrine\Common\Cache\Cache $cache  */
    public $cache;
    /** @var \GuzzleHttp\Client Contains an instance of GuzzleHttp\Client for HTTP requests */
    private $Client;
    /** @var \dotzero\Googl An instance of Googl to create short-links */
    private $Googl;
    /* @var \Fridde\Security\Authenticator $Auth */
    public $Auth;
    /** @var array A text array containing labels and other text bits */
    private $text_array;
    /** @var string the path for the text pieces */
    private $text_path = 'config/labels.yml';


    public const ADMIN_SCHOOL = 'natu';

    /**
     * Constructor
     *
     * Creates an instance of $ORM and $PasswordHandler
     */
    public function __construct()
    {
        $db_settings = self::getSetting('Connection_Details');
        $this->cache = $GLOBALS['CONTAINER']->get('Cache');
        $this->ORM = new ORM($db_settings, $this->cache, BASE_DIR . '/temp/proxy');
        $this->Auth = new Authenticator($this->ORM, new PWH());
        $this->ORM->EM->getEventManager()->addEventSubscriber(new EntitySubscriber($this->ORM));
    }

    /**
     * Wrapper for Naturskolan->ORM->getRepository()
     *
     * @param  string $repo The (non-qualified-) name of the class of entities<commit_msg>More work<commit_after><?php
/**
 * This file contains the Naturskolan class that acts as a basic helper class for the Naturskolan-Database app
 */

namespace Fridde;

use Fridde\Entities\Group;
use Fridde\Entities\Hash;
use Fridde\Entities\Location;
use Fridde\Entities\Note;
use Fridde\Entities\School;
use Fridde\Entities\SystemStatus;
use Fridde\Entities\Topic;
use Fridde\Entities\User;
use Fridde\Entities\Visit;
use Fridde\Error\Error;
use Fridde\Error\NException;
use Fridde\Security\Authenticator;
use Fridde\Security\PasswordHandler as PWH;
use Fridde\Utility as U;
use Carbon\Carbon;
use dotzero\Googl;
use GuzzleHttp\Client;


/**
 * The basic class to assist most other classes in the Naturskolan-Database application
 */
class Naturskolan
{
    /** @var \Fridde\ORM A doctrine ORM wrapped in own class */
    public $ORM;
    /* @var \Doctrine\Common\Cache\Cache $cache  */
    public $cache;
    /** @var \GuzzleHttp\Client Contains an instance of GuzzleHttp\Client for HTTP requests */
    private $Client;
    /** @var \dotzero\Googl An instance of Googl to create short-links */
    private $Googl;
    /* @var \Fridde\Security\Authenticator $Auth */
    public $Auth;
    /** @var array A text array containing labels and other text bits */
    private $text_array;
    /** @var string the path for the text pieces */
    private $text_path = 'config/labels.yml';


    public const ADMIN_SCHOOL = 'natu';

    /**
     * Constructor
     *
     * Creates an instance of $ORM and $PasswordHandler
     */
    public function __construct()
    {
        $db_settings = self::getSetting('Connection_Details');
        $this->cache = $GLOBALS['CONTAINER']->get('Cache');
        $this->ORM = new ORM($db_settings, $this->cache, BASE_DIR . '/temp/proxy');
        $this->Auth = new Authenticator($this->ORM, new PWH());
        $this->ORM->EM->getEventManager()->addEventSubscriber(new EntitySubscriber($this->ORM));
    }

    /**
     * Wrapper for Naturskolan->ORM->getRepository()
     *+
     * @param  string $repo The (non-qualified-) name of the class of entities
{'fraction_non_alphanumeric': 0.12239520958083833, 'fraction_numerical': 0.0, 'mean_word_length': 3.33195020746888, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, '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': '6301762', 'n_tokens_mistral': 1329, 'n_tokens_neox': 1319, 'n_words': 372}