voku/paris
最新稳定版本:v1.7.6
Composer 安装命令:
composer require voku/paris
包简介
A lightweight Active Record implementation for PHP5, built on top of Idiorm
关键字:
README 文档
README
Paris
http://j4mie.github.com/idiormandparis/
WARNING: this is only a Maintained-Fork from: "https://github.com/j4mie/paris/"
INFO: you can use my Simple Active Record lib instad of Paris: "https://github.com/voku/simple-active-record"
Installation
The recommended installation way is through Composer.
$ composer require voku/paris
A lightweight Active Record implementation for PHP5.
Built on top of Idiorm.
Tested on PHP 5.3+ - may work on earlier versions with PDO and the correct database drivers.
Released under a BSD license.
Features
- Extremely simple configuration.
- Exposes the full power of Idiorm's fluent query API.
- Supports associations.
- Simple mechanism to encapsulate common queries in filter methods.
- Built on top of PDO.
- Uses prepared statements throughout to protect against SQL injection attacks.
- Database agnostic. Currently supports SQLite, MySQL, Firebird and PostgreSQL. May support others, please give it a try!
- Supports collections of models with method chaining to filter or apply actions to multiple results at once.
- Multiple connections are supported
Documentation
The documentation is hosted on Read the Docs: paris.rtfd.org
Building the Docs
You will need to install Sphinx and then in the docs folder run:
make html
The documentation will now be in docs/_build/html/index.html
Let's See Some Code
/** * User: a sample user-class * * @property-read int $id * @property-read string $first_name */ class User extends Model { public function tweets() { return $this->has_many('Tweet'); } public function getId() { return $this->id; } public function getFirstName() { return $this->first_name } } /** * Tweet: a sample twitter-class * * @property-read int $id * @property-read string $text */ class Tweet extends Model { } $user = Model::factory('User') ->where_equal('username', 'j4mie') ->find_one(); $user->first_name = 'Jamie'; $user->save(); $tweets = $user->tweets()->find_many(); foreach ($tweets as $tweet) { echo $tweet->text; }
voku/paris 适用场景与选型建议
voku/paris 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7.1k 次下载、GitHub Stars 达 7, 最近一次更新时间为 2015 年 08 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「orm」 「Active Record」 「model」 「paris」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 voku/paris 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 voku/paris 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 voku/paris 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Propel2 is an open-source Object-Relational Mapping (ORM) for PHP 5.5 and up.
Kinikit - PHP Application development framework MVC component
PHP Interface for Babel Street Text Analytics
A Symfony extension to get active class base on current bundle/controller/action
PHP Database ORM for Symfony1. Do NOT use for new projects: please move to a newest Symfony release and Doctrine2
LDAP user provider bundle for Symfony 6.4
统计信息
- 总下载量: 7.1k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 24
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-2-Clause
- 更新时间: 2015-08-02