PHP 클래스 Changyan_Synchronizer

파일 보기 프로젝트 열기: zblogcn/zblogphp 1 사용 예제들

공개 메소드들

메소드 설명
buildURL ( $dataArray, $baseURL ) build GET URL by data array and base url
findCommentInDB ( $aComment, $postID )
getContents_curl ( $aUrl ) execute GET function using cURL, return JSON
getInstance ( ) return the single instance of this class
sync2Changyan ( $isSetup = false ) #region 'Synchronize to Changyan'
sync2Wordpress ( )

비공개 메소드들

메소드 설명
__clone ( )
__construct ( )
cmtAscend ( $x, $y ) This is a comparation function used by usort in function insertComments()
cmtDescend ( $x, $y ) This is a comparation function used by usort in function insertComments()
getCommentList_curl ( $appID, $aPostID ) return Array
getOption ( $option ) #endregion
insertComments ( $cmts, $postID ) : integer get comment information object generated by changyan server
isCommentExits ( $post_id, $comment_author, $comment_content, $date_gmt ) to check if this comment is in the wpdb
postContents_curl ( $aUrl, $aCommentsArray, $headerPart = [] ) execute POST function using cURL and return JSON array containing comment_ids in Changyan
setOption ( $option, $value )

메소드 상세

buildURL() 공개 메소드

build GET URL by data array and base url
public buildURL ( $dataArray, $baseURL )

findCommentInDB() 공개 메소드

public findCommentInDB ( $aComment, $postID )

getContents_curl() 공개 메소드

execute GET function using cURL, return JSON
public getContents_curl ( $aUrl )

getInstance() 공개 정적인 메소드

return the single instance of this class
public static getInstance ( )

sync2Changyan() 공개 메소드

#region 'Synchronize to Changyan'
public sync2Changyan ( $isSetup = false )

sync2Wordpress() 공개 메소드

public sync2Wordpress ( )