Changyan_Synchronizer::getCommentList_curl PHP Method

getCommentList_curl() private method

return Array
private getCommentList_curl ( $appID, $aPostID )
    private function getCommentList_curl($appID, $aPostID)
    {
        #region 'Using api/open/comment/list to get comment list in Changyan'
        //page_no is the current comment page number
        $page_no = 1;
        //page_sum is the sum of comment pages
        $page_sum = 1;
        //commentPageArray is array of the comment pages
        $commentPageArray = array();
        while ($page_no <= $page_sum) {
            //clear $data
            unset($data);
            //generate the params
            $data = array('client_id' => $appID, 'topic_id' => $aPostID, 'outer_page_no' => $page_no, 'style' => 'terrace');
            //append the params behind the url
            $sUrl = 'https://changyan.sohu.com/api/open/comment/list';
            $sUrl = $this->buildURL($data, $sUrl);
            //execute GET through cURL
            $data = $this->getContents_curl($sUrl);
            //$data is object now
            $data = json_decode($data);
            $page_sum = intval($data->cmt_sum / 30) + 1;
            //insert data into $commentPageArray
            $commentPageArray[] = $data;
            $page_no += 1;
        }
        #endregion
        return $commentPageArray;
    }