<commit_before><?php
/**
 * Zencoder API client interface.
 *
 * @category Services
 * @package  Services_Zencoder
 * @author   <NAME> <<EMAIL>>
 * @version  Release: 2.2.0
 * @license  http://creativecommons.org/licenses/MIT/MIT
 * @link     http://github.com/zencoder/zencoder-php
 * @access   private
 */

function Services_Zencoder_autoload($className)
{
    if (substr($className, 0, 17) != 'Services_Zencoder') {return false;}
    $file = str_replace('_', '/', $className);
    $file = str_replace('Services/', '', $file);
    return include dirname(__FILE__) . "/$file.php";
}
spl_autoload_register('Services_Zencoder_autoload');

/**
 * Zencoder API client interface.
 *
 * @category Services
 * @package  Services_Zencoder
 * @author   <NAME> <<EMAIL>>
 * @version  Release: 2.2.0
 * @license  http://creativecommons.org/licenses/MIT/MIT
 * @link     http://github.com/zencoder/zencoder-php
 */

class Services_Zencoder extends Services_Zencoder_Base
{
    const USER_AGENT = 'ZencoderPHP v2.2.0';

    /**
    * Contains the HTTP communication class
    * 
    * @var Services_Zencoder_Http
    */
    protected $http;
    /**
    * Contains the default API version
    * 
    * @var string
    */
    protected $version;

    /**
    * Provides access the Zencoder Accounts API
    * 
    * Valid functions: create, details, integration, live
    *
    * @var Services_Zencoder_Accounts
    */
    public $accounts;
    /**
    * Provides access the Zencoder Inputs API
    *
    * Valid functions: details, progress
    *
    * @var Services_Zencoder_Inputs
    */
    public $inputs;
    /**
    * Provides access the Zencoder Jobs API
    *
    * Valid functions: create, index, details, progress, resubmit, cancel
    *
    * @var Services_Zencoder_Jobs
    */
    public $jobs;
    /**
    * Provides access the Zencoder Notifications API
    *
    * Valid functions: parseIncoming
    *
    * @var Services_Zencoder_Notifications
    */
    public $notifications;
    /**
    * Provides access the Zencoder Outputs API
    *
    * Valid functions: details, progress
    *
    * @var Services_Zencoder_Outputs
    */
    public $outputs;

    /**
    * Initialize the Services_Zencoder class and sub-classes.
    *
    * @param string               $api_key      API Key
    * @param string               $api_version  API version
    * @param string               $api_host     API host
    * @param bool                 $debug        Enable debug mode
    */
    public function __construct(
        $api_key = NULL,
        $api_version = 'v2',
        $api_host = 'https://app.zencoder.com',
        $debug = false
    )
    {
        // Check that library dependencies are met
        if (strnatcmp(phpversion(),'5.2.0') < 0) {
            throw new Services_Zencoder_Exception('PHP version 5.2 or higher is required.');
        }
        if (!function_exists('json_encode')) {
            throw new Services_Zencoder_Exception('JSON support must be enabled.');
        }
        if (!function_exists('curl_init')) {
            throw new Services_Zencoder_Exception('cURL extension must be enabled.');
        }
        $this->version = $api_version;
        $this->http = new Services_Zencoder_Http(
            $api_host,
            array("curlopts" => array(
                CURLOPT_USERAGENT => self::USER_AGENT
                ), "api_key" => $api_key, "debug" => $debug)
            );
        $this->accounts = new Services_Zencoder_Accounts($this);
        $this->inputs = new Services_Zencoder_Inputs($this);
        $this->jobs = new Services_Zencoder_Jobs($this);
        $this->notifications = new Services_Zencoder_Notifications($this);
        $this->outputs = new Services_Zencoder_Outputs($this);
    }

    /**<commit_msg>Make it so that you can set curl opts for CA paths and files<commit_after><?php
/**
 * Zencoder API client interface.
 *
 * @category Services
 * @package  Services_Zencoder
 * @author   <NAME> <<EMAIL>>
 * @version  Release: 2.2.0
 * @license  http://creativecommons.org/licenses/MIT/MIT
 * @link     http://github.com/zencoder/zencoder-php
 * @access   private
 */

function Services_Zencoder_autoload($className)
{
    if (substr($className, 0, 17) != 'Services_Zencoder') {return false;}
    $file = str_replace('_', '/', $className);
    $file = str_replace('Services/', '', $file);
    return include dirname(__FILE__) . "/$file.php";
}
spl_autoload_register('Services_Zencoder_autoload');

/**
 * Zencoder API client interface.
 *
 * @category Services
 * @package  Services_Zencoder
 * @author   <NAME> <<EMAIL>>
 * @version  Release: 2.2.0
 * @license  http://creativecommons.org/licenses/MIT/MIT
 * @link     http://github.com/zencoder/zencoder-php
 */

class Services_Zencoder extends Services_Zencoder_Base
{
    const USER_AGENT = 'ZencoderPHP v2.2.0';

    /**
    * Contains the HTTP communication class
    * 
    * @var Services_Zencoder_Http
    */
    protected $http;
    /**
    * Contains the default API version
    * 
    * @var string
    */
    protected $version;

    /**
    * Provides access the Zencoder Accounts API
    * 
    * Valid functions: create, details, integration, live
    *
    * @var Services_Zencoder_Accounts
    */
    public $accounts;
    /**
    * Provides access the Zencoder Inputs API
    *
    * Valid functions: details, progress
    *
    * @var Services_Zencoder_Inputs
    */
    public $inputs;
    /**
    * Provides access the Zencoder Jobs API
    *
    * Valid functions: create, index, details, progress, resubmit, cancel
    *
    * @var Services_Zencoder_Jobs
    */
    public $jobs;
    /**
    * Provides access the Zencoder Notifications API
    *
    * Valid functions: parseIncoming
    *
    * @var Services_Zencoder_Notifications
    */
    public $notifications;
    /**
    * Provides access the Zencoder Outputs API
    *
    * Valid functions: details, progress
    *
    * @var Services_Zencoder_Outputs
    */
    public $outputs;

    /**
    * Initialize the Services_Zencoder class and sub-classes.
    *
    * @param string               $api_key      API Key
    * @param string               $api_version  API version
    * @param string               $api_host     API host
    * @param bool                 $debug        Enable debug mode
    * @param string               $ca_path      Path to a directory that holds multiple CA certificates
    * @param string               $ca_file      Path to a file holding one or more certificates to verify the peer with
    */
    public function __construct(
        $api_key = NULL,
        $api_version = 'v2',
        $api_host = 'https://app.zencoder.com',
        $debug = false,
        $ca_path = NULL,
        $ca_file = NULL
    )
    {
        // Check that library dependencies are met
        if (strnatcmp(phpversion(),'5.2.0') < 0) {
            throw new Services_Zencoder_Exception('PHP version 5.2 or higher is required.');
        }
        if (!function_exists('json_encode')) {
            throw new Services_Zencoder_Exception('JSON support must be enabled.');
        }
        if (!function_exists('curl_init')) {
            throw new Services_Zencoder_Exception('cURL extension must be enabled.');
        }

        $this->version = $api_version;

        $http_options = array("api_version" => $api_key, "debug" => $debug, "curlopts" => array(CURLOPT_USERAGENT => self::USER_AGENT));
        if (isset($ca_path)) {
          $http_options["curlopts"][CURLOPT_CAPATH] = realpath($ca_path);
        }
        if (isset($ca_file)) {
          $http_options["curlopts"][CURLOPT_CAINFO] = realpath($ca_file);
        }

        $this->http = new Services_Zencoder_Http($api_host, $http_options);
        $this->accounts = new Services_Zencoder_Accounts($this);
        $this->inputs = new Services_Zencoder_Inputs($this);
        $this->jobs = new Services_Zencoder_Jobs($this);
        $this->notifications = new Services_Zencoder_Notifications($this);
        $this->outputs = new Services_Zencoder_Outputs($this);
    }

    /**
{'fraction_non_alphanumeric': 0.11628773760715617, 'fraction_numerical': 0.004721083364393092, 'mean_word_length': 2.45049292756108, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 37, 'https://': 2, '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': '879881', 'n_tokens_mistral': 2421, 'n_tokens_neox': 2384, 'n_words': 580}