BabDev / Pagerfanta

Pagination library for PHP applications with support for several data providers
Other
383 stars 170 forks source link

Cannot install pagerfanta/doctrine-orm-adapter #15

Closed ruudk closed 3 years ago

ruudk commented 4 years ago
$ composer req babdev/pagerfanta-bundle pagerfanta/doctrine-orm-adapter
Using version ^2.5 for babdev/pagerfanta-bundle
Using version ^2.4 for pagerfanta/doctrine-orm-adapter
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 2 installs, 0 updates, 0 removals
  - Installing pagerfanta/pagerfanta (v2.4.1): Loading from cache
  - Installing babdev/pagerfanta-bundle (v2.5.0): Loading from cache

How come it's installing pagerfanta/pagerfanta instead of pagerfanta/doctrine-orm-adapter?

mbabker commented 4 years ago

The bundle still depends on the pagerfanta/pagerfanta monopackage until 3.0, at which point it'll shift to depending only on pagerfanta/core and pagerfanta/twig (I did it that way to not cause too much of a headache to users of the bundle by ripping the adapter classes out of the dependency tree in a minor update). And the pagerfanta/pagerfanta package is configured to replace all of the split packages in Composer (same as if you installed symfony/symfony instead of the individual components).

So you're fine for now.

ruudk commented 4 years ago

Oke that explains it.

I solved it by removing this dependency and just use pagerfanta/pagerfanta. If I don't I get weird errors on CI where it cannot find the Pagerfanta Twig extension. Locally it just works, but PHPStorm complains in the composer.json that the orm adapter package is not installed. So it's giving weird behaviour.

mbabker commented 4 years ago

I think that's a quirk of the Composer integration of PhpStorm, it doesn't seem to know how to handle replaced packages so it treats it as not installed.

Aerendir commented 4 years ago

@mbabker , I have the same problem, but it seems unrelated to PHPStorm.

In the vendor folder, I don't have the package pagerfanta/doctrine-orm-adapter.

So, the question is, in the meantime, where can we get the class Pagerfanta\Doctrine\ORM\QueryAdapter?

mbabker commented 4 years ago

Is pagerfanta/pagerfanta installed? If you've got a dependency relying on the monopackage, then it will replace all of the split packages; the monopackage will have the Pagerfanta\Doctrine\ORM\QueryAdapter inside of it.

Aerendir commented 4 years ago

My comment was wrong: the real question is: in the mean time, how can we solve the deprecation notice?

mbabker commented 4 years ago

Just use the new class. As long as you have either the pagerfanta/pagerfanta package (the full library) or the pagerfanta/doctrine-orm-adapter package (only the ORM adapter) installed it will be there.

The wording in the deprecation notice is because I want people to stop relying on the monorepo in favor of the split packages, but that's so new it's going to take a while to trickle throughout the ecosystem. But, the monorepo will always be an installable package and always contain all of the library code.