/**
  * This generic method is called in case of dispatched events.
  * The first param is the name of the event, the second argument is an array of
  * event-specific arguments.
  * Make sure to return a matching boolean value, indicating if the event-process was successful or not. The event source may
  * depend on a valid return value.
  *
  * @param string $strEventIdentifier
  * @param array $arrArguments
  *
  * @return bool
  */
 public function handleEvent($strEventIdentifier, array $arrArguments)
 {
     /** @var class_request_entrypoint_enum $objEntrypoint */
     $objEntrypoint = $arrArguments[0];
     if ($objEntrypoint->equals(class_request_entrypoint_enum::INDEX()) && class_carrier::getInstance()->getParam("admin") == "") {
         //process stats request
         $objStats = class_module_system_module::getModuleByName("stats");
         if ($objStats != null) {
             //Collect Data
             $objLanguage = new class_module_languages_language();
             $objStats = new class_module_stats_worker();
             $objStats->createStatsEntry(getServer("REMOTE_ADDR"), time(), class_carrier::getInstance()->getParam("page"), rtrim(getServer("HTTP_REFERER"), "/"), getServer("HTTP_USER_AGENT"), $objLanguage->getPortalLanguage());
         }
     }
 }
Ejemplo n.º 2
0
{
    /**
     * @var class_response_object
     */
    public $objResponse;
    /**
     * Triggers the processing of the current request
     * @return void
     */
    public function processRequest()
    {
        $strModule = class_carrier::getInstance()->getParam("module");
        if ($strModule == "") {
            $strModule = _admin_ ? "dashboard" : "pages";
        }
        $strAction = class_carrier::getInstance()->getParam("action");
        $strLanguageParam = class_carrier::getInstance()->getParam("language");
        $this->objResponse = class_response_object::getInstance();
        $this->objResponse->setStrResponseType(class_http_responsetypes::STR_TYPE_HTML);
        $this->objResponse->setStrStatusCode(class_http_statuscodes::SC_OK);
        $objDispatcher = new class_request_dispatcher($this->objResponse);
        $objDispatcher->processRequest(_admin_, $strModule, $strAction, $strLanguageParam);
    }
}
//creating the wrapper instance and passing control
$objIndex = new class_index();
$objIndex->processRequest();
$objIndex->objResponse->sendHeaders();
$objIndex->objResponse->sendContent();
class_core_eventdispatcher::getInstance()->notifyGenericListeners(class_system_eventidentifier::EVENT_SYSTEM_REQUEST_AFTERCONTENTSEND, array(class_request_entrypoint_enum::INDEX()));