Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
This commit is contained in:
commit
48d9d2d93b
184 changed files with 69419 additions and 100 deletions
|
@ -3,7 +3,7 @@
|
|||
require_once __DIR__."/configs/ACL.php";
|
||||
|
||||
require_once 'propel/runtime/lib/Propel.php';
|
||||
Propel::init(__DIR__."/configs/airtime-conf.php");
|
||||
Propel::init(__DIR__."/configs/airtime-conf-production.php");
|
||||
|
||||
require_once __DIR__."/logging/Logging.php";
|
||||
require_once __DIR__."/configs/constants.php";
|
||||
|
|
36
airtime_mvc/application/configs/airtime-conf-production.php
Normal file
36
airtime_mvc/application/configs/airtime-conf-production.php
Normal file
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
// This file generated by Propel 1.5.2 convert-conf target
|
||||
// from XML runtime conf file /home/james/src/airtime/airtime_mvc/build/runtime-conf.xml
|
||||
|
||||
/* The original name of this file is airtime-conf.php but since we need to make custom changes
|
||||
* to it I've renamed it so that our changes aren't removed everytime we regenerate a database schema.
|
||||
* our custom changes requires the database parameters to be loaded from /etc/airtime/airtime.conf so
|
||||
* that the user can customize these.
|
||||
*/
|
||||
|
||||
$ini = parse_ini_file('/etc/airtime/airtime.conf', true);
|
||||
|
||||
$dbhost = $ini['database']['host'];
|
||||
$dbname = $ini['database']['dbname'];
|
||||
$dbuser = $ini['database']['dbuser'];
|
||||
$dbpass = $ini['database']['dbpass'];
|
||||
|
||||
|
||||
|
||||
$conf = array (
|
||||
'datasources' =>
|
||||
array (
|
||||
'airtime' =>
|
||||
array (
|
||||
'adapter' => 'pgsql',
|
||||
'connection' =>
|
||||
array (
|
||||
'dsn' => "pgsql:host=$dbhost;port=5432;dbname=$dbname;user=$dbuser;password=$dbpass",
|
||||
),
|
||||
),
|
||||
'default' => 'airtime',
|
||||
),
|
||||
'generator_version' => '1.5.2',
|
||||
);
|
||||
$conf['classmap'] = include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'classmap-airtime-conf.php');
|
||||
return $conf;
|
|
@ -43,7 +43,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm{
|
|||
|
||||
$enable = new Zend_Form_Element_Checkbox('enable');
|
||||
$enable->setLabel('Enabled:')
|
||||
->setValue($setting[$prefix.'_output'] != 'disabled'?1:0)
|
||||
->setValue($setting[$prefix.'_enable'] == 'true' ? 1 : 0)
|
||||
->setDecorators(array('ViewHelper'));
|
||||
if($disable_all){
|
||||
$enable->setAttrib("disabled", "disabled");
|
||||
|
|
|
@ -7,8 +7,8 @@ class Application_Model_StreamSetting {
|
|||
global $CC_DBC;
|
||||
$sql = "SELECT * "
|
||||
."FROM cc_stream_setting "
|
||||
."WHERE keyname LIKE '%_output' "
|
||||
."AND value != 'disabled'";
|
||||
."WHERE keyname LIKE '%_enable' "
|
||||
."AND value == true";
|
||||
|
||||
$rows = $CC_DBC->getAll($sql);
|
||||
$ids = array();
|
||||
|
@ -75,21 +75,18 @@ class Application_Model_StreamSetting {
|
|||
*/
|
||||
public static function setStreamSetting($data){
|
||||
global $CC_DBC;
|
||||
foreach($data as $key=>$d){
|
||||
if($key == "output_sound_device" || $key == "icecast_vorbis_metadata"){
|
||||
foreach ($data as $key=>$d) {
|
||||
if ($key == "output_sound_device" || $key == "icecast_vorbis_metadata") {
|
||||
$v = $d == 1?"true":"false";
|
||||
$sql = "UPDATE cc_stream_setting SET value='$v' WHERE keyname='$key'";
|
||||
$CC_DBC->query($sql);
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
$temp = explode('_', $key);
|
||||
$prefix = $temp[0];
|
||||
foreach($d as $k=>$v){
|
||||
$keyname = $prefix."_".$k;
|
||||
if( $k == 'output'){
|
||||
if( $d["enable"] == 0){
|
||||
$v = 'disabled';
|
||||
}
|
||||
foreach ($d as $k=>$v) {
|
||||
$keyname = $prefix . "_" . $k;
|
||||
if ($k == 'enable') {
|
||||
$v = $d['enable'] == 1 ? 'true' : 'false';
|
||||
}
|
||||
$v = trim($v);
|
||||
$sql = "UPDATE cc_stream_setting SET value='$v' WHERE keyname='$keyname'";
|
||||
|
@ -152,17 +149,15 @@ class Application_Model_StreamSetting {
|
|||
public static function getStreamEnabled($stream_id){
|
||||
global $CC_DBC;
|
||||
|
||||
$keyname = "s".$stream_id."_output";
|
||||
$keyname = "s" . $stream_id . "_enable";
|
||||
$sql = "SELECT value FROM cc_stream_setting"
|
||||
." WHERE keyname = '$keyname'";
|
||||
$result = $CC_DBC->GetOne($sql);
|
||||
|
||||
if($result == 'disabled'){
|
||||
if ($result == 'false') {
|
||||
$result = false;
|
||||
}else{
|
||||
} else {
|
||||
$result = true;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ INSERT INTO cc_pref("keystr", "valstr") VALUES('plan_level', 'disabled');
|
|||
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('output_sound_device', 'false', 'boolean');
|
||||
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('icecast_vorbis_metadata', 'false', 'boolean');
|
||||
|
||||
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s1_enable', 'true', 'boolean');
|
||||
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s1_output', 'icecast', 'string');
|
||||
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s1_type', 'ogg', 'string');
|
||||
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s1_bitrate', '128', 'integer');
|
||||
|
@ -22,7 +23,8 @@ INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s1_url', 'ht
|
|||
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s1_description', 'Airtime Radio! Stream #1', 'string');
|
||||
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s1_genre', 'genre', 'string');
|
||||
|
||||
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s2_output', 'disabled', 'string');
|
||||
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s2_enable', 'false', 'boolean');
|
||||
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s2_output', 'icecast', 'string');
|
||||
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s2_type', '', 'string');
|
||||
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s2_bitrate', '', 'integer');
|
||||
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s2_host', '', 'string');
|
||||
|
@ -34,7 +36,8 @@ INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s2_url', '',
|
|||
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s2_description', '', 'string');
|
||||
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s2_genre', '', 'string');
|
||||
|
||||
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s3_output', 'disabled', 'string');
|
||||
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s3_enable', 'false', 'boolean');
|
||||
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s3_output', 'icecast', 'string');
|
||||
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s3_type', '', 'string');
|
||||
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s3_bitrate', '', 'integer');
|
||||
INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('s3_host', '', 'string');
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
<?php
|
||||
|
||||
$ini = parse_ini_file('/etc/airtime/airtime.conf', true);
|
||||
|
||||
return array(
|
||||
'dbname' => 'airtime',
|
||||
'user' => 'airtime',
|
||||
'password' => 'airtime',
|
||||
'dbname' => $ini['database']['dbname'],
|
||||
'user' => $ini['database']['dbuser'],
|
||||
'password' => $ini['database']['dbpass'],
|
||||
'host' => 'localhost',
|
||||
'driver' => 'pdo_pgsql',
|
||||
);
|
||||
|
|
|
@ -11,3 +11,5 @@ RewriteCond %{REQUEST_FILENAME} -d
|
|||
RewriteRule ^.*$ - [NC,L]
|
||||
RewriteRule ^.*$ index.php [NC,L]
|
||||
RewriteBase /
|
||||
|
||||
SetEnv APPLICATION_ENV development
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue