问题描述
我试图理解一个系统的基本流程,该系统包括:
I am trying to understand the basic flow of a system consisting of:
-
C#
客户端/程序/应用程序,它将查询PHP
服务器. -
PHP
服务器. 在Linux上运行的 -
Couchbase
服务器.
C#
client/program/app which will query thePHP
server.PHP
server.Couchbase
server running onLinux
.
在客户端,我有一些类, MyClass类{int,string,list等}
.
On the client side I have some classes, class MyClass {int,string,list etc}
.
基于其他问题和答案,流程应如下所示:
Based on other questions and answers, the flow should look like this:
C#
客户端类->序列化为 JSON
->作为字符串发送到 PHP
页面->(在 PHP 代码>页面)将
JSON
字符串反序列化为 PHP
类->发布到 Couchbase
->获取结果->序列化为 JSON
->以 JSON
字符串发布并返回到 C#
客户端->等等
C#
client class->serialize to JSON
-> post as string to PHP
page-> (on PHP
page) deserialize JSON
string to PHP
class ->posting to Couchbase
-> getting result -> serialize to JSON
->post as JSON
string and return to the C#
client -> etc
- 那是正确的吗?有什么建议么?
- 最好的工具/软件包是什么,从
JSON
进行序列化并在PHP
中转换为JSON
的最简单方法是什么?
- Is that correct? Any suggestions?
- What are the best tools/packages, easiest way to serialize from
JSON
and toJSON
inPHP
?
感谢您的帮助!
推荐答案
Couchbase 2.0是一个数据库,可用于直接存储文档.有了JSON字符串后,您就可以使用PHP客户端SDK将其存储到Couchbase中.
Couchbase 2.0 is a database that allows you to store document directly. As soon as you have the JSON string you can store it into Couchbase using the PHP Client SDK.
也就是说,如果您有一个PHP对象,则可以使用PHP中提供的json_encode()/json_decode()函数.
That said, if you have a PHP object and you can use the json_encode()/json_decode() functions that are available in PHP.
您可以查看Couchbase的入门和教程:- http://www.couchbase.com/docs/couchbase-sdk-php-1.1/tutorial.html
You can take a look the the Getting Started and Tutorial from Couchbase:- http://www.couchbase.com/docs/couchbase-sdk-php-1.1/tutorial.html
您还可以查看这个有趣的库,该库使您可以轻松地使用PHP和Couchbase进行开发:- https://github.com/Basement/Basement 您可以使用它,也可以查看它如何使用PHP和JSON.
Also you can look at this interested library that allows you to develop with PHP and Couchbase easily:- https://github.com/Basement/BasementYou can look to use it, or look to see how it uses PHP and JSON.
这篇关于C#客户端-PHP Web服务器-Couchbase数据库-如何在它们之间传递数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!