oh/instagram-bundle
A Symfony bundle for integrating Instagram into your PHP application, providing ready-made services and configuration to connect to the Instagram API and bring media, user data, or feeds into your site.
This is a Symfony2-era bundle that exposes the sesser/instaphp Instagram client as a container service. Expect to spend more time making it install than using it.
composer.json (usually "oh/instagram-bundle": "~1.0" or dev-master). The bundle's own constraints almost certainly pin Symfony 2.x and PHP 5.x, so composer why-not oh/instagram-bundle symfony/framework-bundle is your first diagnostic step before you hit a wall on modern projects.app/AppKernel.php:
new Oh\InstagramBundle\OhInstagramBundle(),
app/config/config.yml. You will need client_id, client_secret, and (for read operations) an access_token. Verify the exact key names in DependencyInjection/Configuration.php — they vary across old bundles.Resources/config/services.yml (or .xml) and DependencyInjection/OhInstagramExtension.php. The client is typically aliased to something like oh_instagram.client; confirm before wiring it anywhere.$api = $this->get('oh_instagram.client');
$result = $api->Users->Recent($userId);
The exact call shape depends on the Instaphp version vendored in; inspect the Instaphp namespace in vendor/sesser/instaphp for the available endpoints.If step 1 fails on Composer conflicts, stop and evaluate whether a maintained Graph API client is a better fit — it almost always is.
InstagramFeedProvider service that takes the bundle's client as a constructor argument. This isolates your application from the vendor library's quirks and lets you swap implementations later without touching controllers.TokenStore service. Do not scatter token exchange logic across controllers.app/console instagram:sync command that iterates tracked accounts and writes to your database keeps API traffic out of the request cycle and gives you a retry point.$this->get() in new code where possible; define services in your bundle's services.yml and let autowiring/arguments do the work. This also makes unit testing feasible.{{ instagram_feed('account') }} function backed by your cached provider is cleaner than doing API calls in templates.composer.json constraints first; if they conflict, don't waste time on --ignore-platform-reqs in production.%parameters% for credentials rather than proper config nodes, meaning env-specific overrides behave unexpectedly. Keep secrets in parameters.yml/parameters.yml.dist and never commit tokens.try/catch around the Instaphp exception classes and treat rate-limit responses as retryable with backoff; treat 400/401 as fatal so you don't hammer the API.expires_at alongside the token and refresh proactively; there's usually no helper in the bundle for this.app/logs/dev.log, and temporarily set the client to log raw HTTP bodies. The bundle rarely logs anything itself.services.yml (loaded after the bundle). This is the cleanest way to substitute a fake client in tests without editing vendor code.composer update blindly. Because dependencies are so old, a lock-file bump is likely to pull a version that breaks the bundle's assumptions; pin major versions and commit the lock file.How can I help you explore Laravel packages today?