protected function __construct() { parent::__construct(); $app = $this; $app['mods'] = array('index' => ROOT . '/IndexServer.php'); PL_Session::$randsid = true; $app->mshare('session', function () use($app) { return PL_Session::start(); }); $app->mshare('session.storage', function () use($app) { //return new PL_Session_Redis(); return new PL_Session_File(); }); }
function actionIndex() { $pid = $_REQUEST['pid']; if (!$pid) { $pid = $_COOKIE['pid']; } if (!$pid) { $pid = 'wplayers' . mt_rand(1, 100); } setcookie('pid', $pid); $um = model_LoginUser::genbypid($pid, $isnew); $u = $um->_id; $sess = PL_Session::start($u, 's1'); $_SESSION['isNew'] = 1; $cid = $sess->getCid($u); $this->bodyView = $this->viewRoot . 'index.body.php'; $this->tailerView = $this->viewRoot . 'index.tailer.php'; include $this->viewRoot . 'layout.php'; }