<commit_before><?php

namespace ChurchCRM\Service;

use ChurchCRM\dto\SystemConfig;
use ChurchCRM\dto\SystemURLs;
use ChurchCRM\FileSystemUtils;
use ChurchCRM\SQLUtils;
use Exception;
use Github\Client;
use Ifsnop\Mysqldump\Mysqldump;
use PharData;
use Propel\Runtime\Propel;
use PDO;
use ChurchCRM\Utils\InputUtils;

require SystemURLs::getDocumentRoot() . '/vendor/ifsnop/mysqldump-php/src/Ifsnop/Mysqldump/Mysqldump.php';


class SystemService
{
    public function getLatestRelease()
    {
        $client = new Client();
        $release = null;
        try {
            $release = $client->api('repo')->releases()->latest('churchcrm', 'crm');
        } catch (\Exception $e) {
        }

        return $release;
    }

    static public function getInstalledVersion()
    {
        $composerFile = file_get_contents(SystemURLs::getDocumentRoot() . '/composer.json');
        $composerJson = json_decode($composerFile, true);
        $version = $composerJson['version'];

        return $version;
    }
    
    static public function getCopyrightDate()
    {
        $composerFile = file_get_contents(SystemURLs::getDocumentRoot() . '/composer.json');
        $composerJson = json_decode($composerFile, true);
        if ((!empty($composerJson)) && array_key_exists('date', $composerJson) && (!empty($composerJson['date'])))
        {
          $version = new \DateTime($composerJson['date']);
        }
        else{
          $version = new \DateTime();<commit_msg>fix property reference from composer.json<commit_after><?php

namespace ChurchCRM\Service;

use ChurchCRM\dto\SystemConfig;
use ChurchCRM\dto\SystemURLs;
use ChurchCRM\FileSystemUtils;
use ChurchCRM\SQLUtils;
use Exception;
use Github\Client;
use Ifsnop\Mysqldump\Mysqldump;
use PharData;
use Propel\Runtime\Propel;
use PDO;
use ChurchCRM\Utils\InputUtils;

require SystemURLs::getDocumentRoot() . '/vendor/ifsnop/mysqldump-php/src/Ifsnop/Mysqldump/Mysqldump.php';


class SystemService
{
    public function getLatestRelease()
    {
        $client = new Client();
        $release = null;
        try {
            $release = $client->api('repo')->releases()->latest('churchcrm', 'crm');
        } catch (\Exception $e) {
        }

        return $release;
    }

    static public function getInstalledVersion()
    {
        $composerFile = file_get_contents(SystemURLs::getDocumentRoot() . '/composer.json');
        $composerJson = json_decode($composerFile, true);
        $version = $composerJson['version'];

        return $version;
    }
    
    static public function getCopyrightDate()
    {
        $composerFile = file_get_contents(SystemURLs::getDocumentRoot() . '/composer.json');
        $composerJson = json_decode($composerFile, true);
        if ((!empty($composerJson)) && array_key_exists('time', $composerJson) && (!empty($composerJson['time'])))
        {
          $version = new \DateTime($composerJson['time']);
        }
        else{
          $version = new \DateTime();
{'fraction_non_alphanumeric': 0.1353257219610477, 'fraction_numerical': 0.0, 'mean_word_length': 3.2195467422096318, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '1069216', 'n_tokens_mistral': 947, 'n_tokens_neox': 932, 'n_words': 169}