From c6557e1280db7d952b0fd853d0873bbb692f6181 Mon Sep 17 00:00:00 2001 From: James Date: Fri, 2 Sep 2011 10:37:15 -0400 Subject: [PATCH] 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) --- airtime_mvc/application/models/Preference.php | 8 ++++++++ utils/{airtime-stream => airtime-system} | 2 +- utils/{airtime-stream.php => airtime-system.php} | 16 +++++++++++++++- 3 files changed, 24 insertions(+), 2 deletions(-) rename utils/{airtime-stream => airtime-system} (97%) rename utils/{airtime-stream.php => airtime-system.php} (78%) diff --git a/airtime_mvc/application/models/Preference.php b/airtime_mvc/application/models/Preference.php index 139e05590..e377dbce4 100644 --- a/airtime_mvc/application/models/Preference.php +++ b/airtime_mvc/application/models/Preference.php @@ -410,5 +410,13 @@ class Application_Model_Preference public static function GetMaxBitrate(){ 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"); + } } diff --git a/utils/airtime-stream b/utils/airtime-system similarity index 97% rename from utils/airtime-stream rename to utils/airtime-system index 6e0f25d25..f6cec9cfe 100755 --- a/utils/airtime-stream +++ b/utils/airtime-system @@ -31,4 +31,4 @@ SCRIPTPATH=`dirname $SCRIPT` invokePwd=$PWD cd $SCRIPTPATH -php -q airtime-stream.php "$@" || exit 1 +php -q airtime-system.php "$@" || exit 1 diff --git a/utils/airtime-stream.php b/utils/airtime-system.php similarity index 78% rename from utils/airtime-stream.php rename to utils/airtime-system.php index 14f839f40..8a31ea4c8 100644 --- a/utils/airtime-stream.php +++ b/utils/airtime-system.php @@ -26,13 +26,15 @@ function printUsage() echo "\n"; echo "airtime-stream\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 "OPTIONS:\n"; echo " --maxbitrate \n"; echo " Set the max bitrate allowed by Airtime.\n"; echo " --numofstream \n"; echo " Set the number of stream allowed by Airtime.\n"; + echo " --planlevel \n"; + echo " Set the plan type for Airtime system.(trial, regular).\n"; echo "\n"; } @@ -51,6 +53,9 @@ switch ($argv[1]) { case '--numofstream': $action = "numofstream"; break; + case '--planlevel': + $action = "planlevel"; + break; } $optionArg = $argv[2]; @@ -70,6 +75,15 @@ if ($action == "maxbitrate") { Application_Model_Preference::SetMaxBitrate($optionArg); } elseif ($action == "numofstream") { 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()