public function handleEvent(__UIEvent &$event) { $event_name = strtoupper($event->getEventName()); switch ($event_name) { case 'UPLOADING': //free the session to allow more incoming requests: //@todo change the session handler to synchronize sessions between requests __SessionManager::getInstance()->endSession(); $this->setStatus(__IUploaderComponent::UPLOAD_STATUS_UPLOADING); $this->setProgress(0); while ($this->getStatus() == __IUploaderComponent::UPLOAD_STATUS_UPLOADING) { $this->updateStatus(); sleep(1); } break; case 'CANCELUPLOAD': $this->reset(); $this->setStatus(__IUploaderComponent::UPLOAD_STATUS_CANCELLED); break; } }
/** * Gets the session associated to current context * * @return __Session */ public function &getSession() { return __SessionManager::getInstance()->getSession($this->_context_id); }