Download the PHP package kinetis/persistence without Composer

On this page you can find all versions of the php package kinetis/persistence. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package persistence

kinetis/persistence
Runtime-matched MySQL and Postgres clients with a transaction safety net

Packagist Version Packagist Downloads PHP Version License CI


Part of Kinetis, a non-blocking PHP framework for API-first applications, developed in the kinetis-dev/kinetis monorepo. Usable standalone: it depends on no Kinetis package.

MySQL and Postgres through runtime-matched drivers — native ext-mysqli/ext-pgsql async clients under a persistent worker, PDO under boot-and-die — all presenting this package's own Contract\SqlLink/Contract\SqlTransaction abstraction, so nothing above the driver needs to know which one it's talking to.

ConnectionDefinition holds the dialect (mysql or pgsql), the driver selection, host, port (the dialect's own by default), database, credentials, ConnectionOptions — charset, TLS, connect timeout, pool width — and how many connections to open at construction. SqlConnectionFactory::create() builds the client its driver selection names: native (mysqli or ext-pgsql async), pdo, or auto — native under FrankenPHP worker mode or RoadRunner, PDO everywhere else. SqlConnectionFactory::singleSession() builds a PDO client pinned to the first session it opens, which never opens a replacement: the client for work that lives in the session, such as a session-scoped advisory lock. An ordinary PDO client gives up its session after a failed statement or beginTransaction() and opens a fresh one on its next call, without sending the failed statement again.

What the host owns

Failures

Every persistence failure is an Exception\SqlException:

QueryException::isUniqueViolation() is the portable unique-conflict classifier, true on every driver for PostgreSQL's SQLSTATE 23505 and for the MySQL family's error 1062, ER_DUP_ENTRY. MySQL and MariaDB report SQLSTATE 23000 for every integrity violation, a NOT NULL one included, so there the error number decides and the SQLSTATE cannot. Classifying a failure changes nothing about it: the statement is not retried and the error is not suppressed.

Let a unique key settle a race instead of reading before the write, since two requests can both find a value free, and catch the violation outside TransactionGuard::transaction(), which has already rolled the transaction back by then.

Instrumentation

Pass a Contract\SqlInstrumentation as either factory method's second argument to receive what every client and transaction reports: a query dispatched, sent to the server, and reaped; a transaction started, and ended as commit, rollback or unknown. A transaction's own BEGIN, COMMIT and ROLLBACK are not query moments — the started/ended pair is what reports them — while every statement run through the transaction reports all three. A client contains any failure its instrumentation throws, so instrumentation cannot change a query result, a transaction outcome or the release of a connection.

Every moment runs inline on the query's Fiber: an implementation must not suspend, must stay bounded, and must perform no blocking I/O — anything it exports goes to separately owned, bounded infrastructure. A client keeps its instrumentation for its whole lifetime, so the implementation holds no mutable request or unit-of-work state. queryDispatched() receives the complete SQL text; bound parameter values are never passed, but the text can carry literals, so never log or export it verbatim.

With Kinetis

kinetis/database-bridge builds the clients from DB_* configuration, binds the default connection, provides lazy request-scoped TransactionGuard cleanup, and reports through Kinetis telemetry.

Installation

Requires PHP 8.4+, plus the extension for the driver you use: ext-mysqli, ext-pgsql (with ext-sockets), ext-pdo_mysql or ext-pdo_pgsql. Full documentation: kinetis.dev/docs/persistence.html.

License

MIT — see LICENSE.


All versions of persistence with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
psr/log Version ^3.0.2
revolt/event-loop Version ^1.0.9
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kinetis/persistence contains the following files

Loading the files please wait ...