Codync
免費、開源的 1:1 替代方案,取代 Grok Bot 與 Muse。從 iPhone、Mac 或 Linux 桌面將 Claude Code、Codex、Cursor 與 40+ 程式碼代理人作為持續機器人傳訊。群組聊天、主題串…
AI 翻譯
尚未收集儲存庫資訊。
尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
製作者的介紹僅有上面的一句話。 更多詳情請閱讀儲存庫 README。 儲存庫 README ↗
正在載入完整 README。
檢視完整 README ↗TL;DR Others suck, we can do it better.
Why to create another ORM? There are not enough ORM implementations for PHP already?
Yes, there are a lot of implementations:
This implementation will have the following features:
How to achieve this features? The main goal of Doctrine seems to abstract everything - at the end you should be able to replace the whole DBMS behind your app and switch from postgresql to sqlite. That requires not only a lot of sources. It also requires some extra cycles to get these abstraction to work.
This library will only produce ANSI-SQL that every SQL database should understand. Other queries have to be written by hand. This has two reasons:
This library will not fetch any mistake a developer can make. It aims to be a helper to store data in your database. Not
to replace your database and your knowledge how to use this database. You can make a lot of errors - less than without
this library but still a lot. When you make an error that is not catched (mostly we catch only mistakes that would
cause a fatal error instead) you will get a PDOException.
Install it via composer, configure it, use it.
composer require tflori/orm
<?php
$entityManager = new ORM\EntityManager([
ORM\EntityManager::OPT_CONNECTION => ['pgsql', 'mydb', 'postgres']
]);
$user = $entityManager->fetch(User::class, 1);
echo $user->username;
Read the docs for more information.
#52 Composite primary keys require SQLite >= 3.15 (or another database) to get the synchronization after insert working. The syntax used got added in SQLite 3.15.
Please follow PSR-2 style guide. The api reference documentation (docs/reference.md and docs/reference/) is
generated by the GitHub Pages workflow and not part of the repository. To preview it locally generate it with:
$ docker run --rm --user $(id -u) -v $(pwd):/data iras/phpdoc:3.7.1-twig.extensions --template docs/_reference -c phpdoc.xml --force --visibility public,protected
Protected elements are only included when they are tagged with @api (see docs/_reference/class.md.twig). If you
generated the reference without --user before, remove docs/reference.md and docs/reference/ first (they are
owned by root).
Before creating a pull request please make sure that the unit tests are green and the coverage remains the same:
$ docker run --rm --user $(id -u) -v $(pwd):/app -w /app iras/php7 vendor/bin/phpunit
### with coverage:
$ docker run --rm --user $(id -u) -v $(pwd):/app -w /app iras/php7 php -dzend_extension=xdebug.so vendor/bin/phpunit --coverage-text