示例#1
0
 /**
  * Устанавливает настройки для канала
  * @param string $mount
  * @param array $data
  * @return bool|string
  */
 public function setSettings($mount, $data)
 {
     $db = \Difra\MySQL::getInstance();
     $Radio = \Difra\Plugins\Radio::getInstance();
     if (empty($data)) {
         return false;
     }
     $insertData = [];
     foreach ($data as $key => $value) {
         $insertData[] = " `" . $db->escape($key) . "`='" . $db->escape($value) . "'";
     }
     $result = $Radio->makeIces($data);
     if ($result !== true) {
         return $result;
     }
     $query = "UPDATE `radio_channels` SET " . implode(', ', $insertData) . " WHERE `mount`='" . $db->escape($mount) . "'";
     $db->query($query);
     $result = $Radio->makeIceCast();
     return $result;
 }
示例#2
0
文件: radio.php 项目: difra-org/difra
 public function channeldeleteAjaxAction(Param\AnyString $name)
 {
     \Difra\Plugins\Radio::getInstance()->deleteChannel($name->val());
     $this->ajax->refresh();
 }
示例#3
0
<?php

///////////////////////////// ротация канала
$libPath = dirname(__FILE__) . '/../../../fw/lib/';
require $libPath . 'autoloader.php';
$_SERVER['VHOST_NAME'] = 'musiq';
if (!isset($_REQUEST['name']) || $_REQUEST['name'] == '') {
    die('Нет параметра с именем канала!' . "\n\n");
}
$site = Difra\Site::getInstance();
$site->init();
$db = Difra\MySQL::getInstance();
$Channel = \Difra\Plugins\Radio::getInstance()->getChannel($_REQUEST['name']);
$track = $Channel->getTrackToPlay();
echo $track;
echo "\n";