Mysqli在Ratchet pusher类中找不到

时间:2016-12-03 11:06:01

标签: php mysqli

Hello Iam与Ratchet创建聊天。但是在推送器package com.example; import java.util.ArrayList; import java.util.List; import javax.annotation.Generated; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; public class Datum { @SerializedName("ArticleID") @Expose private String articleID; @SerializedName("TopicID") @Expose private String topicID; @SerializedName("EntID") @Expose private String entID; @SerializedName("CompID") @Expose private String compID; @SerializedName("ArticleOwnerUsrID") @Expose private String articleOwnerUsrID; @SerializedName("ArticleType") @Expose private String articleType; @SerializedName("ArticleTitle") @Expose private String articleTitle; @SerializedName("ArticleThumb") @Expose private String articleThumb; @SerializedName("ArticleImg") @Expose private Object articleImg; @SerializedName("ArticleTopImg") @Expose private String articleTopImg; @SerializedName("ArticleSum") @Expose private String articleSum; @SerializedName("ArticleExtUrl") @Expose private String articleExtUrl; @SerializedName("CommentCnt") @Expose private String commentCnt; @SerializedName("ReplyCnt") @Expose private String replyCnt; @SerializedName("ArticleCreatedBy") @Expose private String articleCreatedBy; @SerializedName("ArticleModDt") @Expose private String articleModDt; @SerializedName("ArticleCreatedDt") @Expose private String articleCreatedDt; @SerializedName("ArticleTotalRating") @Expose private String articleTotalRating; @SerializedName("ArticleRatingCnt") @Expose private String articleRatingCnt; @SerializedName("ArticleViewCnt") @Expose private String articleViewCnt; @SerializedName("UsrFileID") @Expose private Object usrFileID; @SerializedName("GroupID") @Expose private String groupID; @SerializedName("GroupAddTyp") @Expose private String groupAddTyp; @SerializedName("ArticleAddTyp") @Expose private String articleAddTyp; @SerializedName("meta") @Expose private String meta; @SerializedName("meta_image") @Expose private String metaImage; @SerializedName("ArticleSubType") @Expose private Object articleSubType; @SerializedName("Language") @Expose private String language; @SerializedName("Attachment") @Expose private List<Object> attachment = new ArrayList<Object>(); @SerializedName("TopicNm") @Expose private String topicNm; @SerializedName("TagNm") @Expose private List<TagNm> tagNm = new ArrayList<TagNm>(); @SerializedName("ArticleTopImgThumb") @Expose private String articleTopImgThumb; @SerializedName("ReadTime") @Expose private Integer readTime; @SerializedName("UsrPicture") @Expose private String usrPicture; @SerializedName("LikeFlag") @Expose private Integer likeFlag; @SerializedName("Likes") @Expose private Integer likes; @SerializedName("isFavourite") @Expose private String isFavourite; /** * * @return * The articleID */ public String getArticleID() { return articleID; } /** * * @param articleID * The ArticleID */ public void setArticleID(String articleID) { this.articleID = articleID; } /** * * @return * The topicID */ public String getTopicID() { return topicID; } /** * * @param topicID * The TopicID */ public void setTopicID(String topicID) { this.topicID = topicID; } /** * * @return * The entID */ public String getEntID() { return entID; } /** * * @param entID * The EntID */ public void setEntID(String entID) { this.entID = entID; } /** * * @return * The compID */ public String getCompID() { return compID; } /** * * @param compID * The CompID */ public void setCompID(String compID) { this.compID = compID; } /** * * @return * The articleOwnerUsrID */ public String getArticleOwnerUsrID() { return articleOwnerUsrID; } /** * * @param articleOwnerUsrID * The ArticleOwnerUsrID */ public void setArticleOwnerUsrID(String articleOwnerUsrID) { this.articleOwnerUsrID = articleOwnerUsrID; } /** * * @return * The articleType */ public String getArticleType() { return articleType; } /** * * @param articleType * The ArticleType */ public void setArticleType(String articleType) { this.articleType = articleType; } /** * * @return * The articleTitle */ public String getArticleTitle() { return articleTitle; } /** * * @param articleTitle * The ArticleTitle */ public void setArticleTitle(String articleTitle) { this.articleTitle = articleTitle; } /** * * @return * The articleThumb */ public String getArticleThumb() { return articleThumb; } /** * * @param articleThumb * The ArticleThumb */ public void setArticleThumb(String articleThumb) { this.articleThumb = articleThumb; } /** * * @return * The articleImg */ public Object getArticleImg() { return articleImg; } /** * * @param articleImg * The ArticleImg */ public void setArticleImg(Object articleImg) { this.articleImg = articleImg; } /** * * @return * The articleTopImg */ public String getArticleTopImg() { return articleTopImg; } /** * * @param articleTopImg * The ArticleTopImg */ public void setArticleTopImg(String articleTopImg) { this.articleTopImg = articleTopImg; } /** * * @return * The articleSum */ public String getArticleSum() { return articleSum; } /** * * @param articleSum * The ArticleSum */ public void setArticleSum(String articleSum) { this.articleSum = articleSum; } /** * * @return * The articleExtUrl */ public String getArticleExtUrl() { return articleExtUrl; } /** * * @param articleExtUrl * The ArticleExtUrl */ public void setArticleExtUrl(String articleExtUrl) { this.articleExtUrl = articleExtUrl; } /** * * @return * The commentCnt */ public String getCommentCnt() { return commentCnt; } /** * * @param commentCnt * The CommentCnt */ public void setCommentCnt(String commentCnt) { this.commentCnt = commentCnt; } /** * * @return * The replyCnt */ public String getReplyCnt() { return replyCnt; } /** * * @param replyCnt * The ReplyCnt */ public void setReplyCnt(String replyCnt) { this.replyCnt = replyCnt; } /** * * @return * The articleCreatedBy */ public String getArticleCreatedBy() { return articleCreatedBy; } /** * * @param articleCreatedBy * The ArticleCreatedBy */ public void setArticleCreatedBy(String articleCreatedBy) { this.articleCreatedBy = articleCreatedBy; } /** * * @return * The articleModDt */ public String getArticleModDt() { return articleModDt; } /** * * @param articleModDt * The ArticleModDt */ public void setArticleModDt(String articleModDt) { this.articleModDt = articleModDt; } /** * * @return * The articleCreatedDt */ public String getArticleCreatedDt() { return articleCreatedDt; } /** * * @param articleCreatedDt * The ArticleCreatedDt */ public void setArticleCreatedDt(String articleCreatedDt) { this.articleCreatedDt = articleCreatedDt; } /** * * @return * The articleTotalRating */ public String getArticleTotalRating() { return articleTotalRating; } /** * * @param articleTotalRating * The ArticleTotalRating */ public void setArticleTotalRating(String articleTotalRating) { this.articleTotalRating = articleTotalRating; } /** * * @return * The articleRatingCnt */ public String getArticleRatingCnt() { return articleRatingCnt; } /** * * @param articleRatingCnt * The ArticleRatingCnt */ public void setArticleRatingCnt(String articleRatingCnt) { this.articleRatingCnt = articleRatingCnt; } /** * * @return * The articleViewCnt */ public String getArticleViewCnt() { return articleViewCnt; } /** * * @param articleViewCnt * The ArticleViewCnt */ public void setArticleViewCnt(String articleViewCnt) { this.articleViewCnt = articleViewCnt; } /** * * @return * The usrFileID */ public Object getUsrFileID() { return usrFileID; } /** * * @param usrFileID * The UsrFileID */ public void setUsrFileID(Object usrFileID) { this.usrFileID = usrFileID; } /** * * @return * The groupID */ public String getGroupID() { return groupID; } /** * * @param groupID * The GroupID */ public void setGroupID(String groupID) { this.groupID = groupID; } /** * * @return * The groupAddTyp */ public String getGroupAddTyp() { return groupAddTyp; } /** * * @param groupAddTyp * The GroupAddTyp */ public void setGroupAddTyp(String groupAddTyp) { this.groupAddTyp = groupAddTyp; } /** * * @return * The articleAddTyp */ public String getArticleAddTyp() { return articleAddTyp; } /** * * @param articleAddTyp * The ArticleAddTyp */ public void setArticleAddTyp(String articleAddTyp) { this.articleAddTyp = articleAddTyp; } /** * * @return * The meta */ public String getMeta() { return meta; } /** * * @param meta * The meta */ public void setMeta(String meta) { this.meta = meta; } /** * * @return * The metaImage */ public String getMetaImage() { return metaImage; } /** * * @param metaImage * The meta_image */ public void setMetaImage(String metaImage) { this.metaImage = metaImage; } /** * * @return * The articleSubType */ public Object getArticleSubType() { return articleSubType; } /** * * @param articleSubType * The ArticleSubType */ public void setArticleSubType(Object articleSubType) { this.articleSubType = articleSubType; } /** * * @return * The language */ public String getLanguage() { return language; } /** * * @param language * The Language */ public void setLanguage(String language) { this.language = language; } /** * * @return * The attachment */ public List<Object> getAttachment() { return attachment; } /** * * @param attachment * The Attachment */ public void setAttachment(List<Object> attachment) { this.attachment = attachment; } /** * * @return * The topicNm */ public String getTopicNm() { return topicNm; } /** * * @param topicNm * The TopicNm */ public void setTopicNm(String topicNm) { this.topicNm = topicNm; } /** * * @return * The tagNm */ public List<TagNm> getTagNm() { return tagNm; } /** * * @param tagNm * The TagNm */ public void setTagNm(List<TagNm> tagNm) { this.tagNm = tagNm; } /** * * @return * The articleTopImgThumb */ public String getArticleTopImgThumb() { return articleTopImgThumb; } /** * * @param articleTopImgThumb * The ArticleTopImgThumb */ public void setArticleTopImgThumb(String articleTopImgThumb) { this.articleTopImgThumb = articleTopImgThumb; } /** * * @return * The readTime */ public Integer getReadTime() { return readTime; } /** * * @param readTime * The ReadTime */ public void setReadTime(Integer readTime) { this.readTime = readTime; } /** * * @return * The usrPicture */ public String getUsrPicture() { return usrPicture; } /** * * @param usrPicture * The UsrPicture */ public void setUsrPicture(String usrPicture) { this.usrPicture = usrPicture; } /** * * @return * The likeFlag */ public Integer getLikeFlag() { return likeFlag; } /** * * @param likeFlag * The LikeFlag */ public void setLikeFlag(Integer likeFlag) { this.likeFlag = likeFlag; } /** * * @return * The likes */ public Integer getLikes() { return likes; } /** * * @param likes * The Likes */ public void setLikes(Integer likes) { this.likes = likes; } /** * * @return * The isFavourite */ public String getIsFavourite() { return isFavourite; } /** * * @param isFavourite * The isFavourite */ public void setIsFavourite(String isFavourite) { this.isFavourite = isFavourite; } } -----------------------------------com.example.Example.java----------------------------------- package com.example; import java.util.ArrayList; import java.util.List; import javax.annotation.Generated; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; @Generated("org.jsonschema2pojo") public class Example { @SerializedName("status") @Expose private String status; @SerializedName("data") @Expose private List<Datum> data = new ArrayList<Datum>(); /** * * @return * The status */ public String getStatus() { return status; } /** * * @param status * The status */ public void setStatus(String status) { this.status = status; } /** * * @return * The data */ public List<Datum> getData() { return data; } /** * * @param data * The data */ public void setData(List<Datum> data) { this.data = data; } } -----------------------------------com.example.TagNm.java----------------------------------- package com.example; import javax.annotation.Generated; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; public class TagNm { @SerializedName("ArticleID") @Expose private String articleID; @SerializedName("TagID") @Expose private String tagID; @SerializedName("TagNm") @Expose private String tagNm; /** * * @return * The articleID */ public String getArticleID() { return articleID; } /** * * @param articleID * The ArticleID */ public void setArticleID(String articleID) { this.articleID = articleID; } /** * * @return * The tagID */ public String getTagID() { return tagID; } /** * * @param tagID * The TagID */ public void setTagID(String tagID) { this.tagID = tagID; } /** * * @return * The tagNm */ public String getTagNm() { return tagNm; } /** * * @param tagNm * The TagNm */ public void setTagNm(String tagNm) { this.tagNm = tagNm; } } 函数中我想让它访问数据库但是当我把这行代码放在我的推送器类中时,

onOpen

我收到以下错误

$connn = new mysqli($servername, $username, $password, $dbname);

我的推送器类在命名空间Fatal error: Class 'MyApp\mysqli' not found in C:\xampp\htdocs\fotoserver\src\MyApp\Chat.php on line 25 中有什么问题?为什么我不能访问dababase?任何帮助都将受到高度赞赏

0 个答案:

没有答案