Merge branch 'airtime-2.0.x' of dev.sourcefabric.org:airtime into airtime-2.0.x
This commit is contained in:
commit
95e746f102
5 changed files with 29 additions and 11 deletions
|
@ -19,8 +19,7 @@ $CC_CONFIG = array(
|
||||||
|
|
||||||
"rootDir" => __DIR__."/../..",
|
"rootDir" => __DIR__."/../..",
|
||||||
'pearPath' => dirname(__FILE__).'/../../library/pear',
|
'pearPath' => dirname(__FILE__).'/../../library/pear',
|
||||||
'zendPath' => dirname(__FILE__).'/../../library/Zend',
|
'zendPath' => dirname(__FILE__).'/../../library/Zend'
|
||||||
'phingPath' => dirname(__FILE__).'/../../library/phing'
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,9 @@ class Application_Model_Nowplaying
|
||||||
$status = ($dbRow['show_ends'] < $dbRow['item_ends']) ? "x" : "";
|
$status = ($dbRow['show_ends'] < $dbRow['item_ends']) ? "x" : "";
|
||||||
|
|
||||||
$type = "a";
|
$type = "a";
|
||||||
$type .= ($itemEndDateTime->getTimestamp() > $epochNow && $itemStartDateTime->getTimestamp() <= $epochNow) ? "c" : "";
|
$type .= ($itemStartDateTime->getTimestamp() <= $epochNow
|
||||||
|
&& $epochNow < $itemEndDateTime->getTimestamp()
|
||||||
|
&& $epochNow < $showEndDateTime->getTimestamp()) ? "c" : "";
|
||||||
|
|
||||||
// remove millisecond from the time format
|
// remove millisecond from the time format
|
||||||
$itemStart = explode('.', $dbRow['item_starts']);
|
$itemStart = explode('.', $dbRow['item_starts']);
|
||||||
|
|
|
@ -51,6 +51,9 @@ def do_local(command, capture=True):
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
else:
|
else:
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
def pause():
|
||||||
|
raw_input("--> Press Enter to continue...")
|
||||||
|
|
||||||
def shutdown():
|
def shutdown():
|
||||||
do_sudo("poweroff")
|
do_sudo("poweroff")
|
||||||
|
@ -193,7 +196,7 @@ def airtime_182_tar():
|
||||||
|
|
||||||
def airtime_18x_tar(root_dir, version):
|
def airtime_18x_tar(root_dir, version):
|
||||||
do_sudo('apt-get update')
|
do_sudo('apt-get update')
|
||||||
do_sudo('apt-get install -y tar gzip unzip apache2 php5-pgsql libapache2-mod-php5 ' + \
|
do_sudo('apt-get install -y --force-yes tar gzip unzip apache2 php5-pgsql libapache2-mod-php5 ' + \
|
||||||
'php-pear php5-gd postgresql odbc-postgresql python python-configobj poc-streamer ' + \
|
'php-pear php5-gd postgresql odbc-postgresql python python-configobj poc-streamer ' + \
|
||||||
'lame daemontools daemontools-run python-mutagen libsoundtouch-ocaml sudo ' + \
|
'lame daemontools daemontools-run python-mutagen libsoundtouch-ocaml sudo ' + \
|
||||||
'libtaglib-ocaml libao-ocaml libmad-ocaml libesd0 icecast2 oggvideotools ' + \
|
'libtaglib-ocaml libao-ocaml libmad-ocaml libesd0 icecast2 oggvideotools ' + \
|
||||||
|
|
|
@ -242,14 +242,21 @@ class AirtimeInstall
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function CreateDatabaseTables()
|
public static function CreateDatabaseTables($p_dbuser, $p_dbpasswd, $p_dbname, $p_dbhost)
|
||||||
{
|
{
|
||||||
echo " * Creating database tables".PHP_EOL;
|
echo " * Creating database tables".PHP_EOL;
|
||||||
|
|
||||||
// Put Propel sql files in Database
|
// Put Propel sql files in Database
|
||||||
//$command = AirtimeInstall::CONF_DIR_WWW."/library/propel/generator/bin/propel-gen ".AirtimeInstall::CONF_DIR_WWW."/build/ insert-sql";
|
//$command = AirtimeInstall::CONF_DIR_WWW."/library/propel/generator/bin/propel-gen ".AirtimeInstall::CONF_DIR_WWW."/build/ insert-sql 2>/dev/null";
|
||||||
$command = AirtimeInstall::CONF_DIR_WWW."/library/propel/generator/bin/propel-gen ".AirtimeInstall::CONF_DIR_WWW."/build/ insert-sql 2>/dev/null";
|
|
||||||
@exec($command, $output, $results);
|
$dir = AirtimeInstall::CONF_DIR_WWW."/build/sql/";
|
||||||
|
$files = array("schema.sql", "sequences.sql", "views.sql", "triggers.sql", "defaultdata.sql");
|
||||||
|
|
||||||
|
foreach ($files as $f){
|
||||||
|
$command = "export PGPASSWORD=$p_dbpasswd && psql --username $p_dbuser --dbname $p_dbname --host $p_dbhost --file $dir$f 2>/dev/null";
|
||||||
|
@exec($command, $output, $results);
|
||||||
|
}
|
||||||
|
|
||||||
AirtimeInstall::$databaseTablesCreated = true;
|
AirtimeInstall::$databaseTablesCreated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,8 +23,15 @@ AirtimeInstall::DbConnect(true);
|
||||||
|
|
||||||
AirtimeInstall::InstallPostgresScriptingLanguage();
|
AirtimeInstall::InstallPostgresScriptingLanguage();
|
||||||
|
|
||||||
|
//Load Database parameters
|
||||||
|
global $CC_CONFIG;
|
||||||
|
$dbuser = $CC_CONFIG['dsn']['username'];
|
||||||
|
$dbpasswd = $CC_CONFIG['dsn']['password'];
|
||||||
|
$dbname = $CC_CONFIG['dsn']['database'];
|
||||||
|
$dbhost = $CC_CONFIG['dsn']['hostspec'];
|
||||||
|
|
||||||
if (isset($argv[1]) && $argv[1] == 'y') {
|
if (isset($argv[1]) && $argv[1] == 'y') {
|
||||||
AirtimeInstall::CreateDatabaseTables();
|
AirtimeInstall::CreateDatabaseTables($dbuser, $dbpasswd, $dbname, $dbhost);
|
||||||
} else if ($databaseExisted) {
|
} else if ($databaseExisted) {
|
||||||
//Database already exists. Ask the user how they want to
|
//Database already exists. Ask the user how they want to
|
||||||
//proceed. Warn them that creating the database tables again
|
//proceed. Warn them that creating the database tables again
|
||||||
|
@ -36,12 +43,12 @@ if (isset($argv[1]) && $argv[1] == 'y') {
|
||||||
$userAnswer = trim(fgets(STDIN));
|
$userAnswer = trim(fgets(STDIN));
|
||||||
}
|
}
|
||||||
if (in_array($userAnswer, array("y", "Y"))) {
|
if (in_array($userAnswer, array("y", "Y"))) {
|
||||||
AirtimeInstall::CreateDatabaseTables();
|
AirtimeInstall::CreateDatabaseTables($dbuser, $dbpasswd, $dbname, $dbhost);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//Database was just created, meaning the tables do not
|
//Database was just created, meaning the tables do not
|
||||||
//exist. Let's create them.
|
//exist. Let's create them.
|
||||||
AirtimeInstall::CreateDatabaseTables();
|
AirtimeInstall::CreateDatabaseTables($dbuser, $dbpasswd, $dbname, $dbhost);
|
||||||
}
|
}
|
||||||
|
|
||||||
echo " * Setting Airtime version".PHP_EOL;
|
echo " * Setting Airtime version".PHP_EOL;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue