Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Flickr Bundle Laravel Package

rezzza/flickr-bundle

Symfony bundle that integrates the Flickr API into your application via the php-flickr library. It registers configurable services for photo, gallery, and account operations, letting you inject a ready-to-use Flickr client through the container instead of wiring credentials and HTTP handling yoursel...

View on GitHub
Deep Wiki
Context7

Getting Started

The bundle is a thin Symfony wrapper around the Flickr API (via phpflickr-style library), so the day-to-day value is: register once, inject a configured client, and stop re-implementing auth/HTTP plumbing.

  1. Install (expect an abandoned package — pin versions carefully):
    composer require rezzza/flickr-bundle:^1.0
    
  2. Register the bundle in app/AppKernel.php (this is a Symfony 2.x-era bundle; it will not auto-register on Symfony 4+):
    new Rezzza\FlickrBundle\RezzzaFlickrBundle(),
    
  3. Configure credentials — keep keys out of VCS via parameters.yml:
    # config.yml
    rezzza_flickr:
        api_key: %flickr_api_key%
        secret:  %flickr_secret%
    
  4. Look here first: Resources/config/services.yml in the bundle itself. The service id (typically rezzza.flickr) and constructor args are defined there, and that file is the ground truth for what's actually available — the README is thin.
  5. First use case: fetch a user's public photo stream from a controller or a small service:
    $flickr = $this->get('rezzza.flickr');
    $photos = $flickr->people_getPublicPhotos($nsid);
    

Implementation Patterns

Inject, don't fetch. Treat the Flickr client like any other infrastructure service. Define a small FlickrGallery service that takes the bundle's client as a constructor argument, so you can mock it in tests and swap caching strategies later.

Wrap the API surface. The wrapper exposes the underlying library's magic methods (photos_search, photosets_getPhotos, people_getPublicPhotos, etc.). Don't scatter these calls in controllers — create one repository-style class per resource (photos, photosets, users) and normalize the raw arrays into your own DTOs. The Flickr response shape is stable but awkward (photo / photos wrappers, string IDs).

Cache aggressively. Flickr rate-limits and every call is a network round-trip. Wrap repository methods in Symfony's cache service:

$key = 'flickr.photosets.'.$id;
if (false === $data = $this->cache->fetch($key)) {
    $data = $this->client->photosets_getPhotos($id);
    $this->cache->save($key, $data, 3600);
}

Build URLs from the response, not from strings. Flickr returns farm, server, id, secret fields; assemble https://farm{farm}.staticflickr.com/{server}/{id}_{secret}_{size}.jpg. Centralize this in one helper — sizes (_s, _m, _b, _z, _c) are easy to typo.

Background jobs for mutations. Uploads, set edits, and deletes should go through a message/queue worker rather than the request cycle, since Flickr calls can take seconds and occasionally time out.

Configuration injection tip: keep api_key/secret in environment-specific parameters rather than hard-coding, and never expose the secret to the frontend — only use the read-only public endpoints client-side if at all.

Gotchas and Tips

  • This is effectively unmaintained. Last release December 2015, 4 stars, no dependents. Audit the dependency chain for PHP 7/8 compatibility before adopting; expect to fork it or, more realistically, use the underlying phpflickr/rezzza/flickr library directly and skip the bundle entirely if you're not on Symfony 2.
  • Symfony version lock-in. The bundle predates autowiring and Flex. On Symfony 3+ you'll need manual service definition; on Symfony 4+ it may simply not boot. Plan a migration path.
  • Service id confusion. The logical name (rezzza.flickr) vs. class-based injection differ across versions — confirm in services.yml before writing use statements.
  • Auth token handling. Flickr's OAuth flow requires a per-user token and token secret. The bundle stores what you give it; it does not manage token refresh or persistence for you. Store tokens in your own entity and set them on the client per request.
  • Silent failures. Older phpflickr code often returns false or an error object rather than throwing. Always check if ($result === false) — a missing token or bad key won't raise an exception.
  • Error code 100 / 105 are the ones you'll hit first: invalid API key or invalid signature. Check that secret matches the key pair and that you're not mixing REST and OAuth endpoints.
  • format and per_page quirks. Some methods ignore per_page above 500; pagination is 1-indexed. Don't assume total is accurate for large sets.
  • Extension point: the cleanest escape hatch is to register your own service that composes the bundle's client, rather than subclassing it. That way, when you eventually replace the bundle with a maintained client, only one wrapper file changes.
  • Testing: stub the client interface in unit tests and keep a small fixture set of real Flickr JSON payloads — the nesting is surprising enough that hand-written arrays drift from reality.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core