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__."/../..",
|
||||
'pearPath' => dirname(__FILE__).'/../../library/pear',
|
||||
'zendPath' => dirname(__FILE__).'/../../library/Zend',
|
||||
'phingPath' => dirname(__FILE__).'/../../library/phing'
|
||||
'zendPath' => dirname(__FILE__).'/../../library/Zend'
|
||||
);
|
||||
|
||||
|
||||
|
|
|
@ -27,7 +27,9 @@ class Application_Model_Nowplaying
|
|||
$status = ($dbRow['show_ends'] < $dbRow['item_ends']) ? "x" : "";
|
||||
|
||||
$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
|
||||
$itemStart = explode('.', $dbRow['item_starts']);
|
||||
|
|
|
@ -52,6 +52,9 @@ def do_local(command, capture=True):
|
|||
else:
|
||||
return result
|
||||
|
||||
def pause():
|
||||
raw_input("--> Press Enter to continue...")
|
||||
|
||||
def shutdown():
|
||||
do_sudo("poweroff")
|
||||
time.sleep(45)
|
||||
|
@ -193,7 +196,7 @@ def airtime_182_tar():
|
|||
|
||||
def airtime_18x_tar(root_dir, version):
|
||||
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 ' + \
|
||||
'lame daemontools daemontools-run python-mutagen libsoundtouch-ocaml sudo ' + \
|
||||
'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;
|
||||
|
||||
// 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";
|
||||
|
||||
$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;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,8 +23,15 @@ AirtimeInstall::DbConnect(true);
|
|||
|
||||
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') {
|
||||
AirtimeInstall::CreateDatabaseTables();
|
||||
AirtimeInstall::CreateDatabaseTables($dbuser, $dbpasswd, $dbname, $dbhost);
|
||||
} else if ($databaseExisted) {
|
||||
//Database already exists. Ask the user how they want to
|
||||
//proceed. Warn them that creating the database tables again
|
||||
|
@ -36,12 +43,12 @@ if (isset($argv[1]) && $argv[1] == 'y') {
|
|||
$userAnswer = trim(fgets(STDIN));
|
||||
}
|
||||
if (in_array($userAnswer, array("y", "Y"))) {
|
||||
AirtimeInstall::CreateDatabaseTables();
|
||||
AirtimeInstall::CreateDatabaseTables($dbuser, $dbpasswd, $dbname, $dbhost);
|
||||
}
|
||||
} else {
|
||||
//Database was just created, meaning the tables do not
|
||||
//exist. Let's create them.
|
||||
AirtimeInstall::CreateDatabaseTables();
|
||||
AirtimeInstall::CreateDatabaseTables($dbuser, $dbpasswd, $dbname, $dbhost);
|
||||
}
|
||||
|
||||
echo " * Setting Airtime version".PHP_EOL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue