Better classmap

This commit is contained in:
Michael RICOIS 2015-07-20 08:14:39 +00:00
parent d26e95c613
commit 0b6954ad79
16 changed files with 2651 additions and 2641 deletions

View File

@ -1,5 +0,0 @@
<?php
// Generated by ZF's ./bin/classmap_generator.php
return array(
'Bootstrap' => dirname(__FILE__) . '/Bootstrap.php',
);

View File

@ -1,63 +0,0 @@
<?php
// Generated by ZF's ./bin/classmap_generator.php
return array(
'Application_Model_AssoActes' => dirname(__FILE__) . '/Model/AssoActes.php',
'Application_Model_BopiMarques' => dirname(__FILE__) . '/Model/BopiMarques.php',
'Application_Model_Commandes' => dirname(__FILE__) . '/Model/Commandes.php',
'Application_Model_CommandesActe' => dirname(__FILE__) . '/Model/CommandesActe.php',
'Application_Model_CommandesAsso' => dirname(__FILE__) . '/Model/CommandesAsso.php',
'Application_Model_CommandesBilan' => dirname(__FILE__) . '/Model/CommandesBilan.php',
'Application_Model_CommandesEven' => dirname(__FILE__) . '/Model/CommandesEven.php',
'Application_Model_CommandesKbis' => dirname(__FILE__) . '/Model/CommandesKbis.php',
'Application_Model_CommandesPieces' => dirname(__FILE__) . '/Model/CommandesPieces.php',
'Application_Model_CommandesStatut' => dirname(__FILE__) . '/Model/CommandesStatut.php',
'Application_Model_ExtractionCommandes' => dirname(__FILE__) . '/Model/ExtractionCommandes.php',
'Application_Model_FedasoBilans' => dirname(__FILE__) . '/Model/FedasoBilans.php',
'Application_Model_HistoriquesBilans' => dirname(__FILE__) . '/Model/HistoriquesBilans.php',
'Application_Model_InseeTabVilles' => dirname(__FILE__) . '/Model/InseeTabVilles.php',
'Application_Model_JoAssoBilans' => dirname(__FILE__) . '/Model/JoAssoBilans.php',
'Application_Model_JoAssoSubventions' => dirname(__FILE__) . '/Model/JoAssoSubventions.php',
'Application_Model_JoBilans' => dirname(__FILE__) . '/Model/JoBilans.php',
'Application_Model_JoBilansUser' => dirname(__FILE__) . '/Model/JoBilansUser.php',
'Application_Model_JoBoampLots' => dirname(__FILE__) . '/Model/JoBoampLots.php',
'Application_Model_JoBodaccDetail' => dirname(__FILE__) . '/Model/JoBodaccDetail.php',
'Application_Model_JoBodaccFonctions' => dirname(__FILE__) . '/Model/JoBodaccFonctions.php',
'Application_Model_JoGreffesActes' => dirname(__FILE__) . '/Model/JoGreffesActes.php',
'Application_Model_JoGreffesBilans' => dirname(__FILE__) . '/Model/JoGreffesBilans.php',
'Application_Model_JoLiens' => dirname(__FILE__) . '/Model/JoLiens.php',
'Application_Model_JoLiensDoc' => dirname(__FILE__) . '/Model/JoLiensDoc.php',
'Application_Model_JoLiensRef' => dirname(__FILE__) . '/Model/JoLiensRef.php',
'Application_Model_JoRncsDirigeants' => dirname(__FILE__) . '/Model/JoRncsDirigeants.php',
'Application_Model_JoRncsEtab' => dirname(__FILE__) . '/Model/JoRncsEtab.php',
'Application_Model_JoScoresCutoff' => dirname(__FILE__) . '/Model/JoScoresCutoff.php',
'Application_Model_JoScoresCutoffMvt' => dirname(__FILE__) . '/Model/JoScoresCutoffMvt.php',
'Application_Model_JoScoresSurveillance' => dirname(__FILE__) . '/Model/JoScoresSurveillance.php',
'Application_Model_JoSfrData' => dirname(__FILE__) . '/Model/JoSfrData.php',
'Application_Model_JoSurveillancesSite' => dirname(__FILE__) . '/Model/JoSurveillancesSite.php',
'Application_Model_JoTabDevises' => dirname(__FILE__) . '/Model/JoTabDevises.php',
'Application_Model_JoTabEvenements' => dirname(__FILE__) . '/Model/JoTabEvenements.php',
'Application_Model_JoTabFJur' => dirname(__FILE__) . '/Model/JoTabFJur.php',
'Application_Model_JoTabMandataires' => dirname(__FILE__) . '/Model/JoTabMandataires.php',
'Application_Model_JoTabNaf5' => dirname(__FILE__) . '/Model/JoTabNaf5.php',
'Application_Model_JoTabPays' => dirname(__FILE__) . '/Model/JoTabPays.php',
'Application_Model_JoTelephonie' => dirname(__FILE__) . '/Model/JoTelephonie.php',
'Application_Model_Sdv1BourseIsin' => dirname(__FILE__) . '/Model/Sdv1BourseIsin.php',
'Application_Model_Sdv1Clients' => dirname(__FILE__) . '/Model/Sdv1Clients.php',
'Application_Model_Sdv1ClientsServices' => dirname(__FILE__) . '/Model/Sdv1ClientsServices.php',
'Application_Model_Sdv1ClientsServicesDroits' => dirname(__FILE__) . '/Model/Sdv1ClientsServicesDroits.php',
'Application_Model_Sdv1ClientsServicesIP' => dirname(__FILE__) . '/Model/Sdv1ClientsServicesIP.php',
'Application_Model_Sdv1ClientsServicesTrigger' => dirname(__FILE__) . '/Model/Sdv1ClientsServicesTrigger.php',
'Application_Model_Sdv1ClientsTarifs' => dirname(__FILE__) . '/Model/Sdv1ClientsTarifs.php',
'Application_Model_Sdv1DirigeantsOp' => dirname(__FILE__) . '/Model/Sdv1DirigeantsOp.php',
'Application_Model_Sdv1FluxFileIn' => dirname(__FILE__) . '/Model/Sdv1FluxFileIn.php',
'Application_Model_Sdv1FluxFileOut' => dirname(__FILE__) . '/Model/Sdv1FluxFileOut.php',
'Application_Model_Sdv1GreffeCommandesAc' => dirname(__FILE__) . '/Model/Sdv1GreffeCommandesAc.php',
'Application_Model_Sdv1GreffeCommandesBi' => dirname(__FILE__) . '/Model/Sdv1GreffeCommandesBi.php',
'Application_Model_Sdv1GreffeCommandesKb' => dirname(__FILE__) . '/Model/Sdv1GreffeCommandesKb.php',
'Application_Model_Sdv1Logs' => dirname(__FILE__) . '/Model/Sdv1Logs.php',
'Application_Model_Sdv1Prestations' => dirname(__FILE__) . '/Model/Sdv1Prestations.php',
'Application_Model_Sdv1TabIdLocal' => dirname(__FILE__) . '/Model/Sdv1TabIdLocal.php',
'Application_Model_Sdv1Utilisateurs' => dirname(__FILE__) . '/Model/Sdv1Utilisateurs.php',
'Application_Model_Sdv1UtilisateursEmails' => dirname(__FILE__) . '/Model/Sdv1UtilisateursEmails.php',
'Application_Model_Sdv1UtilisateursService' => dirname(__FILE__) . '/Model/Sdv1UtilisateursService.php',
);

View File

@ -0,0 +1,34 @@
<?php
// Define path to application directory
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../../application'));
// Define application environment
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
realpath(APPLICATION_PATH . '/../library'),
get_include_path(),
)));
$dir = array(
APPLICATION_PATH,
APPLICATION_PATH."/../library/Zend",
APPLICATION_PATH."/../library/Application",
APPLICATION_PATH."/../library/Scores",
APPLICATION_PATH."/../library/SdMetier",
);
$fileClassmap = APPLICATION_PATH."/../library/autoload_classmap.php";
$i = 0;
foreach($dir as $d) {
$options = " -a";
if ($i==0) {
$options = " -w";
}
passthru("php ".APPLICATION_PATH."/../bin/classmap_generator.php -l ".$d.$options." -o ".$fileClassmap);
$i++;
}

View File

@ -35,10 +35,7 @@ require_once 'Zend/Loader/AutoloaderFactory.php';
require_once 'Zend/Loader/ClassMapAutoloader.php';
Zend_Loader_AutoloaderFactory::factory(array(
'Zend_Loader_ClassMapAutoloader' => array(
__DIR__ . '/../library/Zend/autoload_classmap.php',
__DIR__ . '/../library/Application/autoload_classmap.php',
__DIR__ . '/../library/Scores/autoload_classmap.php',
__DIR__ . '/../application/autoload_classmap.php',
__DIR__ . '/../library/autoload_classmap.php',
),
'Zend_Loader_StandardAutoloader' => array(
'prefixes' => array(
@ -64,13 +61,14 @@ $application = new Zend_Application(
//Options
try {
$opts = new Zend_Console_Getopt(array(
'help|?' => "Displays usage information.",
'tout|t' => "Calculer tous les scores",
'verbose|v' => "Mode bavard ou debug",
'ancien|a' => "Recalculer tous les scores avec indiscore>0 et un encours à 0 !",
'list|l' => "Lister les déclencheurs existants pour le recalcul des scores",
'declencheur|d=s' => "Lancer le calcul des scores pour le déclencheur XXX",
'max=s' => "Nombre max d'unités à calculer pour un déclencheur",
'help|?' => "Displays usage information.",
'tout|t' => "Calculer tous les scores",
'verbose|v' => "Mode bavard ou debug",
'ancien|a' => "Recalculer tous les scores avec indiscore>0 et un encours à 0 !",
'list|l' => "Lister les déclencheurs existants pour le recalcul des scores",
'declencheur|d=s' => "Lancer le calcul des scores pour le déclencheur XXX",
'max=s' => "Nombre max d'unités à calculer pour un déclencheur",
'nostop' => "Ne pas stopper",
));
$opts->parse();
} catch (Zend_Console_Getopt_Exception $e) {
@ -99,7 +97,7 @@ $tabQueries = array(
/* Privileges Facto */
'privileges2' => "SELECT $strSelect, 'privileges2' AS source FROM ".$tableSurvTmp."_privileges2 s, sdv1.ge_cs2 p WHERE p.siren>1000 AND s.siren = p.siren AND (p.dateInsert>=s.dateUpdate OR p.dateConf>=s.dateUpdate) AND p.cs='P' GROUP BY siren",
/* IMPAYES Facto */
'impayes' => "SELECT $strSelect, 'impayes' AS source FROM ".$tableSurvTmp."_impayes s, sdv1.ge_cs2 p WHERE p.siren>1000 AND s.siren = p.siren AND (p.dateInsert>=s.dateUpdate OR p.dateConf>=s.dateUpdate) AND p.cs='I' GROUP BY siren",
/*'impayes' => "SELECT $strSelect, 'impayes' AS source FROM ".$tableSurvTmp."_impayes s, sdv1.ge_cs2 p WHERE p.siren>1000 AND s.siren = p.siren AND (p.dateInsert>=s.dateUpdate OR p.dateConf>=s.dateUpdate) AND p.cs='I' GROUP BY siren",*/
/* Ajout d'un nouveau score */
'ajout' => "SELECT $strSelect, 'ajout' AS source FROM ".$tableSurvTmp."_ajout s WHERE s.siren>1000 AND ((DATEDIFF(NOW(),s.indiScoreDate) IS NULL AND s.dateUpdate<DATE(NOW()) OR s.indiScoreDate=0)) GROUP BY siren",
/* IndiScores demandés ce jour */
@ -225,17 +223,6 @@ $nbScoresSans=$nbScoresModif=$nbScoresNouv=$nbScoresProcol=$iRow=$nbRowsTot=0;
$iInsee = new MInsee();
foreach ($tabQueries as $declencheur => $query)
{
//Arrêt de l'execution entre 4h30 ou 7h00
if ( date('Hi')*1>=430 && date('Hi')*1<=700 && !$opts->verbose ) break;
//Arrêt de l'execution à 18h30 pour le déclencheur tout
if ( date('Hi')*1>=1830 && $opts->tout ) break;
//Arrêt de l'execution à 23h45
if ( date('Hi')*1>=2345 ) break;
$tableName = $tableSurvTmp . '_' . $declencheur;
echo date('Y/m/d H:i:s') ." - Copie de la table ".$tableName.PHP_EOL;
@ -290,7 +277,7 @@ foreach ($tabQueries as $declencheur => $query)
if ( $indiScore == $indiScorePre && $encours == $encoursPre && $dateScore!=0 ) {
$nbScoresSans++;
if ($opts->verbose) echo date('Y/m/d H:i:s') ." - $iRow/$nbRowsTot - Siren $siren : $indiScore / 100 ($encours EUR) inchangé depuis $dateScore (Source=$sourceModif).\n";
echo date('Y/m/d H:i:s') ." - $iRow/$nbRowsTot - Siren $siren : $indiScore / 100 ($encours EUR) inchangé depuis $dateScore (Source=$sourceModif).\n";
} else {
if ($dateScore==0) {
$nbScoresNouv++;
@ -302,7 +289,7 @@ foreach ($tabQueries as $declencheur => $query)
}
//Arrêt de l'execution à 19h00
if ( date('Hi')*1>=1900 ) break;
if ( date('Hi')*1>=1900 && !$opts->nostop) break;
// Arret sur indicateur maximum
if ( $opts->max && $iRow >= $opts->max) break;

View File

@ -21,10 +21,7 @@ require_once 'Zend/Loader/AutoloaderFactory.php';
require_once 'Zend/Loader/ClassMapAutoloader.php';
Zend_Loader_AutoloaderFactory::factory(array(
'Zend_Loader_ClassMapAutoloader' => array(
__DIR__ . '/../../library/Zend/autoload_classmap.php',
__DIR__ . '/../../library/Application/autoload_classmap.php',
__DIR__ . '/../../library/Scores/autoload_classmap.php',
__DIR__ . '/../../application/autoload_classmap.php',
__DIR__ . '/../../library/autoload_classmap.php',
),
'Zend_Loader_StandardAutoloader' => array(
'prefixes' => array(
@ -183,7 +180,7 @@ try {
if ( count($resultItem) == 0 ) {
echo date('Y-m-d H:i:s')." - Aucun élément.\n";
} else {
$dateBegin = date('YmdHis');
echo date('Y-m-d H:i:s')." - NbLignes=".count($resultItem)."\n";
@ -204,14 +201,14 @@ if ( count($resultItem) == 0 ) {
$row = 0;
// --- Content
foreach ($resultItem as $item) {
if (intval($item->siren) == 0) {
continue;
}
$row++;
if ($opts->debug) { echo date('Y-m-d H:i:s')." - Ligne ".$row; }
// --- Data
$sql = $db->select()
->from('etablissements', array(
@ -220,7 +217,7 @@ if ( count($resultItem) == 0 ) {
'LPAD(nic,5,0) AS nic'),
'jo')->where('siren=?', $item->siren)->where('siege=1')->order('actif DESC')->limit(1);
$etablissement = $db->fetchRow($sql, null, Zend_Db::FETCH_OBJ);
$DateCreaEn = '';
$BilanCA = '';
$BilanDateCloture = '';
@ -228,24 +225,24 @@ if ( count($resultItem) == 0 ) {
$Encours = '';
// --- Calcul du score ou lecture depuis la table de sauvegarde des scores
if ($item->indiScoreDate === null) {
if ($opts->debug) { echo " - Calcul du score"; }
$evaluation = calculIndiScore($item->siren, 0, false, 0, false, 'scores', $iDb);
$PaiementCS = $evaluation['cs'];
$Indiscore = $evaluation['Indiscore20'];
$Encours = round($evaluation['encours']/1000) * 1000;
} else {
if ($opts->debug) { echo " - Données en cache"; }
$PaiementCS = $item->cs;
$Indiscore = $item->indiScore20;
$Encours = round($item->encours/1000) * 1000;
}
// --- Informations identitaire
$iInsee = new MInsee($iDb);
$tabIdentite = $iInsee->getIdentiteEntreprise($item->siren, 0, 0, false, false);
@ -255,7 +252,7 @@ if ( count($resultItem) == 0 ) {
} elseif ( $tabIdentite['DateCreaEn'] > 0 ) {
$DateCreaEn = $tabIdentite['DateCreaEn'];
}
// --- Correction pour l'envoi des dates
if ( !empty($DateCreaEn) ) {
if (strlen($DateCreaEn)<8) {
@ -265,7 +262,7 @@ if ( count($resultItem) == 0 ) {
$DateCreaEn = substr($DateCreaEn,0,6).'01';
}
}
// --- Gestion des bilans
$today = new Zend_Date();
if ( !empty($tabIdentite['bilanDate']) ) {
@ -275,20 +272,20 @@ if ( count($resultItem) == 0 ) {
$BilanCA = $tabIdentite['bilanFL'];
}
}
// --- Estimation du CA bilan
if (empty($BilanCA) && !empty($tabIdentite['bilanAnnee'])) {
$dateCreaRecente = new Zend_Date();
$dateCreaRecente->subYear(2)->setMonth(1)->setDay(1);
$dateClotureEstime = new Zend_Date();
$dateClotureEstime->setMonth(12)->setDay(31);
// --- Condition RRG
if ( $tabIdentite['Eff'] > 0
|| substr($tabIdentite['FJ'],0,1) == 1 && $tabIdentite['Eff'] < 1
|| !empty($tabIdentite['NafEnt']) && strlen($tabIdentite['NafEnt']) == 5 && $tabIdentite['NafEnt'] != '0000Z' ) {
// --- Création récente
if ( $dateCreaRecente->compare($DateCreaEn, 'yyMMdd') == 1 ) {
$BilanDateCloture = '3112'.date('Y');
@ -301,7 +298,7 @@ if ( count($resultItem) == 0 ) {
}
}
}
// Récupération du libellé d'information de paiement
$PaiementInfo = '';
if ( in_array($PaiementCS, array('0', 'I', 'P', 'D')) ) {
@ -309,7 +306,7 @@ if ( count($resultItem) == 0 ) {
$info = $iFacto->getLibInfoCS($PaiementCS);
$PaiementInfo = $info['LibCS'];
}
$values = array(
'SourceID' => $etablissement->source_id,
'Siret' => $etablissement->siren.$etablissement->nic,
@ -321,7 +318,7 @@ if ( count($resultItem) == 0 ) {
'Indiscore' => $Indiscore,
'Encours' => $Encours,
);
// --- Trier données
$line = array();
foreach ( $fileOptionsOut['columns'] as $i => $column ) {
@ -334,12 +331,12 @@ if ( count($resultItem) == 0 ) {
} else {
fputcsv($fp, $line, $fileOptionsOut['delimiter'], $fileOptionsOut['enclosure']);
}
if ($opts->debug) { echo "\n"; }
}
// --- Fermeture fichier
fclose($fp);
// --- Encoding
if ( array_key_exists('encoding', $fileOptionsOut) ) {
if ( $fileOptionsOut['encoding'] == 'ISO-8859-15' ) {
@ -347,10 +344,10 @@ if ( count($resultItem) == 0 ) {
passthru("cp -fv ".$file.".enc ".$file);
}
}
$nbLines = $row;
echo date('Y-m-d H:i:s')." - Nb Lignes Traitées : ".$nbLines."\n";
if ( $opts->cron ) {
$fluxoutM = new Application_Model_Sdv1FluxFileOut();
$dateEnd = date('YmdHis');

View File

@ -25,10 +25,7 @@ require_once 'Zend/Loader/AutoloaderFactory.php';
require_once 'Zend/Loader/ClassMapAutoloader.php';
Zend_Loader_AutoloaderFactory::factory(array(
'Zend_Loader_ClassMapAutoloader' => array(
__DIR__ . '/../../library/Zend/autoload_classmap.php',
__DIR__ . '/../../library/Application/autoload_classmap.php',
__DIR__ . '/../../library/Scores/autoload_classmap.php',
__DIR__ . '/../../application/autoload_classmap.php',
__DIR__ . '/../../library/autoload_classmap.php',
),
'Zend_Loader_StandardAutoloader' => array(
'prefixes' => array(
@ -292,7 +289,7 @@ if ($opts->load && !$opts->evaluate) {
$sql = "UPDATE jo.sfr_data SET error=2020 WHERE NumSeq='".$seq."' AND error=0 AND siren IN (SELECT siren FROM jo.scores_surveillance WHERE naf='' OR CJ IS NULL OR dateCrea IS NULL OR indiScoreDate='0000-00-00')";
$result = $db->query($sql);*/
}
// --- Nettoyage
$date = new Zend_Date();
if ( $date->getWeekday() == 6 ) {
@ -303,7 +300,7 @@ if ($opts->load && !$opts->evaluate) {
$result = $db->query($sql);
} catch (Zend_Db_Exception $e) {}
}
}
/**

View File

@ -24,10 +24,7 @@ require_once 'Zend/Loader/AutoloaderFactory.php';
require_once 'Zend/Loader/ClassMapAutoloader.php';
Zend_Loader_AutoloaderFactory::factory(array(
'Zend_Loader_ClassMapAutoloader' => array(
__DIR__ . '/../../library/Zend/autoload_classmap.php',
__DIR__ . '/../../library/Application/autoload_classmap.php',
__DIR__ . '/../../library/Scores/autoload_classmap.php',
__DIR__ . '/../../application/autoload_classmap.php',
__DIR__ . '/../../library/autoload_classmap.php',
),
'Zend_Loader_StandardAutoloader' => array(
'prefixes' => array(

View File

@ -29,10 +29,7 @@ require_once 'Zend/Loader/AutoloaderFactory.php';
require_once 'Zend/Loader/ClassMapAutoloader.php';
Zend_Loader_AutoloaderFactory::factory(array(
'Zend_Loader_ClassMapAutoloader' => array(
__DIR__ . '/../library/Zend/autoload_classmap.php',
__DIR__ . '/../library/Application/autoload_classmap.php',
__DIR__ . '/../library/Scores/autoload_classmap.php',
__DIR__ . '/../application/autoload_classmap.php',
__DIR__ . '/../library/autoload_classmap.php',
),
'Zend_Loader_StandardAutoloader' => array(
'prefixes' => array(

View File

@ -27,10 +27,7 @@ require_once 'Zend/Loader/AutoloaderFactory.php';
require_once 'Zend/Loader/ClassMapAutoloader.php';
Zend_Loader_AutoloaderFactory::factory(array(
'Zend_Loader_ClassMapAutoloader' => array(
__DIR__ . '/../library/Zend/autoload_classmap.php',
__DIR__ . '/../library/Application/autoload_classmap.php',
__DIR__ . '/../library/Scores/autoload_classmap.php',
__DIR__ . '/../application/autoload_classmap.php',
__DIR__ . '/../library/autoload_classmap.php',
),
'Zend_Loader_StandardAutoloader' => array(
'prefixes' => array(

View File

@ -24,10 +24,7 @@ require_once 'Zend/Loader/AutoloaderFactory.php';
require_once 'Zend/Loader/ClassMapAutoloader.php';
Zend_Loader_AutoloaderFactory::factory(array(
'Zend_Loader_ClassMapAutoloader' => array(
__DIR__ . '/../library/Zend/autoload_classmap.php',
__DIR__ . '/../library/Application/autoload_classmap.php',
__DIR__ . '/../library/Scores/autoload_classmap.php',
__DIR__ . '/../application/autoload_classmap.php',
__DIR__ . '/../library/autoload_classmap.php',
),
'Zend_Loader_StandardAutoloader' => array(
'prefixes' => array(

View File

@ -24,10 +24,7 @@ require_once 'Zend/Loader/AutoloaderFactory.php';
require_once 'Zend/Loader/ClassMapAutoloader.php';
Zend_Loader_AutoloaderFactory::factory(array(
'Zend_Loader_ClassMapAutoloader' => array(
__DIR__ . '/../library/Zend/autoload_classmap.php',
__DIR__ . '/../library/Application/autoload_classmap.php',
__DIR__ . '/../library/Scores/autoload_classmap.php',
__DIR__ . '/../application/autoload_classmap.php',
__DIR__ . '/../library/autoload_classmap.php',
),
'Zend_Loader_StandardAutoloader' => array(
'prefixes' => array(

View File

@ -26,10 +26,7 @@ require_once 'Zend/Loader/AutoloaderFactory.php';
require_once 'Zend/Loader/ClassMapAutoloader.php';
Zend_Loader_AutoloaderFactory::factory(array(
'Zend_Loader_ClassMapAutoloader' => array(
__DIR__ . '/../library/Zend/autoload_classmap.php',
__DIR__ . '/../library/Application/autoload_classmap.php',
__DIR__ . '/../library/Scores/autoload_classmap.php',
__DIR__ . '/../application/autoload_classmap.php',
__DIR__ . '/../library/autoload_classmap.php',
),
'Zend_Loader_StandardAutoloader' => array(
'prefixes' => array(

View File

@ -24,10 +24,7 @@ require_once 'Zend/Loader/AutoloaderFactory.php';
require_once 'Zend/Loader/ClassMapAutoloader.php';
Zend_Loader_AutoloaderFactory::factory(array(
'Zend_Loader_ClassMapAutoloader' => array(
__DIR__ . '/../../library/Zend/autoload_classmap.php',
__DIR__ . '/../../library/Application/autoload_classmap.php',
__DIR__ . '/../../library/Scores/autoload_classmap.php',
__DIR__ . '/../../application/autoload_classmap.php',
__DIR__ . '/../../library/autoload_classmap.php',
),
'Zend_Loader_StandardAutoloader' => array(
'prefixes' => array(

View File

@ -33,10 +33,7 @@ require_once 'Zend/Loader/AutoloaderFactory.php';
require_once 'Zend/Loader/ClassMapAutoloader.php';
Zend_Loader_AutoloaderFactory::factory(array(
'Zend_Loader_ClassMapAutoloader' => array(
__DIR__ . '/../../library/Zend/autoload_classmap.php',
__DIR__ . '/../../library/Application/autoload_classmap.php',
__DIR__ . '/../../library/Scores/autoload_classmap.php',
__DIR__ . '/../../application/autoload_classmap.php',
__DIR__ . '/../../library/autoload_classmap.php',
),
'Zend_Loader_StandardAutoloader' => array(
'prefixes' => array(

View File

@ -20,10 +20,7 @@ require_once 'Zend/Loader/AutoloaderFactory.php';
require_once 'Zend/Loader/ClassMapAutoloader.php';
Zend_Loader_AutoloaderFactory::factory(array(
'Zend_Loader_ClassMapAutoloader' => array(
__DIR__ . '/../../library/Zend/autoload_classmap.php',
__DIR__ . '/../../library/Application/autoload_classmap.php',
__DIR__ . '/../../library/Scores/autoload_classmap.php',
__DIR__ . '/../../application/autoload_classmap.php',
__DIR__ . '/../../library/autoload_classmap.php',
),
'Zend_Loader_StandardAutoloader' => array(
'prefixes' => array(
@ -113,7 +110,7 @@ foreach($requests as $n => $r) {
'name' => $n,
//'encoding' => 'ISO-8859-15',
);
// --- Requete SQL
if (is_array($r['sql'])){
$i = 0;
@ -147,11 +144,11 @@ foreach($requests as $n => $r) {
if ( count($fileOptionsOut['header']) > 0 ) {
fputcsv($fp, $fileOptionsOut['header'], $fileOptionsOut['delimiter'], $fileOptionsOut['enclosure']);
}
foreach ($result as $item) {
$values = (array)$item;
// --- Trier données
$line = array();
foreach ( $fileOptionsOut['columns'] as $i => $column ) {
@ -163,15 +160,15 @@ foreach($requests as $n => $r) {
} else {
fputcsv($fp, $line, $fileOptionsOut['delimiter'], $fileOptionsOut['enclosure']);
}
}
// --- Fermeture fichier
fclose($fp);
// --- Taille du fichier
$size = filesize($file);
// --- Inscription pour livraison automatique dans le flux
try {
$fileoutM = new Application_Model_Sdv1FluxFileOut();
@ -190,9 +187,9 @@ foreach($requests as $n => $r) {
echo date('Y-m-d H:i:s')." - ".$e->getMessage()."\n";
continue;
}
}
}