public static function getInstance() { if (null == self::$instance) { self::$instance = new iTuneUtils(); } return self::$instance; }
public function __construct() { $this->session = Session::getInstance(); $this->webDBUtils = WebDBUtils::getInstance(); $this->iTuneUtils = iTuneUtils::getInstance(); $this->user = User::getInstance(); $this->log = Log::getInstance(); }
$app->get('/', function () use($app) { $session = Session::getInstance(); $user = User::getInstance(); $model = Utils::getInstance()->getModel($app); $model['oAuthURL'] = $user->getOAuthURL(Settings::baseRef); $model['access_token'] = $user->getFBAccessToken(); $model['user_data'] = $user->getFBUserData(); $user->authFBUser(); $app->render('tenant-login.php', $model); return; }); // writes a PLS (iTunes) file to ouptut stream // this will change for sure... // PLS files get written to some public folder... $app->get('/listen-to-stream/', function () use($app) { $file = iTuneUtils::getInstance()->getPLSPath(); $d = @readfile($file); if (false == $d) { } $app->response()->header('Content-Description', 'File Transfer'); $app->response()->header('Content-Disposition', 'attachment; filename=itunes.pls'); $app->response()->header('Content-Length', filesize($file)); $app->response()->header('Content-Type', 'audio/x-spcls'); $app->response()->setBody($d); return; }); $app->get('/admin/', function () use($app) { $session = Session::getInstance(); $adminUtils = AdminUtils::getInstance(); $user = User::getInstance(); if (false == $session->isUserAuth()) {
public function __construct() { $this->itu = iTuneUtils::getInstance(); }