From e530f905ee89b2d13b6a680dea4a7cb2faea1024 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Fri, 19 Feb 2010 14:50:17 +0000 Subject: [PATCH] --- .../class.ws.conversion.session.php | 7 +++--- inc/extranet/Controlleur/class.ws.flash.php | 25 +++++++++++++------ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/inc/extranet/Controlleur/class.ws.conversion.session.php b/inc/extranet/Controlleur/class.ws.conversion.session.php index ee639f696..cba1eb434 100644 --- a/inc/extranet/Controlleur/class.ws.conversion.session.php +++ b/inc/extranet/Controlleur/class.ws.conversion.session.php @@ -2,17 +2,16 @@ class wsConversionSession { public $documents = array(); - public $session_id; - public function __construct($session_id) + public function __construct() { $this->documents = $_SESSION['conversionSession']; - $this->session_id = $session_id; - $_SESSION['conversionSessionProgress'] = '0'; + $_SESSION['conversionSessionProgress'] = 0; unset($_SESSION['conversionSession']); } public function process() { + $_SESSION['conversionSessionProgress']=100; } } diff --git a/inc/extranet/Controlleur/class.ws.flash.php b/inc/extranet/Controlleur/class.ws.flash.php index c6f624885..e3e5de1b3 100644 --- a/inc/extranet/Controlleur/class.ws.flash.php +++ b/inc/extranet/Controlleur/class.ws.flash.php @@ -68,23 +68,32 @@ class wsFlash extends cubeFlashGateway { public function processConversionSession() { + $cookies = array(session_name() => session_id()); $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']); + $http->setCookies($cookies); + try { + $http->get('/flash/processConversionSessionAsync'); + } + catch(Exception $e) { + } } public function processConversionSessionAsync() { + file_put_contents(ROOT . '/test.txt', print_r($_SESSION, true)); + $conversion = new wsConversionSession(); cubePHP::neverStop(); - $conversion = new wsConversionSession(session_id()); $conversion->process(); } + + public function getConversionSessionProgress() + { + if (!isset($_SESSION['conversionSessionProgress'])) { + $_SESSION['conversionSessionProgress'] = 0; + } + $this->xml->addChild('progress', $_SESSION['conversionSessionProgress']); + } } ?> \ No newline at end of file -- 2.39.5