git.tt-rss.org_fox_idiorm
Описание
Языки
- PHP96,2%
- Dockerfile3,8%
Idiorm
http://j4mie.github.com/idiormandparis/
Feature/API complete
Idiorm is now considered to be feature complete as of version 1.5.0. Whilst it will continue to be maintained with bug fixes there will be no further new features added from this point on. This means that if a pull request makes breaking changes to the API or requires anything other than a patch version bump of the library then it will not be merged.
Please do not submit feature requests or API breaking changes as they will be closed without ceremony.
A lightweight nearly-zero-configuration object-relational mapper and fluent query builder for PHP5 and above.
Tested on PHP 5.2.0+ - may work on earlier versions with PDO and the correct database drivers.
Released under a BSD license.
See Also: Paris, an Active Record implementation built on top of Idiorm.
Features
- Makes simple queries and simple CRUD operations completely painless.
- Gets out of the way when more complex SQL is required.
- Built on top of PDO.
- Uses prepared statements throughout to protect against SQL injection attacks.
- Requires no model classes, no XML configuration and no code generation: works out of the box, given only a connection string.
- Consists of one main class called
. Additional classes are prefixed withORM. Minimal global namespace pollution.Idiorm - 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 supported
- PSR-1 compliant methods (any method can be called in camelCase instead of underscores eg.
becomesfind_many()) - you'll need PHP 5.3+findMany()
Documentation
The documentation is hosted on Read the Docs: idiorm.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
Tests
Tests are written with PHPUnit and be run through composer
composer test
To make testing on PHP 5.2 (Idiorm maintains support back to this version of PHP) there
is a Docker setup in - check the readme in there for more.
Changelog
1.5.7 - released 2020-04-29
- Fix argument order in call to join() [CatalinFrancu] - issue #357
1.5.6 - released 2018-05-31
- Assign
tonullonself::$_dbto ensure PDO closes the connections [bleakgadfly] - issue #338reset_db()
1.5.5 - released 2018-01-05
- Add a docker setup for testing with PHP 5.2 (uses PHPUnit 3.6.12, which is the last version released compatible with PHP 5.2) [Treffynnon]
1.5.4 - released 2018-01-04
- Reset Idiorm state when a cached result is returned [fayland (and Treffynnon)] - issue #319
- Fix travis builds for PHP 5.2+ (adding 7.0 and 7.1) and document support for newer PHP versions [Treffynnon]
- Correct PHPDoc comments for
[kawausokun] - issue #325selectMany() - Add pdo_sqlite to the composer require-dev dependencies [qyanu] - issue #328
1.5.3 - released 2017-03-21
- Document the
method and add a note forraw_execute()in the querying documentation - [Treffynnon]get_db()
1.5.2 - released 2016-12-14
- Fix autoincremented compound keys inserts [lrlopez] - issue #233 and pull #235
- Add @method tags for magic methods [stellis] - issue #237
- Ensure
returns correctly when fed null or an empty string [tentwofour] - issue #268is_dirty() - Adding Code Climate badge to the readme file [e3betht] - issue #260
- Typo in navigation [leongersen] - issue #257
- Support named placeholders logging and test [m92o] - issue #223
reference undefined variablehaving_id_is()[Treffynnon] - issue #224$value- Documentation fix - ORM query output for
[uovidiu] - issue #306where_any_is() - Code style fix preventing nested loops from using the same variable names [mkkeck] - issue #301
- Document shortcomings of the built in query logger [Treffynnon] - issue #307
- Add phpunit to dev dependencies, add
script shortcut and fix PDO mock in test bootstrap [Treffynnon]composer test - New test for multiple raw where clauses [Treffynnon] - issue #236
- Remove PHP 5.2 from travis-ci containers to test against (note Idiorm still supports PHP 5.2 despite this) [Treffynnon]
1.5.1 - released 2014-06-23
- Binding of named parameters was broken [cainmi] - issue #221
1.5.0 - released 2014-06-22
- Multiple OR'ed conditions support [lrlopez] - issue #201
for selecting multiple records by primary key [lrlopez] - issue #202where_id_in()- Add compound primary key support [lrlopez] - issue #171
- Add a RAW JOIN source to the query [moiseevigor] - issue #163
- offsetExists() should return true for null values, resolves #181 [cainmi] - issue #214
- Custom cache callback functions [peter-mw] - issue #216
- Restrict null primary keys on update/delete, resolves #203 [cainmi] - issue #205
- Ensure parameters treated by type correctly [charsleysa] & [SneakyBobito] - issue #206 & issue #208
- Reduce the type casting on aggregate functions to allow characters [herroffizier] - issue #150
- Prevent invalid method calls from triggering infinite recursion [michaelward82] - issue #152
- Add time to query logging - adds query time parameter to external logger callback function [AgelxNash] - issue #180
- Changed database array access to ensure it's always properly setup [falmp] - issue #159
- Allow unsetting the db (
) to make the test work again [borrel] - issue #160ORM::set_db(null) - Correct issue #176: Ensure database setup before building select [kendru] - issue #197
- Add HHVM to travis-ci build matrix [ptarjan] - issue #168
- Improve where statement precendence documentation [thomasahle] - issue #190
- Improve testing checks [charsleysa] - issue #173
1.4.1 - released 2013-12-12
Patch update to remove a broken pull request - may have consequences for users of 1.4.0 that exploited the " now returns an associative array with the databases primary ID as the array keys" change that was merged in 1.4.0.
- Back out pull request/issue #133 as it breaks backwards compatibility in previously unexpected ways (see #162, #156 and #133) - sorry for merging this change into Idiorm - closes issue 156
1.4.0 - released 2013-09-05
now returns an associative array with the databases primary ID as the array keys [Surt] - issue #133find_many()- Calls to
andset()returnset_expr()allowing them to be chained [Surt]$this - Add PSR-1 compliant camelCase method calls to Idiorm (PHP 5.3+ required) [crhayes] - issue #108
- Add static method
to access current configuration [javierd] - issue #141get_config() - Add logging callback functionality [lalop] - issue #130
- Add support for MS SQL
limit style (automatically used for PDO drivers: sqlsrv, dblib and mssql) [numkem] - issue #116TOP - Uses table aliases in
clauses [vicvicvic] - issue #140WHERE - Ignore result columns when calling an aggregate function [tassoevan] - issue #120
- Improve documentation [bruston] - issue #111
- Improve PHPDoc on
[mailopl] - issue #106get_db() - Improve documentation [sjparsons] - issue #103
- Make tests/bootstrap.php HHVM compatible [JoelMarcey] - issue #143
- Fix docblock [ulrikjohansson] - issue #147
- Fix incorrect variable name in querying documentation [fridde] - issue #146
1.3.0 - released 2013-01-31
- Documentation moved to idiorm.rtfd.org and now built using Sphinx
- Add support for multiple database connections - closes issue #15 [tag]
- Add in raw_execute - closes issue #40 [tag]
- Add
- closes issue #84 [tag]get_last_statement() - Add HAVING clause functionality - closes issue #50
- Add
method - closes issue #85is_new - Add
support to the model instances allowing property access viaArrayAccessas well as$model['field']- issue #51$model->field - Add a result set object for collections of models that can support method chains to filter or apply actions to multiple results at once - issue #51 and #22
- Add support for Firebird with
andROWSresult set limiting and identifier quoting [mapner] - issue #98TO - Fix last insert ID for PostgreSQL using RETURNING - closes issues #62 and #89 [laacz]
- Reset Idiorm after performing a query to allow for calling
and thencount()[fayland] - issue #97find_many() - Change Composer to use a classmap so that autoloading is better supported [javierd] - issue #96
- Add query logging to
[tag]delete_many - Fix when using
alone it doesn't trigger query creation - closes issue #90set_expr - Escape quote symbols in "_quote_identifier_part" - close issue #74
- Fix issue with aggregate functions always returning
when isintsometimes required - closes issue #92float - Move testing into PHPUnit to unify method testing and query generation testing
1.2.3 - released 2012-11-28
- Fix issue #78 - remove use of PHP 5.3 static call
1.2.2 - released 2012-11-15
- Fix bug where input parameters were sent as part-indexed, part associative
1.2.1 - released 2012-11-15
- Fix minor bug caused by IdiormStringException not extending Exception
1.2.0 - released 2012-11-14
- Setup composer for installation via packagist (j4mie/idiorm)
- Add
method [sandermarechal]order_by_expr - Add support for raw queries without parameters argument [sandermarechal]
- Add support to set multiple properties at once by passing an associative array to
method [sandermarechal]set - Allow an associative array to be passed to
method [jordanlev]configure - Patch to allow empty Paris models to be saved ([j4mie/paris]) - issue #58
- Add
andselect_many- closing issues #49 and #69select_many_expr - Add support for
,MIN,AVGandMAX- closes issue #16SUM - Add
- closes issue #24group_by_expr - Add
to allow database expressions to be set as ORM properties - closes issues #59 and #43 [brianherbert]set_expr - Prevent ambiguous column names when joining tables - issue #66 [hellogerard]
- Add
method [CBeerta]delete_many - Allow unsetting of ORM parameters [CBeerta]
- Add
to get the records as associative arrays [Surt] - closes issue #17find_array - Fix bug in
with_log_queryand?supplied in raw where statements etc. - closes issue #57 [ridgerunner]%
1.1.1 - released 2011-01-30
- Fix bug in quoting column wildcard. j4mie/paris#12
- Small documentation improvements
1.1.0 - released 2011-01-24
- Add
methodis_dirty - Add basic query caching
- Add
methoddistinct - Add
methodgroup_by
1.0.0 - released 2010-12-01
- Initial release


