CC-2756: Ability to set plan level

- created setter and getter in Preference.php for plan level
- renamed airtime-stream to airtime-system
- airtime-system is removed from this repository(moved to airtime-saas)
This commit is contained in:
James 2011-09-02 10:37:15 -04:00
parent abee16ba4a
commit c6557e1280
3 changed files with 24 additions and 2 deletions

View File

@ -410,5 +410,13 @@ class Application_Model_Preference
public static function GetMaxBitrate(){ public static function GetMaxBitrate(){
return Application_Model_Preference::GetValue("max_bitrate"); return Application_Model_Preference::GetValue("max_bitrate");
} }
public static function SetPlanLevel($plan){
Application_Model_Preference::SetValue("plan_level", $plan);
}
public static function GetPlanLevel(){
return Application_Model_Preference::GetValue("plan_level");
}
} }

View File

@ -31,4 +31,4 @@ SCRIPTPATH=`dirname $SCRIPT`
invokePwd=$PWD invokePwd=$PWD
cd $SCRIPTPATH cd $SCRIPTPATH
php -q airtime-stream.php "$@" || exit 1 php -q airtime-system.php "$@" || exit 1

View File

@ -26,13 +26,15 @@ function printUsage()
echo "\n"; echo "\n";
echo "airtime-stream\n"; echo "airtime-stream\n";
echo "===============\n"; echo "===============\n";
echo " This program allows you to manage Airtime stream.\n"; echo " This program allows you to manage Airtime system.\n";
echo "\n"; echo "\n";
echo "OPTIONS:\n"; echo "OPTIONS:\n";
echo " --maxbitrate <bitrate>\n"; echo " --maxbitrate <bitrate>\n";
echo " Set the max bitrate allowed by Airtime.\n"; echo " Set the max bitrate allowed by Airtime.\n";
echo " --numofstream <numofstream>\n"; echo " --numofstream <numofstream>\n";
echo " Set the number of stream allowed by Airtime.\n"; echo " Set the number of stream allowed by Airtime.\n";
echo " --planlevel <planname>\n";
echo " Set the plan type for Airtime system.(trial, regular).\n";
echo "\n"; echo "\n";
} }
@ -51,6 +53,9 @@ switch ($argv[1]) {
case '--numofstream': case '--numofstream':
$action = "numofstream"; $action = "numofstream";
break; break;
case '--planlevel':
$action = "planlevel";
break;
} }
$optionArg = $argv[2]; $optionArg = $argv[2];
@ -70,6 +75,15 @@ if ($action == "maxbitrate") {
Application_Model_Preference::SetMaxBitrate($optionArg); Application_Model_Preference::SetMaxBitrate($optionArg);
} elseif ($action == "numofstream") { } elseif ($action == "numofstream") {
Application_Model_Preference::SetNumOfStreams($optionArg); Application_Model_Preference::SetNumOfStreams($optionArg);
} elseif ($action == "planlevel"){
$plans = array("trial", "regular");
if(in_array($optionArg, $plans)){
Application_Model_Preference::SetPlanLevel($optionArg);
echo "Setting the plan level to '$optionArg'.".PHP_EOL;
}else{
echo "Error: Unknown plan level '$optionArg'.".PHP_EOL;
exit;
}
} }
function GetAirtimeConf() function GetAirtimeConf()