首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 操作系统 >

Zend框架:Zend_Nosql_Mong??o组件提议

2014-07-26 
Zend框架:Zend_Nosql_Mong??o组件建议Zend框架:Zend_Nosql_Mong??o组件建议Proposed Component Name建议的

Zend框架:Zend_Nosql_Mong??o组件建议

Zend框架:Zend_Nosql_Mong??o组件建议

Proposed Component Name建议的组件名称Zend_Nosql_Mongo Zend_Nosql_Mong??oDeveloper Notes开发人员说明http://framework.zend.com/wiki/display/ZFDEV/Zend_Nosql_Mongohttp://framework.zend.com/wiki/display/ZFDEV/Zend_Nosql_MongoProposers提议者Valentin Golev瓦伦丁GolevZend Liaison Zend的联络TBD待定Revision修订1.0 - 6 January 2010: Initial Draft. 1.0 - 2010年1月6日:初步草案。(wiki revision: 9) (维基修订:9)Table of Contents目录表

<style type="text/css"><!--div.rbtoc1262799713448{margin-left:0px;padding:0px}div.rbtoc1262799713448 ul{list-style:none;margin-left:0px;padding-left:0px}div.rbtoc1262799713448 li{margin-left:0px;padding-left:0px}--></style>

1.1。 Overview概述 2.2。 References参考文献 3.3。 Component Requirements, Constraints, and Acceptance Criteria 组件需求,约束和验收标准 4.4。 Dependencies on Other Framework Components 其他的框架组件上的依赖关系 5.5。 Theory of Operation 工作原理 6.6。 Milestones / Tasks 里程碑/任务 7.7。 Class Index 类指数 8.8。 Use Cases 用例 9.9。 Class Skeletons 类骨架

1. 1。Overview概述

Zend_Nosql_Mongo is a namespace containing wrappers and adapters for PHP Mongo classes, intended to make them more handy, simple and compatible with other ZF classes, such as Zend_Paginator. Zend_Nosql_Mong??o是一个命名空间包含PHP蒙戈类的包装和适配器,旨在使他们更方便,简单,并与其他的ZF类,如Zend_Paginator,兼容。

2. 2。References参考文献

?

MongoDB official site MongoDB的官方网站 Mongodloid, a library developed by the author of the proposal Mongodloid库,由作者开发的建议

?

?

?

3. 3。Component Requirements, Constraints, and Acceptance Criteria组件需求,约束和验收标准

?

This componentwill expose the entire MongoDB API此组件揭露整个MongoDB的APIThis componentwill expose even the API not supported by PHP driver if it is exposed byMongo DB commands此组件公开甚至PHP驱动程序不支持的API,如果它是由暴露蒙戈 DB命令 This componentwill provide class for a Mongo Object.此组件提供一个蒙戈对象类。In a mongo objectwill be only string, int, bool, double, null, array (of any of these types, recursively), Mongo Object, date, MongoID, binary, regexp and JS Code fields.在蒙戈对象是唯一的字符串,整型,布尔,双,空,数组(这些类型的任何递归),蒙戈对象,日期,MongoID,二进制,REGEXP和JS代码领域。See alsoData Types in Mongo 数据类型也蒙戈 Fieldswill be able to be accessed as a member variables, like $object->subObject->subObjField for { subObject : { subObjField : 17 } }.字段能够作为一个成员变量的访问,如$对象>子对象subObjField {子对象:{subObjField 17}} 。This componentwill provide objects for individual documents as well as document collections此组件提供单独的文件以及文档集合中的对象Document objectswill allow arbitrary fields Document对象允许任意字段Document objectswill provide accessors for document IDs Document对象提供的文档ID的访问器Document objectswill allow arbitrary fields Document对象允许任意字段Document objectswill be instances of a class which extends BSON Object Document对象扩展BSON对象的类的实例Document objectswill allow atomic operations like increment Document对象允许原子操作 ,像增量 Document Collectionswill be iterable所收集的文件被迭代的 Document Collectionswill be countable文档集合是可数 Document Collectionswill allow adding and removing documents所收集的文件允许添加和删除文件Document Collectionswill allow retrieving documents by ID所收集的文件允许通过ID检索文件Document Collectionswill allow prohibition of arbitrary fields所收集的文件允许禁止任意字段Document Collectionswill allow strong client-side typing of fields, like 'int' or 'int|array(int)|null'所收集的文件允许强大的客户端键入的字段,如“INT”或“INT |阵列(INT)| NULL'Document Collectionswill allow validators for fields所收集的文件允许字段校验器This componentwill allow using GridFS for storing files此组件允许使用存储文件GridFSThis componentwill be able to be used with Zend MVC此组件能够使用与Zend MVCThis componentwill provide a special object for Query此组件提供一个特殊的对象进行查询Querywill be countable查询被计数 Querywill be iterable (by returning Cursor for iteration)查询可迭代(迭代返回游标)This componentwill provide a special object for Cursor, which is returned by executing Query此组件提供执行的查询返回的光标,这是一个特殊的对象Cursorwill be countable光标是可数 Cursorwill be iterable光标被迭代的 This componentwill allow to set a specific class for documents in specific collections, as soon as it implements a special interface此组件允许设置一个特定的集合中的文档的特定的类,只要它实现了一个特殊的接口Cursor and Collectionwill return instances of these specific classes instead of usual Document classes光标和征收返回这些具体的类的实例,而不是通常的文件类

?

?

?

4. 4。Dependencies on Other Framework Components其他的框架组件上的依赖关系

?

Zend_Exception Zend_Exception异常Zend_Validate Zend_ValidateZend_Paginator Zend_PaginatorZend_Date Zend_Date的Zend_Controller (for using GridFS with MVC) Zend_Controller的(使用MVC的GridFS)

?

?

?

5. 5。Theory of Operation工作原理

Users create a link to Database, providing connection and db information to the Zend_Nosql_Mongo_Db.用户可以创建一个到数据库的链接,提供连接和DB信息的Zend_Nosql_Mong??o_Db。
Then they can get a link to a specific collection (which will be created, if not exists).然后,他们可以得到一个链接到一个特定的集合(,如果不存在将创建)。

Users can create a Zend_Nosql_Mongo_Object from any array, as soon as all its values (recursively) can be converted to Mongo types.用户可以从任何数组创建一个Zend_Nosql_Mong??o_Object,只要其所有值(递归)可以转换为蒙戈类型。They can save Zend_Nosql_Mongo_Object to any collection.他们可以节省Zend_Nosql_Mong??o_Object任何集合。Saving operation, as well as retrieving, returns an instance of Zend_Nosql_Mongo_Document, which has a specific _id and knows a name of its collection.节能运行,以及检索,返回的Zend_Nosql_Mong??o_Document实例,其中有一个具体_id的,并且知道其收集的名称。

Users can query any collection.用户可以查询任何集合。They can add more and more conditions to the query.他们可以添加越来越多的条件查询。When they are done, they can transform the query to a cursor and iterate or array-access it.当他们完成后,他们可以改变一个游标查询和迭代或数组访问。

Users can set a specific class for a document of specific collection.用户可以设置一个特定类的一个特定集合的文件。It must implement Zend_Nosql_Mongo_Document_Interface or, even better, inherit from Zend_Nosql_Mongo_Document.它必须实现Zend_Nosql_Mong??o_Document_Interface,或者甚至更好,从Zend_Nosql_Mong??o_Document继承。In this case, all cursors from queries on this collection will return the specified class.在这种情况下,所有游??标在此集合的查询将返回指定的类。

Users can make document schema more strict by providing validators, strong typing and disallowing arbitrary fields for any collection.用户可以通过提供校验,强类型,不允许任何集合的任意领域更加严格的文档架构。Values of each typed field will be tested if it has one of specified types.每个类型的字段的值将被测试,如果有指定的类型之一。If not, it will be converted to the first of the type in the list.如果不是,它会被转换为类型列表中的第一。If the conversion fails and 'null' is not allowed for the field, the exception is thrown instead of saving a document.如果转换失败,'null'是不是允许的领域,抛出异常,而不是保存文档。

?

6. 6。Milestones / Tasks里程碑/任务

?

Milestone 1: Initial proposal and prototype里程碑1:最初的建议和原型Milestone 2: All unit tests里程碑2:所有的单元测试Milestone 3: Working code, all unit tests passed里程碑3:工作的代码,所有的单元测试通过Milestone 4: Documentation里程碑4:文件

?

?

?

7. 7。Class Index类指数

?

Zend_Nosql_Mongo_Db Zend_Nosql_Mong??o_DbZend_Nosql_Mongo_Collection Zend_Nosql_Mong??o_CollectionZend_Nosql_Mongo_Document Zend_Nosql_Mong??o_DocumentZend_Nosql_Mongo_Document_Interface Zend_Nosql_Mong??o_Document_InterfaceZend_Nosql_Mongo_Object Zend_Nosql_Mong??o_ObjectZend_Nosql_Mongo_Object_Interface Zend_Nosql_Mong??o_Object_InterfaceZend_Nosql_Mongo_Query Zend_Nosql_Mong??o_QueryZend_Nosql_Mongo_Cursor Zend_Nosql_Mong??o_CursorZend_Nosql_Mongo_Id Zend_Nosql_Mong??o_IdZend_Nosql_Mongo_Date Zend_Nosql_Mong??o_DateZend_Nosql_Mongo_Regexp Zend_Nosql_Mong??o_RegexpZend_Nosql_Mongo_Code Zend_Nosql_Mong??o_CodeZend_Nosql_Mongo_Gridfs Zend_Nosql_Mong??o_GridfsZend_Nosql_Mongo_Gridfs_File Zend_Nosql_Mong??o_Gridfs_FileZend_Nosql_Mongo_Gridfs_Cursor Zend_Nosql_Mong??o_Gridfs_CursorZend_Nosql_Mongo_Gridfs_Mvc? Zend_Nosql_Mong??o_Gridfs_Mvc?

?

?

?

8. 8。Use Cases用例

?

9. 9。Class Skeletons类骨架

?

Jan 21, 2010 2010年01月21日,

MagnierMagnier Hi,嗨,

some news of this very interesting proposal ?一些这个非常有趣的建议的消息?

Permalink永久
  • Jan 21, 2010 2010年01月21日,

    Kazusuke Sasezaki Kazusuke Sasezaki Nosql..? NoSQL的..?I think that "Zend_Nosql" is not good namespace.我认为,“Zend_Nosql”没有良好的命名空间。

    Had not namespace(Zend_DocDb) been considered for document-oriented database?没有命名空间(Zend_DocDb)被认为是面向文档的数据库?
    @see CouchDb's proposal @看到CouchDB的建议

    Permalink永久
  • Feb 23, 2010 2010年02月23日,

    Coen Hyde 科恩海德 By the way my prototype mongodb adapter is coming along well.顺便说一下,我的原型mongodb的适配器是相处得很好。It's taken a little longer than i expected它比我预想的长一点. 。However it has become a completely different beast to what Valentin layed out above.然而,它已成为什么瓦伦丁上面奠定了一个完全不同的野兽。Shortly i will have it available to discuss.不久,我会讨论。Currently it does not support advanced queries, however i know Valentin is the author of mongodloid and figured i'd leave that to his area of expertise.目前它不支持高级的查询,但是我知道瓦伦丁mongodloid作者和我离开,他的专长领域。

    Permalink永久
  • Feb 23, 2010 2010年02月23日,

    John Wyles 约翰Wyles Can both of you please stay in touch with me as I am keenly interested in opening up the source for my own proprietary efforts.都请你留在我身边,因为我深知在为我自己的专有努力开辟源有兴趣的联系。Thanks!谢谢!

    Permalink永久
  • Mar 03, 2010 2010年03月03,

    Hector Virgen 海克特圣女 Anything we can do to keep this going?任何我们可以做,以保持这个部落的?Is there a github repo or something we can download / contribute to?是否有一个GitHub的回购或东西,我们可以下载/贡献?

    Permalink永久
  • Mar 12, 2010 2010年03月12日,

    Hector Virgen 海克特圣女 Sounds great, looking forward to testing it.听起来不错,期待测试。Have you considered adding support for master/slave configurations?你有没有考虑加入支持主/从配置吗?

    http://www.snailinaturtleneck.com/blog/2010/02/01/mongo-mailbag-masterslave-configuration/http://www.snailinaturtleneck.com/blog/2010/02/01/mongo-mailbag-masterslave-configuration/

    Permalink永久
  • Mar 24, 2010 2010年03月24日

    Augusto Pascutti 奥古斯托Pascutti No need of docs for now I think ...我认为现在没有需要的文件...
    There is no need to polish things too much for now, just the base idea of the implementation should do just fine ;]有没有必要波兰现在的东西太多,只是实施的基本想法应该做的就好了;]

    Permalink永久
  • Mar 29, 2010 2010年03月29日

    Coen Hyde 科恩海德 Sorry for taking so long.对不起,这么长时间。I didn't actually spend all that time writing docs我其实没有花所有的时间写作文档... ... ...I found a bug that required a significant modification of the source.我发现了一个错误,需要重大修改的源。

    Anyway here it ishttp://github.com/coen-hyde/Shanty-Mongo反正这里是http://github.com/coen-hyde/Shanty-Mongo

    The docs are a bit lack luster but it should give you the idea.该文档是有点缺乏光泽,但它应该给你的想法。

    Since this adapter is completely different to the proposal above i'll sign Zend's contributor form and create a separate proposal.由于此适配器是完全不同的上述建议,我会签署了Zend的贡献形式和创建一个单独的建议。

    One problem with my proposal is it requires php5.3.我的建议的一个问题是它需要PHP5.3。But i figured the Zend Framework would eventually move to 5.3 or would allow 5.3 only components in the extras.但我想,Zend框架,最终迁移到5.3,或将允许在额外5.3的组件。It would be possible to modify the adapter to not use late static binding but it should be a last resort as it would significantly reduce the developer friendliness.这将有可能修改适配器,不使用后期静态绑定,但它应该是最后的手段,因为它会显着降低开发人员友好。

    Any testing or feedback would is more than welcome.任何测试或反馈欢迎。Unit tests would be worshiped.单元测试会被崇拜。

    Permalink永久
  • Mar 30, 2010 2010年03月30日,

    Coen Hyde 科恩海德 Hi Dennis,您好丹尼斯,

    Re Connections: Yeah i haven't put much thought into the connection aspect at all, completely open to suggestion from those who know better.重新连接:我没有连接方面投入过多考虑所有,完全开放,更懂得那些建议。

    Re Validators and Filters: I did originally have them separate but it was a bit ugly having the configuration options for properties spread across multiple arrays.重新校验器和过滤器:我没有让他们分开,但它是一个有点难看分散在多个阵列的属性配置选项。Plus there are other requirements that are not validators or filters such as the 'AsReference' and planned 'AsPartial'.再加上有其他不属于验证器或过滤器,如“AsReference'计划”AsPartial“的要求。If it this is something that bothers people, maybe we can prefix the requirements, such as 'Filter:{$filterName}' and 'Validator:{$validatorName}'如果这是困扰人们的东西,也许我们可以前缀的要求,如“过滤器:{$ filterName}”和“验证:{$ validatorName}”

    Yes closures are supported in 5.3.支持5.3是封。The reason i have used closures in this instance is to allow the developers to supply custom requirement creators.我已经使用在这种情况下封的原因是为了让开发人员提供定制要求创作者。

    Permalink永久