<commit_before><?php
/*
************************************************************************
Copyright [2011] [PagSeguro Internet Ltda.]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
************************************************************************
*/

/*
 * PagSeguro Library Class
 * Version: 2.1.6
 * Date: 31/05/2013
 */
define('PAGSEGURO_LIBRARY', TRUE);
require_once "loader".DIRECTORY_SEPARATOR."PagSeguroAutoLoader.class.php";
class PagSeguroLibrary {
	
	const VERSION = "2.1.7";
	public static $resources;
	public static $config;
	public static $log;
	private static $path;
	private static $library;
	private static $module_version;
	private static $cms_version;
	
	private function __construct() {
		self::$path 	 = (dirname(__FILE__));
		PagSeguroAutoloader::init();
		self::$resources = PagSeguroResources::init();
		self::$config 	 = PagSeguroConfig::init();
		self::$log 	 = LogPagSeguro::init();
	}
	
	public static function init() {
		self::verifyDependencies();
		if (self::$library == null) {
			self::$library  = new PagSeguroLibrary();
		}
		return self::$library;
	}
	
	private static function verifyDependencies() {
		
		$dependencies = true;
		
		if (!function_exists('spl_autoload_register')) {
			throw new Exception("PagSeguroLibrary: Standard PHP Library (SPL) is required.");
			$dependencies = false;
		}
		
		if (!function_exists('curl_init')) {
			throw new Exception('PagSeguroLibrary: cURL library is required.');
			$dependencies = false;
		}
		
		if (!class_exists('DOMDocument')) {
			throw new Exception('PagSeguroLibrary: DOM XML extension is required.');
			$dependencies = false;
		}
		
		return $dependencies;
		
	}
	
	public final static function getVersion() {
		return self::VERSION;
	}
	
	public final static function getPath() {
		return self::$path;
	}
	
	public final static function getModuleVersion() {
		return self::$module_version;
	}
        
	public final static function setModuleVersion($version) {
		self::$module_version = $version;
	}
        
	public final static function getCMSVersion() {
		return self::$cms_version;
	}
        
	public final static function setCMSVersion($version) {
		self::$cms_version = $version;
	}
}
PagSeguroLibrary::init();
?><commit_msg>Bumped version number and fixed the verifyDependencies method.<commit_after><?php
/*
************************************************************************
Copyright [2011] [PagSeguro Internet Ltda.]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
************************************************************************
*/

/*
 * PagSeguro Library Class
 * Version: 2.1.6
 * Date: 31/05/2013
 */

define('PAGSEGURO_LIBRARY', true);

require_once "loader" . DIRECTORY_SEPARATOR . "PagSeguroAutoLoader.class.php";

class PagSeguroLibrary
{

    const VERSION = "2.2";
    public static $resources;
    public static $config;
    public static $log;
    private static $path;
    private static $library;
    private static $module_version;
    private static $cms_version;

    private function __construct()
    {
        self::$path = (dirname(__FILE__));
        PagSeguroAutoloader::init();
        self::$resources = PagSeguroResources::init();
        self::$config = PagSeguroConfig::init();
        self::$log = LogPagSeguro::init();
    }

    public static function init()
    {
        self::verifyDependencies();
        if (self::$library == null) {
            self::$library = new PagSeguroLibrary();
        }
        return self::$library;
    }

    private static function verifyDependencies()
    {

        $dependencies = true;

        try {
            if (!function_exists('spl_autoload_register')) {
                $dependencies = false;
                throw new Exception("PagSeguroLibrary: Standard PHP Library (SPL) is required.");
            }

            if (!function_exists('curl_init')) {
                $dependencies = false;
                throw new Exception('PagSeguroLibrary: cURL library is required.');
            }

            if (!class_exists('DOMDocument')) {
                $dependencies = false;
                throw new Exception('PagSeguroLibrary: DOM XML extension is required.');
            }
        } catch (Exception $e) {
            return $dependencies;
        }

        return $dependencies;

    }

    public final static function getVersion()
    {
        return self::VERSION;
    }

    public final static function getPath()
    {
        return self::$path;
    }

    public final static function getModuleVersion()
    {
        return self::$module_version;
    }

    public final static function setModuleVersion($version)
    {
        self::$module_version = $version;
    }

    public final static function getCMSVersion()
    {
        return self::$cms_version;
    }

    public final static function setCMSVersion($version)
    {
        self::$cms_version = $version;
    }
}

PagSeguroLibrary::init();
{'fraction_non_alphanumeric': 0.14875892553553213, 'fraction_numerical': 0.007310438626317579, 'mean_word_length': 3.4100449775112445, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6636996', 'n_tokens_mistral': 1690, 'n_tokens_neox': 1556, 'n_words': 481}