Remove depencies of library/common/curl : getUrl

This commit is contained in:
Michael RICOIS 2013-10-31 13:41:53 +00:00
parent b04cce503e
commit 35f9ccbd44

View File

@ -722,27 +722,27 @@ class SurveillanceController extends Zend_Controller_Action
}
$this->view->assign('selectFiltre', $selectFiltre);
//Récupération du fichier
$file = $path.'/'.$nomFic;
$file2 = $file.'.bz2';
if (!file_exists($file) || filesize($file)==0 ) {
//Génération du fichier
try {
$O = $client->getListeFichierSurv($user->getLogin(), $user->getPrenom(), $nomFic);
} catch (SoapFault $fault) {}
require_once 'common/curl.php';
$page = getUrl('http://78.31.45.206/csv/'.$nomFic.'.bz2', '', '', '', false);
$body = $page['body'];
$fp=@fopen($file2, 'w');
@fwrite($fp, $body);
@fclose($fp);
$bz = bzopen($file2, "r") or die("Impossible d'ouvrir le fichier $file");
$fp=@fopen($file, 'w');
while (!feof($bz)) {
@fwrite($fp, bzread($bz, 4096));
}
bzclose($bz);
try {
$client = new Zend_Http_Client('http://78.31.45.206/csv/'.$nomFic.'.bz2');
$client->setStream();
$response = $client->request('GET');
if ( copy($response->getStreamName(), $file.'.bz2') ) {
$bz = bzopen($file.'.bz2', "r") or die("Impossible d'ouvrir le fichier $file");
$fp=fopen($file, 'w');
while (!feof($bz)) {
fwrite($fp, bzread($bz, 4096));
}
bzclose($bz);
}
} catch (Zend_Http_Client_Exception $e) {}
}
$tab = array();
@ -820,25 +820,25 @@ class SurveillanceController extends Zend_Controller_Action
//Récupération du fichier
$file = $path.'/'.$nomFic;
$file2 = $file.'.bz2';
if (!file_exists($file) || filesize($file)==0 ) {
//Génération du fichier
try {
$O = $client->getListeFichierSurv($user->getLogin(), $user->getPrenom(), $nomFic);
} catch (SoapFault $fault) {
}
require_once 'common/curl.php';
$page = getUrl('http://78.31.45.206/csv/'.$nomFic.'.bz2', '', '', '', false);
$body = $page['body'];
$fp=@fopen($file2, 'w');
@fwrite($fp, $body);
@fclose($fp);
$bz = bzopen($file2, "r") or die("Impossible d'ouvrir le fichier $file");
$fp=@fopen($file, 'w');
while (!feof($bz)) {
@fwrite($fp, bzread($bz, 4096));
}
bzclose($bz);
} catch (SoapFault $fault) {}
try {
$client = new Zend_Http_Client('http://78.31.45.206/csv/'.$nomFic.'.bz2');
$client->setStream();
$response = $client->request('GET');
if ( copy($response->getStreamName(), $file.'.bz2') ) {
$bz = bzopen($file.'.bz2', "r") or die("Impossible d'ouvrir le fichier $file");
$fp=fopen($file, 'w');
while (!feof($bz)) {
fwrite($fp, bzread($bz, 4096));
}
bzclose($bz);
}
} catch (Zend_Http_Client_Exception $e) {}
}
$content_type = 'application/csv-tab-delimited-table';
@ -906,25 +906,25 @@ class SurveillanceController extends Zend_Controller_Action
//Récupération du fichier
$file = $path.'/'.$nomFic;
$file2 = $file.'.bz2';
if (!file_exists($file) || filesize($file)==0 ) {
//Génération du fichier
try {
$O = $client->getListeFichierSurv($user->getLogin(), $user->getPrenom(), $nomFic);
} catch (SoapFault $fault) {
}
require_once 'common/curl.php';
$page = getUrl('http://78.31.45.206/csv/'.$nomFic.'.bz2', '', '', '', false);
$body = $page['body'];
$fp=@fopen($file2, 'w');
@fwrite($fp, $body);
@fclose($fp);
$bz = bzopen($file2, "r") or die("Impossible d'ouvrir le fichier $file");
$fp=@fopen($file, 'w');
while (!feof($bz)) {
@fwrite($fp, bzread($bz, 4096));
}
bzclose($bz);
} catch (SoapFault $fault) {}
try {
$client = new Zend_Http_Client('http://78.31.45.206/csv/'.$nomFic.'.bz2');
$client->setStream();
$response = $client->request('GET');
if ( copy($response->getStreamName(), $file.'.bz2') ) {
$bz = bzopen($file.'.bz2', "r") or die("Impossible d'ouvrir le fichier $file");
$fp=fopen($file, 'w');
while (!feof($bz)) {
fwrite($fp, bzread($bz, 4096));
}
bzclose($bz);
}
} catch (Zend_Http_Client_Exception $e) {}
}
$tab = array();