Code Duplication    Length = 16-16 lines in 2 locations

class/utility.php 1 location

@@ 504-519 (lines=16) @@
501
         * @param $url
502
         * @return bool|mixed
503
         */
504
        public static function planetFetchCURL($url)
505
        {
506
            if (!function_exists('curl_init')) {
507
                return false;
508
            }
509
            $ch = curl_init();    // initialize curl handle
510
            curl_setopt($ch, CURLOPT_URL, $url); // set url to post to
511
            curl_setopt($ch, CURLOPT_FAILONERROR, 1);
512
            curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);// allow redirects
513
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // return into a variable
514
            curl_setopt($ch, CURLOPT_TIMEOUT, 30); // times out after 31s
515
            $data = curl_exec($ch); // run the whole process
516
            curl_close($ch);
517
518
            return $data;
519
        }
520
521
        /**
522
         * @param $url

include/functions.php 1 location

@@ 496-511 (lines=16) @@
493
     * @param $url
494
     * @return bool|mixed
495
     */
496
    function planet_fetch_CURL($url)
497
    {
498
        if (!function_exists('curl_init')) {
499
            return false;
500
        }
501
        $ch = curl_init();    // initialize curl handle
502
        curl_setopt($ch, CURLOPT_URL, $url); // set url to post to
503
        curl_setopt($ch, CURLOPT_FAILONERROR, 1);
504
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);// allow redirects
505
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // return into a variable
506
        curl_setopt($ch, CURLOPT_TIMEOUT, 30); // times out after 31s
507
        $data = curl_exec($ch); // run the whole process
508
        curl_close($ch);
509
510
        return $data;
511
    }
512
513
    /**
514
     * @param $url