Exemple #1
0
 public static function getInstance()
 {
     if (null == self::$instance) {
         self::$instance = new IcecastUtils();
     }
     return self::$instance;
 }
Exemple #2
0
     $res = array('req' => 'loadPlaylists', 'res' => $res);
     break;
 case 'stop-broadcast':
     // sets up utils
     $session = Session::getInstance();
     $iceUtils = IcecastUtils::getInstance();
     // stops EzStream proc (by its stored PID)
     $res = $iceUtils->stopBroadcast();
     // sets up result
     $err = false == $res ? $session->flushError() : '';
     $res = false == $res ? 'false' : $res[0];
     $res = array('req' => 'stopBroadcast', 'res' => $res, 'err' => $err);
     break;
 case 'start-broadcast':
     // sets up utils
     $iceUtils = IcecastUtils::getInstance();
     // starts EzStream proc
     $res = $iceUtils->startBroadcast();
     // sets up result
     $status = true == $res ? 'ok' : 'false';
     $res = array('req' => 'startBroadcast', 'res' => $status, 'pid' => $res);
     break;
 case 'list-assets':
     // sets up utils
     $user = User::getInstance();
     // lists assets of user
     $exc = $user->listAssets();
     // sets up result
     $exc = false == $exc ? 'false' : $exc;
     $res = array('req' => 'listAssets', 'res' => $exc);
     break;