exs/feeds-cambuilder-bundle

This bundle reads CamBuilder's api to get live performers' Ids.

v1.0.2 2017-10-16 19:35 UTC

This package is auto-updated.

Last update: 2024-12-29 05:16:15 UTC


README

Build Status

Installation

This bundle uses PHP's native Memcached objects.

Make sure the memcached module is enabled in your PHP's installation.

Require the bundle using composer

$ composer require exs/feeds-cambuilder-bundle

Enable the bundle in AppKernel

<?php
// app/AppKernel.php

class AppKernel extends Kernel
{
    // ...
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new EXS\FeedsCambuilderBundle\EXSFeedsCambuilderBundle(),
        );
    }
}

Configuration

Some configuration is available to manage the cache.

# Default values
exs_feeds_cambuilder:
    cache_ttl: 300
    memcached_host: 'localhost'
    memcached_port: 11211

Usage

// Returns 100 performer Ids by default.
$performerIds = $container
    ->get('exs_feeds_cambuilder.feeds_reader')
    ->getLivePerformers()
;

// Can specify the number of performers to return
$performerIds = $container
    ->get('exs_feeds_cambuilder.feeds_reader')
    ->getLivePerformers(20)
;

A command is also available if you want to force refresh the memcached record.

$ app/console feeds:cambuilder:refresh-live-performers --env=prod --no-debug

// Can specify number of performers and cache lifetime
$ app/console feeds:cambuilder:refresh-live-performers --limit=500 --ttl=3600 --env=prod --no-debug