Merge branch 'master' of dev.sourcefabric.org:airtime

Conflicts:
	install/airtime-install.php
This commit is contained in:
Paul Baranowski 2011-03-28 15:41:49 -04:00
commit c17ee178d1
237 changed files with 2270 additions and 23932 deletions

View file

@ -79,7 +79,8 @@ class AirtimeInstall {
{
$api_key = AirtimeInstall::GenerateRandomString();
AirtimeInstall::UpdateIniValue(__DIR__.'/../build/airtime.conf', 'api_key', $api_key);
AirtimeInstall::UpdateIniValue(__DIR__.'/../pypo/config.cfg', 'api_key', "'$api_key'");
AirtimeInstall::UpdateIniValue(__DIR__.'/../python_apps/pypo/config.cfg', 'api_key', "'$api_key'");
AirtimeInstall::UpdateIniValue(__DIR__.'/../python_apps/show-recorder/config.cfg', 'api_key', "'$api_key'");
}
public static function ExitIfNotRoot()
@ -112,7 +113,7 @@ class AirtimeInstall {
public static function SetupStorageDirectory($CC_CONFIG)
{
global $CC_CONFIG, $CC_DBC;
echo PHP_EOL."*** Directory Setup ***".PHP_EOL;
foreach (array('baseFilesDir', 'storageDir') as $d) {
if ( !file_exists($CC_CONFIG[$d]) ) {
@ -141,7 +142,7 @@ class AirtimeInstall {
// Create the database user
$command = "sudo -u postgres psql postgres --command \"CREATE USER {$CC_CONFIG['dsn']['username']} "
." ENCRYPTED PASSWORD '{$CC_CONFIG['dsn']['password']}' LOGIN CREATEDB NOCREATEUSER;\" 2>/dev/null";
@exec($command, $output, $results);
if ($results == 0) {
echo "* Database user '{$CC_CONFIG['dsn']['username']}' created.".PHP_EOL;
@ -159,7 +160,7 @@ class AirtimeInstall {
public static function CreateDatabase()
{
global $CC_CONFIG;
$command = "sudo -u postgres createdb {$CC_CONFIG['dsn']['database']} --owner {$CC_CONFIG['dsn']['username']} 2> /dev/null";
@exec($command, $output, $results);
if ($results == 0) {
@ -202,10 +203,33 @@ class AirtimeInstall {
system($command);
}
public static function SetUpPythonEggs()
{
//install poster streaming upload
$command = "sudo easy_install poster";
@exec($command);
}
public static function DeleteFilesRecursive($p_path)
{
$command = "rm -rf $p_path";
exec($command);
}
}
public static function CreateSymlinks(){
AirtimeInstall::RemoveSymlinks();
$dir = realpath(__DIR__."/../utils/airtime-import");
exec("ln -s $dir /usr/bin/airtime-import");
$dir = realpath(__DIR__."/../utils/airtime-clean-storage");
exec("ln -s $dir /usr/bin/airtime-clean-storage");
}
public static function RemoveSymlinks(){
exec("rm -f /usr/bin/airtime-import");
exec("rm -f /usr/bin/airtime-clean-storage");
}
}