Download the PHP package indexnowkit/doctrine without Composer

On this page you can find all versions of the php package indexnowkit/doctrine. 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 doctrine

indexnowkit/doctrine — commit-safe IndexNow for Doctrine ORM

Listens to onFlush / postFlush, resolves the URLs of entities that declare #[IndexNow] rules, and hands them over only after the outermost transaction really committed, using a DBAL driver middleware. Rolled-back flushes submit nothing. Deletions are resolved before the row disappears.

Doctrine ORM 2.19+ and 3.x, DBAL 3.x and 4.x, PHP 8.2+.

github.com/indexnowkit/php (the php-* repositories are read-only splits)

Packagist Downloads CI Conformance PHPStan PHP

Symfony users: take indexnowkit/symfony-bundle — it wires all of this, adds the router bridge, the commands and the profiler panel. This package is for Doctrine without Symfony.

Why this over X

Most IndexNow packages are a thin HTTP client: you collect the URLs, you call it, you read the answer. This family does the part that goes wrong in practice:

Install

Standalone wiring

registerMiddleware() must run before the connection is created, because DBAL middlewares wrap the driver at connect time. In a typical bootstrap that means: build the ORM Configuration, call registerMiddleware(), then create the EntityManager, then call registerListener().

$autoFlush: true submits as soon as the URLs are handed over, which is what a script or a CLI process wants. Pass false and call $indexNow->flush() yourself at the end of the unit of work when you control the request cycle.

IndexNowDoctrine exposes the three pieces it builds — $wiring->staging, $wiring->listener, $wiring->middleware — so a container can register them individually instead.

A container that builds its graph lazily (Adapter\Services of the core) can hand the listener a closure and a sink instead of the facade, so registering the listener — and a request that writes nothing — builds no submitter, client or transport:

Declaring pages

The #[IndexNow] attribute comes from the core and is repeatable: one rule per family of public URLs.

Full model — sources, typed parameters, when / whenFields / fields / events / locales / host, inheritance and the semantics table — is in the core's attribute reference.

Routes

#[IndexNow(route: ...)] needs a RouteUrlResolverInterface bridge to a framework router. Standalone Doctrine has none, so a rule using route: fails at resolution time with "no router bridge is configured" (logged, never thrown into your flush). Use url:, urls: or resolver: instead, or implement the two-method RouteUrlResolverInterface for your own router and pass it as the router: argument above.

What the listener does

In onFlush, every scheduled insertion, update, deletion and changed collection is classified per rule through the core's ObjectChangeHandler:

In postFlush the deferred rules are resolved, every URL is logged at debug with the rule that produced it (indexnow: App\Entity\Post#post_amp (updated) -> https://example.com/amp/hello), and the batch is handed off.

Nothing here throws into your application. An invalid attribute, an unreadable when accessor or a failing resolver is logged on the indexnow channel and yields no URLs.

Renamed pages

When a field a route parameter reads changes — the slug, the category the path goes through — the old URL now answers 404. On an update the listener resolves the rule against the previous values of the change set and announces those URLs as deleted, next to the new URLs as updated, in the same flush (ObjectChangeHandler::renamed(), scenario A21). Route rules only; the old page must have been public (when true before the change); a field the URL depends on that cannot be written back (readonly, uninitialized) skips the old URL with a debug line. Nothing in this path throws into flush().

Commit safety

postFlush runs before the outer COMMIT whenever flush() is wrapped in wrapInTransaction() or a manual transaction, and Doctrine has no after-commit event. So:

If the driver exposes no native connection object, the listener logs a warning and submits inside the open transaction rather than losing the URLs.

Limitations

Compatibility with other listeners

Register the listener after anything that computes values the URLs depend on. With Gedmo Sluggable the slug is written in onFlush, so the IndexNow listener must run later; the Symfony bundle uses priority -100 for exactly this reason.

Compatibility

Public API of this package: the classes named in the changelog and the README, their constructor parameter names (pass optional arguments by name), and the DBAL middleware classes. The core's rules apply, including the "may grow" interfaces: bc.md; what this package itself keeps stable: docs/bc.md. Before 1.0 a minor version may break; every break is listed under "Changed" in CHANGELOG.md with the migration.

Notes for AI assistants

Documentation

Attribute reference core/docs/attribute-reference.md
Configuration core/docs/configuration.md
Operations and logging core/docs/operations.md
Testing core/docs/testing.md
Writing your own adapter core/docs/adapters.md
Design rationale docs/spec

Changelog: CHANGELOG.md. Versioning: SemVer; before 1.0 minor versions may break.

MIT. IndexNow is a trademark of its owner; this project is independent and not affiliated with Microsoft, Yandex or indexnow.org.


All versions of doctrine with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
indexnowkit/core Version ^0.13
doctrine/orm Version ^2.19 || ^3.0
doctrine/dbal Version ^3.8 || ^4.0
doctrine/event-manager Version ^1.2 || ^2.0
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 indexnowkit/doctrine contains the following files

Loading the files please wait ...