<commit_before><?php

/**
 * kitFramework::Basic
 *
 * @author Team phpManufaktur <<EMAIL>>
 * @link https://kit2.phpmanufaktur.de
 * @copyright 2013 <NAME> <<EMAIL>>
 * @license MIT License (MIT) http://www.opensource.org/licenses/MIT
 */

namespace phpManufaktur\Basic\Control\cURL;

use Silex\Application;

/**
 * Class to access the cURL library
 *
 * @author <NAME> <<EMAIL>>
 *
 */
class cURL {

    protected $app = null;

    const USERAGENT = 'kitFramework::Basic';

    public function __construct(Application $app)
    {
        $this->app = $app;
    }

    /**
     * Download a file with cURL from the given URL
     *
     * @param string $source_url
     * @param string $target_path
     * @throws \Exception
     */
    public function Download ($source_url, $target_path, &$info = array())
    {
        try {

            // first try to get the redirected URL
            $ch = curl_init();
            curl_setopt($ch, CURLOPT_URL, $source_url);
            curl_setopt($ch, CURLOPT_HEADER, true);
            curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);<commit_msg>increased timeout to 180 seconds<commit_after><?php

/**
 * kitFramework::Basic
 *
 * @author Team phpManufaktur <<EMAIL>>
 * @link https://kit2.phpmanufaktur.de
 * @copyright 2013 <NAME> <<EMAIL>>
 * @license MIT License (MIT) http://www.opensource.org/licenses/MIT
 */

namespace phpManufaktur\Basic\Control\cURL;

use Silex\Application;

/**
 * Class to access the cURL library
 *
 * @author <NAME> <<EMAIL>>
 *
 */
class cURL {

    protected $app = null;

    const USERAGENT = 'kitFramework::Basic';

    public function __construct(Application $app)
    {
        $this->app = $app;
    }

    /**
     * Download a file with cURL from the given URL
     *
     * @param string $source_url
     * @param string $target_path
     * @throws \Exception
     */
    public function Download ($source_url, $target_path, &$info = array())
    {
        try {
            // time limit for cURL operation
            set_time_limit(180);

            // first try to get the redirected URL
            $ch = curl_init();
            curl_setopt($ch, CURLOPT_URL, $source_url);
            curl_setopt($ch, CURLOPT_HEADER, true);
            curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
{'fraction_non_alphanumeric': 0.12703040399833404, 'fraction_numerical': 0.006663890045814244, 'mean_word_length': 2.5850746268656715, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3584950', 'n_tokens_mistral': 795, 'n_tokens_neox': 750, 'n_words': 189}