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

This commit is contained in:
Naomi 2011-04-13 15:11:20 -04:00
commit f478a27a06
4 changed files with 20 additions and 23 deletions

View File

@ -8,13 +8,13 @@
echo "******************************** Install Begin *********************************".PHP_EOL; echo "******************************** Install Begin *********************************".PHP_EOL;
require_once(dirname(__FILE__).'/include/AirtimeIni.php'); require_once(dirname(__FILE__).'/include/AirtimeIni.php');
require_once(dirname(__FILE__).'/include/AirtimeInstall.php');
AirtimeIni::ExitIfNotRoot(); AirtimeInstall::ExitIfNotRoot();
AirtimeIni::CreateIniFile(); AirtimeIni::CreateIniFile();
AirtimeIni::UpdateIniFiles(); AirtimeIni::UpdateIniFiles();
require_once(dirname(__FILE__).'/../application/configs/conf.php'); require_once(dirname(__FILE__).'/../application/configs/conf.php');
require_once(dirname(__FILE__).'/include/AirtimeInstall.php');
echo PHP_EOL."*** Installing Airtime ".AIRTIME_VERSION." ***".PHP_EOL; echo PHP_EOL."*** Installing Airtime ".AIRTIME_VERSION." ***".PHP_EOL;
@ -43,9 +43,6 @@ AirtimeInstall::ChangeDirOwnerToWebserver($CC_CONFIG["storageDir"]);
echo "* Creating /usr/bin symlinks".PHP_EOL; echo "* Creating /usr/bin symlinks".PHP_EOL;
AirtimeInstall::CreateSymlinks($CC_CONFIG["storageDir"]); AirtimeInstall::CreateSymlinks($CC_CONFIG["storageDir"]);
echo "* Importing sample audio clips".PHP_EOL;
system(__DIR__."/../utils/airtime-import --copy ../audio_samples/ > /dev/null");
echo PHP_EOL."*** Pypo Installation ***".PHP_EOL; echo PHP_EOL."*** Pypo Installation ***".PHP_EOL;
system("python ".__DIR__."/../python_apps/pypo/install/pypo-install.py"); system("python ".__DIR__."/../python_apps/pypo/install/pypo-install.py");

View File

@ -6,8 +6,9 @@
*/ */
require_once(dirname(__FILE__).'/include/AirtimeIni.php'); require_once(dirname(__FILE__).'/include/AirtimeIni.php');
require_once(dirname(__FILE__).'/include/AirtimeInstall.php');
// Need to check that we are superuser before running this. // Need to check that we are superuser before running this.
AirtimeIni::ExitIfNotRoot(); AirtimeInstall::ExitIfNotRoot();
if (!file_exists('/etc/airtime/airtime.conf')) { if (!file_exists('/etc/airtime/airtime.conf')) {
echo PHP_EOL."Airtime config file '/etc/airtime/airtime.conf' does not exist.".PHP_EOL; echo PHP_EOL."Airtime config file '/etc/airtime/airtime.conf' does not exist.".PHP_EOL;
@ -15,7 +16,6 @@ if (!file_exists('/etc/airtime/airtime.conf')) {
exit(); exit();
} }
require_once(dirname(__FILE__).'/../application/configs/conf.php'); require_once(dirname(__FILE__).'/../application/configs/conf.php');
require_once(dirname(__FILE__).'/include/AirtimeInstall.php');
AirtimeInstall::RemoveSymlinks(); AirtimeInstall::RemoveSymlinks();

View File

@ -81,20 +81,6 @@ class AirtimeIni{
} }
} }
/**
* Ensures that the user is running this PHP script with root
* permissions. If not running with root permissions, causes the
* script to exit.
*/
static function ExitIfNotRoot()
{
// Need to check that we are superuser before running this.
if(exec("whoami") != "root"){
echo "Must be root user.\n";
exit(1);
}
}
/** /**
* This function generates a random string. * This function generates a random string.
* *

View File

@ -4,6 +4,20 @@ require_once(dirname(__FILE__).'/../../library/pear/DB.php');
require_once(dirname(__FILE__).'/../../application/configs/conf.php'); require_once(dirname(__FILE__).'/../../application/configs/conf.php');
class AirtimeInstall { class AirtimeInstall {
/**
* Ensures that the user is running this PHP script with root
* permissions. If not running with root permissions, causes the
* script to exit.
*/
static function ExitIfNotRoot()
{
// Need to check that we are superuser before running this.
if(exec("whoami") != "root"){
echo "Must be root user.\n";
exit(1);
}
}
static function DbTableExists($p_name) static function DbTableExists($p_name)
{ {