<commit_before><?php
require 'lib/OAuthSimple.php';

/** Define a custom Exception for easy trap and detection
 */
class XeroOAuthException extends Exception
{
}

class XeroOAuth
{
    var $_xero_defaults;
    var $_xero_consumer_options;
    var $_action;
    var $_nonce_chars;
    
    /**
     * Creates a new XeroOAuth object
     *
     * @param string $config, the configuration settings
     */
    
    function __construct($config)
    {
        $this->params          = array();
        $this->headers         = array();
        $this->auto_fixed_time = false;
        $this->buffer          = null;
        
        if (!empty($config['application_type'])) {
            switch ($config['application_type']) {
                case "Public":
                    $this->_xero_defaults = array(
                        'xero_url' => 'https://api.xero.com/',
                        'site' => 'https://api.xero.com',
                        'authorize_url' => 'https://api.xero.com/oauth/Authorize',
                        'signature_method' => 'HMAC-SHA1'
                    );
                    break;
                case "Private":
                    $this->_xero_defaults = array(
                        'xero_url' => 'https://api.xero.com/',
                        'site' => 'https://api.xero.com',
                        'authorize_url' => 'https://api.xero.com/oauth/Authorize',
                        'signature_method' => 'RSA-SHA1'
                    );
                    break;
                case "Partner":
                    $this->_xero_defaults = array(
                        'xero_url' => 'https://api-partner.network.xero.com/',
                        'site' => 'https://api-partner.network.xero.com',
                        'authorize_url' => 'https://api.xero.com/oauth/Authorize',
                        'signature_method' => 'RSA-SHA1'
                    );
                    break;
            }
        }
        
        $this->_xero_consumer_options = array(
            'request_token_path' => 'oauth/RequestToken',
            'access_token_path' => 'oauth/AccessToken',
            'authorize_path' => 'oauth/Authorize'
        );
        $this->_xero_curl_options     = array( // you probably don't want to change any of these curl values
            'curl_connecttimeout' => 30,
            'curl_timeout' => 10,
            // for security you may want to set this to TRUE. If you do you need
            // to install the servers certificate in your local certificate store.
            'curl_ssl_verifypeer' => true,
        	'curl_cainfo' => 'certs/ca-bundle.crt',
            'curl_followlocation' => false, // whether to follow redirects or not
            'curl_ssl_verifyhost' => true,
            // support for proxy servers<commit_msg>comment to include CA source<commit_after><?php
require 'lib/OAuthSimple.php';

/** Define a custom Exception for easy trap and detection
 */
class XeroOAuthException extends Exception
{
}

class XeroOAuth
{
    var $_xero_defaults;
    var $_xero_consumer_options;
    var $_action;
    var $_nonce_chars;
    
    /**
     * Creates a new XeroOAuth object
     *
     * @param string $config, the configuration settings
     */
    
    function __construct($config)
    {
        $this->params          = array();
        $this->headers         = array();
        $this->auto_fixed_time = false;
        $this->buffer          = null;
        
        if (!empty($config['application_type'])) {
            switch ($config['application_type']) {
                case "Public":
                    $this->_xero_defaults = array(
                        'xero_url' => 'https://api.xero.com/',
                        'site' => 'https://api.xero.com',
                        'authorize_url' => 'https://api.xero.com/oauth/Authorize',
                        'signature_method' => 'HMAC-SHA1'
                    );
                    break;
                case "Private":
                    $this->_xero_defaults = array(
                        'xero_url' => 'https://api.xero.com/',
                        'site' => 'https://api.xero.com',
                        'authorize_url' => 'https://api.xero.com/oauth/Authorize',
                        'signature_method' => 'RSA-SHA1'
                    );
                    break;
                case "Partner":
                    $this->_xero_defaults = array(
                        'xero_url' => 'https://api-partner.network.xero.com/',
                        'site' => 'https://api-partner.network.xero.com',
                        'authorize_url' => 'https://api.xero.com/oauth/Authorize',
                        'signature_method' => 'RSA-SHA1'
                    );
                    break;
            }
        }
        
        $this->_xero_consumer_options = array(
            'request_token_path' => 'oauth/RequestToken',
            'access_token_path' => 'oauth/AccessToken',
            'authorize_path' => 'oauth/Authorize'
        );
        $this->_xero_curl_options     = array( // you probably don't want to change any of these curl values
            'curl_connecttimeout' => 30,
            'curl_timeout' => 10,
            // for security you may want to set this to TRUE. If you do you need
            // to install the servers certificate in your local certificate store.
            'curl_ssl_verifypeer' => true,
        	// include ca-bundle.crt from http://curl.haxx.se/ca/cacert.pem
        	'curl_cainfo' => 'certs/ca-bundle.crt',
            'curl_followlocation' => false, // whether to follow redirects or not
            'curl_ssl_verifyhost' => true,
            // support for proxy servers
{'fraction_non_alphanumeric': 0.12272089761570827, 'fraction_numerical': 0.0024544179523141654, 'mean_word_length': 1.4317988064791134, 'pattern_counts': {'":': 6, '<': 5, '<?xml version=': 0, '>': 63, 'https://': 18, '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': '574966', 'n_tokens_mistral': 1620, 'n_tokens_neox': 1542, 'n_words': 323}