Permalink
Browse files

preparing for beta5 changes

  • Loading branch information...
1 parent a114359 commit d53f08cf6c7f3f1c447969f86078a70c2ba3b436 @basz committed Jul 3, 2012
@@ -2,9 +2,9 @@
namespace SpeckMultisite\Controller;
-use Zend\Mvc\Controller\ActionController;
+use Zend\Mvc\Controller\AbstractActionController;
-class SessionController extends ActionController
+class SessionController extends AbstractActionController
{
public function indexAction()
{
@@ -29,7 +29,7 @@ class DomainResolver
*/
public function resolveSiteDomain(\Zend\Http\Request $request)
{
- $host = $request->server()->HTTP_HOST;
+ $host = $request->getServer()->HTTP_HOST;
if (!in_array($host, array_keys($this->domainMap)))
$this->resolvedDomain = self::DOMAIN_UNKNOWN;
@@ -22,23 +22,23 @@ public function initializeSession(\Zend\Mvc\MvcEvent $e)
{
$this->app = $e->getApplication();
$request = $this->app->getRequest();
- $this->hostname = $request->uri()->getHost();
+ $this->hostname = $request->getUri()->getHost();
$sessionManager = $e->getApplication()->getServiceManager()->get('SpeckMultisite/SessionManager');
SessionContainer::setDefaultManager($sessionManager);
- if ($request->query()->{$sessionManager->getName()} !== null) {
- $this->newSession($request->query()->{$sessionManager->getName()});
+ if ($request->getQuery()->{$sessionManager->getName()} !== null) {
+ $this->newSession($request->getQuery()->{$sessionManager->getName()});
// when ($_COOKIE) contains session_name then it's save to redirect
if (isset($_COOKIE[$sessionManager->getName()])) {
- $uri = new \Zend\Uri\Http($request->uri());
+ $uri = new \Zend\Uri\Http($request->getUri()) ;
$query = $uri->getQueryAsArray();
unset($query[$sessionManager->getName()]);
$uri->setQuery($query);
- $this->app->events()->attach('dispatch', function($e) use ($uri) {
+ $this->app->getEventManager()->attach('dispatch', function($e) use ($uri) {
$response = new HttpResponse();
- $response->headers()->addHeaderLine('Location', rawurldecode((string) $uri));
+ $response->getHeaders()->addHeaderLine('Location', rawurldecode((string) $uri));
$response->setStatusCode(302);
return $response;
@@ -48,16 +48,16 @@ public function initializeSession(\Zend\Mvc\MvcEvent $e)
$this->newSession();
}
- if ($this->isMasterHost() && isset($request->query()->requestMasterSessUri)) {
- $slaveUri = new \Zend\Uri\Http($request->query()->requestMasterSessUri);
+ if ($this->isMasterHost() && isset($request->getQuery()->requestMasterSessUri)) {
+ $slaveUri = new \Zend\Uri\Http($request->getQuery()->requestMasterSessUri);
$query = $slaveUri->getQueryAsArray();
$query[$sessionManager->getName()] = $sessionManager->getId();
unset($query['requestMasterSessUri']);
$slaveUri->setQuery($query);
- $this->app->events()->attach('dispatch', function($e) use ($slaveUri) {
+ $this->app->getEventManager()->attach('dispatch', function($e) use ($slaveUri) {
$response = new HttpResponse();
- $response->headers()->addHeaderLine('Location', rawurldecode((string) $slaveUri));
+ $response->getHeaders()->addHeaderLine('Location', rawurldecode((string) $slaveUri));
$response->setStatusCode(302);
return $response;
@@ -98,17 +98,17 @@ public function newSession($sid = null)
public function fetchMasterSession()
{
- $slaveUri = $this->app->getRequest()->uri();
+ $slaveUri = $this->app->getRequest()->getUri();
$masterUri = new \Zend\Uri\Http($slaveUri);
$masterUri->setHost($this->getMasterHost());
$query = $masterUri->getQueryAsArray();
$query['requestMasterSessUri'] = rawurldecode((string) $slaveUri);
$masterUri->setQuery($query);
- $this->app->events()->attach('dispatch', function($e) use ($masterUri) {
+ $this->app->getEventManager()->attach('dispatch', function($e) use ($masterUri) {
$response = new HttpResponse();
- $response->headers()->addHeaderLine('Location', rawurldecode((string) $masterUri));
+ $response->getHeaders()->addHeaderLine('Location', rawurldecode((string) $masterUri));
$response->setStatusCode(302);
$response->send();
return $response;

0 comments on commit d53f08c

Please sign in to comment.