Skip to content
/ paris Public
forked from j4mie/paris

A lightweight Active Record implementation for PHP5, built on top of Idiorm.

Notifications You must be signed in to change notification settings

skv1991/paris

 
 

Repository files navigation

Paris

Build Status Latest Stable Version Total Downloads

http://j4mie.github.com/idiormandparis/


Feature complete

Paris 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.

Не отправляйте пожалуйста запросы на новые возможности или pull-реквесты поскольку они будут попросту закрываться.


Легковесная реализация паттерна Active Record для PHP5.

Построена на основе Idiorm.

Протестирована на PHP 5.2.0+ - может работать на более ранних версиях с расширением PDO и корректными драйверами баз данных.

Выпущена под лицензией BSD.

Возможности

  • Очень простая конфигурация.
  • Показывает всю мощь API "текучего интерфейса" запросов из Idiorm.
  • Поддержка связей (между моделями).
  • Простой механизм для инкапсуляции простых запросов в методах фильтрации.
  • Построена на основе PDO.
  • Использует prepared statements для защиты от SQL иньекций.
  • Не привязана к типу БД. Поддерживает SQLite, MySQL, Firebird и PostgreSQL. Может поддерживать и другие, попробуйте!
  • Поддерживает коллекции моделей с цепочкой методов для фильтрации или применения действий к множеству записей за раз.
  • Поддерживает множество соединений

Документация

Данная документация размещена на Read the Docs: paris.rtfd.org

Сборка документации

Вам потребуется установить Sphinx и затем в директории docs выполнить:

make html

Документация появится в docs/_build/html/index.html

Взглянем на код

class User extends Model {
    public function tweets() {
        return $this->has_many('Tweet');
    }
}

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;
}

Лог изменений

1.5.6 - релиз 2017-03-21

  • Позволяет IDE выполнять автодополненте при использовании цикла foreach над результатом выполнения find_many() [stratoss] - issue #128
  • Опишите @property в комментарии PHPDoc для того, чтобы IDE прлизводила автодополнение свойств модели [Treffynnon]

1.5.5 - релиз 2016-12-14

  • Fix некорректной генерации имени таблицы в join [Ralphunter] - issue #109
  • Добавлен phpunit, как dev-зависимость, так же composer скрипт (composer test) для простого запуска тестов [Treffynnon]
  • Global setting to allow static requests to avoid being forced in to using the namespace + class as the auto table name [michaelward82] - issue #100
  • Document conflict between static Model calling and auto_prefix_models [michaelward82] - issue #102
  • Доавлены теги @method для магических методов [stellis] - issue #104
  • Добавлен недостающий магический метод __unset() [qyanu] - issue #106
  • Удаление PHP 5.2 из контейнеров travis-ci to test against (примечание не смотря на это, Idiorm продолжает поддерживать PHP 5.2) [Treffynnon]

1.5.4 - релиз 2014-09-23

  • Корректировка возвращаемого значения в docblock для 2 функций модели [michaelward82] - issue #99

1.5.3 - релиз 2014-06-25

  • Remove erroneously committed git merge backup file

1.5.2 - релиз 2014-06-23

  • Paris incorrectly relying on old Idiorm version in the composer.json [ilsenem] - issue #96

1.5.1 - релиз 2014-06-22

  • Remove HHVM build target from travis-ci as there is a bug in HHVM

1.5.0 - релиз 2014-06-22

1.4.2 - релиз 2013-12-12

Patch update to remove a broken pull request - may have consequences for users of 1.4.0 and 1.4.1 that exploited the "find_many() 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 Idiorm issues #162, #156 and #133) - sorry for merging this change into Paris - closes Idiorm issue 156

1.4.1 - релиз 2013-09-05

1.4.0 - релиз 2013-09-05

  • Call methods against model class directly eg. User::find_many() - PHP 5.3 only [Lapayo] - issue #62
  • find_many() now returns an associative array with the databases primary ID as the array keys [Surt] - see commit 9ac0ae7 and Idiorm issue #133
  • Add PSR-1 compliant camelCase method calls to Idiorm (PHP 5.3+ required) [crhayes] - issue #59
  • Allow specification of connection on relation methods [alexandrusavin] - issue #55
  • Make tests/bootstrap.php HHVM compatible [JoelMarcey] - issue #71
  • belongs_to doesn't work with $auto_prefix_models (issue #70)

1.3.0 - релиз 2013-01-31

  • Documentation moved to paris.rtfd.org and now built using Sphinx
  • Add support for multiple database connections [tag] - issue #15
  • Allow a prefix for model class names - see Configuration in the documentation - closes issues #33
  • Exclude tests and git files from git exports (used by composer)
  • Implement set_expr - closes issue #39
  • Add is_new - closes issue #40
  • Add support for the new IdiormResultSet object in Idiorm - closes issue #14
  • Change Composer to use a classmap so that autoloading is better supported [javierd] - issue #44
  • Move tests into PHPUnit to match Idiorm
  • Update included Idiorm version for tests
  • Move documentation to use Sphinx

1.2.0 - релиз 2012-11-14

  • Setup composer for installation via packagist (j4mie/paris)
  • Add in basic namespace support, see issue #20
  • Allow properties to be set as an associative array in set(), see issue #13
  • Patch in idiorm now allows empty models to be saved (j4mie/idiorm see issue #58)

1.1.1 - релиз 2011-01-30

1.1.0 - released 2011-01-24

  • Add is_dirty method

1.0.0 - released 2010-12-01

  • Initial release

About

A lightweight Active Record implementation for PHP5, built on top of Idiorm.

Resources

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%