doctrine/couchdb-odm-bundle
最新稳定版本:v2.1-alpha1
Composer 安装命令:
composer require doctrine/couchdb-odm-bundle
包简介
Symfony2 Doctrine CouchDB Bundle
关键字:
README 文档
README
This bundle integrates Doctrine CouchDB ODM and Clients into Symfony2.
STABILITY: Alpha
Installation
composer require doctrine/couchdb-odm-bundle- Add
Doctrine\Bundle\CouchDBBundle\DoctrineCouchDBBundleto your Kernel#registerBundles() method - If you do not use composer, do not forget to add autoloader for the Doctrine\CouchDB, Doctrine\ODM\CouchDB and Doctrine\Bundle namespaces
To use the annotations, register them in your app/autoload.php file:
use Doctrine\Common\Annotations\AnnotationRegistry;
AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
Documentation
See the Doctrine CouchDB ODM documentation for more information.
Configuration
The configuration is similar to Doctrine ORM and MongoDB configuration for Symfony2 as its based on the AbstractDoctrineBundle aswell:
doctrine_couch_db:
client:
dbname: symfony
odm:
auto_mapping: true
To dump the configuration reference of this bundle
php app/console config:dump-reference doctrine_couch_db
Annotations
An example of how to use annotations with CouchDB and Symfony:
<?php
namespace Acme\DemoBundle\CouchDocument;
use Doctrine\ODM\CouchDB\Mapping\Annotations as CouchDB;
/**
* @CouchDB\Document
*/
class User
{
/** @CouchDB\Id */
private $id;
}
Services
You can access to CouchDB services:
<?php
namespace Acme\DemoBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class DefaultController extends Controller
{
public function indexAction()
{
$client = $this->container->get('doctrine_couchdb.client.default_connection');
$documentManager = $this->container->get('doctrine_couchdb.odm.default_document_manager');
}
}
View directories
In @YourBundle/Resources/couchdb/ you can add design documents and corresponding views and have Doctrine
CouchDB register them up automatically. For example if you had a design doc "foo" and a view "bar" you could
add the following files and directories:
Resources/couchdb/
└── foo/
└── views/
└── bar/
├── map.js
└── reduce.js
You can then update this design document from the CLI by calling:
./app/console doctrine:couchdb:update-design-doc foo
Where foo is the name of the design document.
doctrine/couchdb-odm-bundle 适用场景与选型建议
doctrine/couchdb-odm-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 18.52k 次下载、GitHub Stars 达 49, 最近一次更新时间为 2011 年 11 月 01 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「persistence」 「couchdb」 「symfony」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 doctrine/couchdb-odm-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 doctrine/couchdb-odm-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 doctrine/couchdb-odm-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
This bundle provides tools to build persistence-agnostic storage layer.
The DreamFactory(tm) CouchDB Service.
Propel2 is an open-source Object-Relational Mapping (ORM) for PHP 5.5 and up.
Kinikit - PHP Application development framework MVC component
The bundle for easy using json-rpc api on your project
Doctrine2 managers builder
统计信息
- 总下载量: 18.52k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 49
- 点击次数: 22
- 依赖项目数: 0
- 推荐数: 9
其他信息
- 授权协议: LGPL
- 更新时间: 2011-11-01