From 590eb550f77de02b9e53ea76844a268431819b32 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Fri, 19 Feb 2010 10:03:59 +0000 Subject: [PATCH] --- .../class.ws.conversion.session.php | 19 +++++++++++++ inc/extranet/Controlleur/class.ws.flash.php | 27 ++++++++++++++++--- 2 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 inc/extranet/Controlleur/class.ws.conversion.session.php diff --git a/inc/extranet/Controlleur/class.ws.conversion.session.php b/inc/extranet/Controlleur/class.ws.conversion.session.php new file mode 100644 index 000000000..ee639f696 --- /dev/null +++ b/inc/extranet/Controlleur/class.ws.conversion.session.php @@ -0,0 +1,19 @@ +documents = $_SESSION['conversionSession']; + $this->session_id = $session_id; + $_SESSION['conversionSessionProgress'] = '0'; + unset($_SESSION['conversionSession']); + } + + public function process() + { + } +} + +?> \ No newline at end of file diff --git a/inc/extranet/Controlleur/class.ws.flash.php b/inc/extranet/Controlleur/class.ws.flash.php index 93ab27af8..c6f624885 100644 --- a/inc/extranet/Controlleur/class.ws.flash.php +++ b/inc/extranet/Controlleur/class.ws.flash.php @@ -12,6 +12,9 @@ class wsFlash extends cubeFlashGateway { public function uploadDocument() { global $core; + if (!isset($_SESSION['conversionSession'])) { + $_SESSION['conversionSession'] = array(); + } $dao = new wsDAODocument($core->con); foreach($_FILES as $varname => $infos) { if ($infos['error']) { @@ -30,11 +33,9 @@ class wsFlash extends cubeFlashGateway { $data['localInfos'] = $li; $document = $dao->sauve($data); $document->copyOriginal($infos['tmp_name']); - $document->getInfos(); - $document->getTexts(); - $document->makeMiniShot(); } $this->xml->addChild('document_id', $document->document_id); + $_SESSION['conversionSession'][] = $document->document_id; } public function testDocuments() @@ -64,6 +65,26 @@ class wsFlash extends cubeFlashGateway { $docs = array_unique($docs); $p->addAttribute('documents', implode(',', $docs)); } + + public function processConversionSession() + { + $http = new cubeHTTP($_SERVER['HTTP_HOST']); + $http->setDataTimeout(3); + $http->setCookies(array(session_name() => session_id())); + $http->get('/flash/processConversionSessionAsync'); + } + + public function getConversionSessionProgress() + { + $this->xml->addChild('progress', $_SESSION['conversionSessionProgress']); + } + + public function processConversionSessionAsync() + { + cubePHP::neverStop(); + $conversion = new wsConversionSession(session_id()); + $conversion->process(); + } } ?> \ No newline at end of file -- 2.39.5