public function __construct(Registry $Registry, Request $Request = null, $restful = true) { parent::__construct($Registry); $this->Request = null !== $Request ? $Request : $Registry->Request; $this->restful = $restful; $format = $this->Request->get('alt', 's', 'json'); d('requested output format: ' . $format); $callback = $this->Request->get('callback', 's', null); $this->Output = Output\Formatter::factory($format, $callback); $this->Registry->Response = Response::factory(); $this->aConfig = $Registry->Ini->getSection('API'); $this->pageID = $this->Request['pageID']; try { $this->initParams()->initClientUser()->setClientAppId()->makeAccessId()->checkLimit()->checkLoginStatus()->checkAccessPermission()->main(); $this->logRequest(); } catch (\Exception $e) { $this->handleException($e); } $this->prepareResponse(); }
/** * Constructor * @return * @param object $Registry * @param object $Request */ public function __construct(Registry $Registry, Request $Request = null) { parent::__construct($Registry); $this->Request = null !== $Request ? $Request : $Registry->Request; $this->action = $this->Request['a']; $this->initParams()->setTemplateDir()->setLocale()->loginByFacebookCookie()->loginByGfcCookie()->loginBySid()->initPageVars()->addJoinForm()->addLangForm(); Cookie::sendFirstVisitCookie(); d('cp'); try { $this->checkLoginStatus()->checkAccessPermission()->main(); } catch (Exception $e) { $this->handleException($e); } d('cp'); /** * Observer will be able to * record access of current Viewer to * the current page for the purpose of * recording of who's online and at what url */ $this->Registry->Dispatcher->post($this, 'onPageView', $this->aPageVars); //\Lampcms\Log::dump(); }
/** * Constructor * * @return \Lampcms\WebPage * * @param \Lampcms\Registry|object $Registry * @param \Lampcms\Request|null|object $Request */ public function __construct(Registry $Registry, Request $Request = null) { parent::__construct($Registry); $this->Request = null !== $Request ? $Request : $Registry->Request; $this->Router = $this->Registry->Router; $this->action = $this->Request['a']; $this->initParams()->setTemplateDir()->setLocale()->loginByFacebookCookie()->loginBySid()->setTimeZone()->initPageVars()->addJoinForm()->addLangForm()->addJsTranslations(); Cookie::sendFirstVisitCookie(); //d('cp'); try { $this->checkLoginStatus()->checkAccessPermission()->main(); } catch (Exception $e) { /** * Only Exceptions in the Lampcms Namespace * (the ones that extend Lampcms\Exception) * will be handled here, others bubble up to * index.php */ $this->handleException($e); } //d('cp'); /** * Observer will be able to * record access of current Viewer to * the current page for the purpose of * recording of who's online and at what url */ $this->Registry->Dispatcher->post($this, 'onPageView', $this->aPageVars); }