- Can I use this bundle in Laravel, or is it strictly for Symfony?
- This bundle is designed for Symfony, not Laravel. While it leverages Symfony’s dependency injection and configuration systems, Laravel developers would need to adapt it manually or explore Laravel-specific alternatives like `mobiledetectlib/mobile-detect` or `51degrees/mobile-detect`.
- What Laravel versions does this bundle support?
- This bundle does not natively support Laravel. It’s built for Symfony (likely 5.x or 6.x), so compatibility with Laravel isn’t guaranteed. You’d need to manually bridge Symfony’s components (e.g., ServiceContainer) or refactor for Laravel’s IoC container.
- Do I need a WURFL API subscription to use this bundle?
- Yes, the bundle requires access to WURFL’s device database, either via their cloud API (paid subscription) or by hosting local WURFL XML/JSON files. Check WURFL’s [official pricing](https://www.scientiamobile.com/products/wurfl/) for free tier options or self-hosted alternatives.
- How do I configure the bundle for local WURFL files instead of the API?
- Configure the bundle via `config/packages/acf_wurfl.yaml` by setting `wurfl.local_file_path` to your WURFL XML/JSON file path. Ensure the file is updated regularly to avoid stale device data. The bundle’s README should outline the exact syntax for local file integration.
- What device capabilities can I detect with this bundle?
- The bundle exposes WURFL’s full capability set, including form factors (phone/tablet/desktop), OS (iOS/Android), browser (Chrome/Safari), screen resolution, input methods (touch/keyboard), and carrier details. Query capabilities via the `WurflManager` service in your controllers or Twig templates.
- How does caching work with this bundle? Can I use Redis?
- The bundle likely caches WURFL data in Symfony’s cache system (e.g., APCu, file-based). To use Redis, configure Symfony’s cache adapter in `framework.yaml` and ensure the bundle respects your cache pool. Check the bundle’s source for cache-related configuration options.
- What happens if the WURFL API is down or the local file is missing?
- The bundle’s behavior depends on its error-handling logic. Test with a missing API or file to confirm graceful degradation (e.g., default device profiles or exceptions). If critical, implement a fallback mechanism in your code to avoid runtime failures.
- Are there performance concerns with WURFL’s device detection?
- WURFL’s XML/JSON parsing or API calls can add latency, especially for high-traffic apps. Profile detection requests in staging to measure impact. Optimize by caching aggressively (e.g., Redis) and consider lightweight alternatives like `mobiledetectlib/mobile-detect` for less complex use cases.
- How do I integrate device detection into Laravel routes or middleware?
- Since this bundle isn’t Laravel-native, you’d need to manually inject the `WurflManager` into a service or middleware. For example, create a Laravel middleware that fetches device data via the bundle’s service and attaches it to the request. Example: `app('wurfl')->getDeviceCapabilities($request->userAgent)`.
- What are the alternatives to this bundle for Laravel device detection?
- For Laravel, consider `mobiledetectlib/mobile-detect` (lightweight, user-agent parsing), `51degrees/mobile-detect` (open-source, PHP port), or `laravel-user-agent` (Laravel-specific wrapper). These avoid Symfony dependencies and may offer better Laravel integration.