linkorb/answers-client
Composer 安装命令:
composer require linkorb/answers-client
包简介
Answers Client for Answers Application
README 文档
README
PHP client library for Answers application.
Installation
composer require linkorb/answers-client
Example
Client
require_once __DIR__ . '/../../vendor/autoload.php'; use Linkorb\AnswersClient\Client as Client; use Linkorb\AnswersClient\Question as Question; // get the client $client = new Client( '<Host>', '<Username>', '<Password>' );
Question
// Create Question $question = new Question( $client ); $question->setQuestion(<Question>); $question->setDescription(<Description>); $question->setTopicId(<topic id>); try { $question->create(); } catch( Exception $e ) { echo $e->getMessage(); } $question->setQuestion(<question>); try { $question->update(); } catch( Exception $e ) { echo $e->getMessage(); } // Get Question $question = new Question( $client ); $question->get(<Question id>); $answers = $question->getAnswers(); var_dump($answers); $comments = $question->getComments(); var_dump($comments); $votes = $question->getVotes(); var_dump($votes); // Update question $question = new Question( $client ); $question->get(<Question id>); $question->setQuestion(<Question>); $question->setDescription(<Description>); try { $question->update(); } catch( Exception $e ) { echo $e->getMessage(); } // Delete question $question = new Question( $client ); $question->get(<Question Id>); try { $question->delete(); } catch( Exception $e ) { echo $e->getMessage(); } //Comment $question = new Question( $client ); $question->get(<Question id>); try { $question->comment(<Comment>); } catch( Exception $e ) { echo $e->getMessage(); } // Vote $question = new Question( $client ); $question->get(<Question id>); try { $question->vote(); } catch( Exception $e ) { echo $e->getMessage(); }
Answer
// Create Answer $answer = new Answer( $client ); $answer->setQuestionId( <Question id> ); $answer->setAnswer( <Answer id> ); try { $answer->create(); } catch( Exception $e ) { echo $e->getMessage(); } // Get Answer $answer = new Answer( $client ); $answer->get( <Answer id> ); $comments = $answer->getComments(); var_dump($comments); $votes = $answer->getVotes(); var_dump($votes); // Update Answer $answer = new Answer( $client ); $answer->get( <Answer id> ); $answer->setAnswer(<Answer>); try { $answer->update(); } catch( Exception $e ) { echo $e->getMessage(); } // Delete Answer $answer = new Answer( $client ); $answer->get(<Answer id>); try { $answer->delete(); } catch( Exception $e ) { echo $e->getMessage(); } // Commnent Answer $answer = new Answer( $client ); $answer->get(<Answer Id>); try { $answer->comment(<Comment>); } catch( Exception $e ) { echo $e->getMessage(); } // Vote Answer $answer = new Answer( $client ); $answer->get(<Answer Id>); try { $answer->vote(); } catch( Exception $e ) { echo $e->getMessage(); }
Comment
// Get comment $comment = new Comment( $client ); $comment->get(<Comment Id>); $votes = $comment->getVotes(); var_dump($votes); // Update comment $answer = new Answer( $client ); $answer->get(<Answer id>); $answer->setAnswer(<Answer>); try { $answer->update(); } catch( Exception $e ) { echo $e->getMessage(); } // Delete comment $comment = new Comment( $client ); $comment->get(<Comment id>); try { $comment->delete(); } catch( Exception $e ) { echo $e->getMessage(); } // Vote comment $comment = new Comment( $client ); $comment->get(<Comment id>); try { $comment->vote(); } catch( Exception $e ) { echo $e->getMessage(); }
Vote
// Delete comment $vote = new Vote( $client ); $vote->get(<Vote id>); try { $vote->delete(); } catch( Exception $e ) { echo $e->getMessage(); }
Brought to you by the LinkORB Engineering team
Check out our other projects at engineering.linkorb.com.
Btw, we're hiring!
linkorb/answers-client 适用场景与选型建议
linkorb/answers-client 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 16 次下载、GitHub Stars 达 0, 最近一次更新时间为 2015 年 11 月 30 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「answers」 「linkorb」 「client-library」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 linkorb/answers-client 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 linkorb/answers-client 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 linkorb/answers-client 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
With Magento 2 FAQ Extension, you will not need to worry about creating useful and nice FAQ page for your ecommerce website. The extension will help you to set up nice informative & SEO-friendly magento 2 FAQ page. With faq page, your customers will find convenient, easily and quick to resolve commo
Ecomteck Product Questions Free
WADO JWT client for PHP
HelpDesk Extension for magento2
ImgproxyService use imgproxy
Upr Client Library
统计信息
- 总下载量: 16
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-11-30