<?php namespace Qcr\QcrTheme\Http\Controller;

use Anomaly\Streams\Platform\Http\Controller\PublicController;
use Anomaly\VariablesModule\Variable\Contract\VariableRepositoryInterface;

/**
 * Class DomainsController
 *
 * @link   http://pyrocms.com/
 * @author PyroCMS, Inc. <support@pyrocms.com>
 * @author Ryan Thompson <ryan@pyrocms.com>
 */
class DomainsController extends PublicController
{

    /**
     * Download an ICS for an events post.
     *
     * @param VariableRepositoryInterface $variables
     * @return string
     */
    public function index(VariableRepositoryInterface $variables)
    {
        return json_encode(explode(',', str_replace("\r\n", ",", $variables->get('general', 'acceptable_domains'))));
    }
}
