devmachine/guzzle-markus-client
Guzzle-powered PHP client for Markus Cinema System (MCS) XML APIs used by Forum Cinemas/Finnkino and others. Normalizes inconsistent XML, renames/regroups fields, and returns cleaner structured data for areas, events (movies) and shows.
Pros:
areas(), events(), shows()) maps cleanly to domain-driven logic (e.g., cinema locations, movies, showtimes).coming_soon, include_videos), enabling feature-rich integrations.Cons:
area, event, show) may not align with broader domain models (e.g., if using a microservices architecture).devmachine/guzzle-markus-client:1.0.*).MarkusClient to an interface).areas() to a CinemaLocation model or Vue/React props.HttpClient interface (e.g., with Mockery or Laravel’s Http tests).areas()) could hit API limits.area, event, and show map to your business domain? Will normalization conflicts arise?Laravel Ecosystem:
AppServiceProvider:
$this->app->singleton(MarkusClient::class, function ($app) {
return MarkusClient::factory(config('services.markus.api_url'));
});
Markus facade for cleaner syntax:
use Illuminate\Support\Facades\Facade;
class Markus extends Facade { protected static function getFacadeAccessor() { return MarkusClient::class; } }
Usage: Markus::events(['coming_soon' => true]).ShowResource, EventResource).Alternatives:
simplexml_load_string).nunomaduro/graphql-php).areas(), events()) in a non-critical feature (e.g., admin dashboard).forumcinemas.ee).areas() via Laravel Cache or Redis).spatie/laravel-queueable).$client = new \GuzzleHttp\Client();
$response = $client->get($apiUrl . '/XML', ['query' => ['area' => $areaId]]);
$xml = simplexml_load_string($response->getBody());
// Manually normalize to JSON.
"config": {
"preferred-install": "dist",
"allow-plugins": {
"composer/installers": true
}
},
"extra": {
"guzzle-version": "6.5.8" // Pin to avoid conflicts
}
foreach with string keys).cinema_areas, movies, and showtimes.areas(), events(), and shows() with caching.areas() for 24 hours.schedule() for dynamic showtime updates (e.g., via Laravel Echo or WebSockets).event['images']['poster']) into a CDN or local storage.http://forumcinemas.ee/XML).areas() → CinemaLocation model).Cache::remember with short TTLs for dynamic data (e.g., shows()).GuzzleException).shows() during peak hours).
Example:
Showtime::dispatch($areaId, $date)->delay(now()->addMinutes(5));
How can I help you explore Laravel packages today?