PHP Class Changyan_Synchronizer

Afficher le fichier Open project: zblogcn/zblogphp Class Usage Examples

Méthodes publiques

Méthode Description
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 ( )

Private Methods

Méthode Description
__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 )

Method Details

buildURL() public méthode

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

findCommentInDB() public méthode

public findCommentInDB ( $aComment, $postID )

getContents_curl() public méthode

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

getInstance() public static méthode

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

sync2Changyan() public méthode

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

sync2Wordpress() public méthode

public sync2Wordpress ( )