Changeset 2230 for branches

Show
Ignore:
Timestamp:
11/19/10 10:29:23 (18 months ago)
Author:
nick_ramsay
Message:

[1.4.2] Added sendApiRequest function back in and removed duplicate declaration of hotaru_feedback. Tested with upgrade script and works okay.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/1.4/libs/SystemInfo.php

    r2229 r2230  
    2727{ 
    2828        /** 
    29         * Calls external site to provide system info feedback report 
    30         * 
    31         * @return bool true 
    32         */ 
     29         * Calls external site to provide system info feedback report 
     30         * 
     31         * @return bool true 
     32         */ 
    3333        public function hotaru_feedback($h, $format = 'json') 
    3434        { 
     
    4545                 
    4646                return true; 
     47        } 
     48 
     49 
     50        /** 
     51         * 
     52         * @param <type> $query_vals 
     53         * @param <type> $url 
     54         * @return <type> 
     55         */ 
     56        public function sendApiRequest($h, $query_vals, $url) 
     57        { 
     58                // Generate the POST string  
     59                $ret = ''; 
     60                foreach($query_vals as $key => $value) { 
     61                        $ret .= $key.'='.urlencode($value).'&'; 
     62                } 
     63 
     64                $ret = rtrim($ret, '&'); 
     65                 
     66                $ch = curl_init($url); 
     67                curl_setopt($ch, CURLOPT_HEADER, 0); 
     68                curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
     69                curl_setopt($ch, CURLOPT_POSTFIELDS, $ret); 
     70                $response = curl_exec($ch); 
     71                curl_close ($ch); 
     72                 
     73                return json_decode($response, true); 
    4774        } 
    4875 
     
    309336        public function hotaru_version() { return false; } 
    310337        public function plugin_version_getAll() { return false; } 
    311         public function hotaru_feedback() { return false; } 
    312338} 
    313339?>