Mostly using autowiring to inject deps.
The only tricky part was for import because all producer use the same class and have a different alias. So we must write them down in the service definition, autowiring doesn't work in that case.
Usually:
- if a controller has a constructor, it means injected services are at least re-used once in actions
- otherwise, service are injected per action
Looks like parameter for the `->dispatch(` have been flipped (event first then event name).
Define events should now extends `Symfony\Contracts\EventDispatcher\Event`
- disable autowiring for Event (because the Entry entity was injected)
- rename `getClient()` for test to `getTestClient()` to avoid error while overriding (from `BrowserKitAssertionsTrait`)
As baggy theme was removed and material is the only remaining theme, we don't need a theme switched anymore.
So:
- move all `*.twig` files from the material theme folder to the root
- remove useless translations
I've noticed that the endpoint `/api/entries/exists` used by the "Sweep
articles" feature on the Android app failed almost all the time on my
instance.
After checking the corresponding method I found that
`EntryRestController::getEntriesExistsAction()` could be improved.
Here is the former way the method worked:
```
for id in [list of ids]
get full entry by id
if null
get full entry by given id
return array of ids or array of hashes
```
With this behavior on my instance I could expect up to 13k SQL requests
when sweeping articles from the Android app. Morever the repository
fetches all fields (content included) while the method only returns ids
or hashes.
The new behavior is described as follow:
```
get ids, hashes by [list of ids]
merge with provided [list of ids] // this part will complete the final
// array with not found ids
return array of ids or array of hashes
```
In my case this change reduces the number of SQL requests to only 135
(_considering one request for 50 articles_)
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
- Add missing translations
- Add some tests
- Add `/api/taggingrule/export` API endpoint
- Add baggy theme
- Add error message when importing tagging rules failed
- Also fix all translations (I think we are good now)
Simplify the logic from #3158 by hashing all the urls from the request,
and only doing a search by hash. This allows to get performance benefits
from the new indexed hash column even when using older clients that do
not hash the URL in the request.
Fixes: #3158, #3919
Signed-off-by: Olivier Mehani <shtrom@ssji.net>
detail=metadata will nullify the content field of entries in order to
make smaller responses.
detail=full keeps the former behavior, it sends the content of entries.
It's the default, for backward compatibility.
Fixes#2817
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
The expect parameter enables an application to request the whole entry
or only the id when requesting its deletion.
`expects` defaults to `entry` to prevent any API breakage.
Fixes#3711
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
- Adds a new `search` key to `src/Wallabag/ApiBundle/Resources/config/routing_rest.yml`
- Reuses the `getBuilderForSearchByUser` method from the EntryRepository
- Supports, `term`, `page`, and `perPage` query parameters
- Some very basic tests