Better classmap

This commit is contained in:
Michael RICOIS 2015-07-20 09:12:47 +00:00
commit 58becead4b
21 changed files with 2775 additions and 2796 deletions

View File

@ -1,23 +0,0 @@
<?php
// Generated by ZF's ./bin/classmap_generator.php
return array(
'Bootstrap' => dirname(__FILE__) . '//Bootstrap.php',
'DemoController' => dirname(__FILE__) . '//controllers/DemoController.php',
'DocumentationController' => dirname(__FILE__) . '//controllers/DocumentationController.php',
'ErrorController' => dirname(__FILE__) . '//controllers/ErrorController.php',
'ExportController' => dirname(__FILE__) . '//controllers/ExportController.php',
'FichierController' => dirname(__FILE__) . '//controllers/FichierController.php',
'ImportController' => dirname(__FILE__) . '//controllers/ImportController.php',
'IndexController' => dirname(__FILE__) . '//controllers/IndexController.php',
'JsonrpcController' => dirname(__FILE__) . '//controllers/JsonrpcController.php',
'RefController' => dirname(__FILE__) . '//controllers/RefController.php',
'ServiceController' => dirname(__FILE__) . '//controllers/ServiceController.php',
'UserController' => dirname(__FILE__) . '//controllers/UserController.php',
'Zend_View_Helper_DocComplement' => dirname(__FILE__) . '//views/helpers/DocComplement.php',
'Zend_View_Helper_DocDescription' => dirname(__FILE__) . '//views/helpers/DocDescription.php',
'Zend_View_Helper_DocExemple' => dirname(__FILE__) . '//views/helpers/DocExemple.php',
'Zend_View_Helper_DocMethod' => dirname(__FILE__) . '//views/helpers/DocMethod.php',
'Zend_View_Helper_DocParameter' => dirname(__FILE__) . '//views/helpers/DocParameter.php',
'Zend_View_Helper_DocReturn' => dirname(__FILE__) . '//views/helpers/DocReturn.php',
'Zend_View_Helper_ProfileLink' => dirname(__FILE__) . '//views/helpers/ProfileLink.php',
);

View File

@ -1,75 +0,0 @@
<?php
// Generated by ZF's ./bin/classmap_generator.php
return array(
'Application_Controller_Plugin_Auth' => dirname(__FILE__) . '//Controller/Plugin/Auth.php',
'Application_Controller_Plugin_Menu' => dirname(__FILE__) . '//Controller/Plugin/Menu.php',
'Application_Controller_Plugin_Services' => dirname(__FILE__) . '//Controller/Plugin/Services.php',
'Application_Form_Login' => dirname(__FILE__) . '//Form/Login.php',
'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_InseeDepartements' => dirname(__FILE__) . '//Model/InseeDepartements.php',
'Application_Model_InseeIdentite' => dirname(__FILE__) . '//Model/InseeIdentite.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_JoEtablissements' => dirname(__FILE__) . '//Model/JoEtablissements.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_JoSurveillancesListes' => dirname(__FILE__) . '//Model/JoSurveillancesListes.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_JoZonageXY' => dirname(__FILE__) . '//Model/JoZonageXY.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_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_Sdv1OrderAssoStatut' => dirname(__FILE__) . '//Model/Sdv1OrderAssoStatut.php',
'Application_Model_Sdv1OrderBilanInput' => dirname(__FILE__) . '//Model/Sdv1OrderBilanInput.php',
'Application_Model_Sdv1OrderPrivileges' => dirname(__FILE__) . '//Model/Sdv1OrderPrivileges.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_Sdv1UtilisateursAuthLog' => dirname(__FILE__) . '//Model/Sdv1UtilisateursAuthLog.php',
'Application_Model_Sdv1UtilisateursBrowserLog' => dirname(__FILE__) . '//Model/Sdv1UtilisateursBrowserLog.php',
'Application_Model_Sdv1UtilisateursEmails' => dirname(__FILE__) . '//Model/Sdv1UtilisateursEmails.php',
'Application_Model_Sdv1UtilisateursService' => dirname(__FILE__) . '//Model/Sdv1UtilisateursService.php',
'Application_Model_VillesRnvpSources' => dirname(__FILE__) . '//Model/VillesRnvpSources.php',
);

View File

@ -1,15 +0,0 @@
<?php
// Generated by ZF's ./bin/classmap_generator.php
return array(
'Scores_Auth_Adapter_Db' => dirname(__FILE__) . '//Auth/Adapter/Db.php',
'Scores_Auth_Adapter_Ws' => dirname(__FILE__) . '//Auth/Adapter/Ws.php',
'Scores_Locale_String' => dirname(__FILE__) . '//Locale/String.php',
'Scores_Mail_Method' => dirname(__FILE__) . '//Mail/Method.php',
'Scores_Validate_IpInNetwork' => dirname(__FILE__) . '//Validate/IpInNetwork.php',
'Scores_Wkhtml_Pdf' => dirname(__FILE__) . '//Wkhtml/Pdf.php',
'Scores_Ws_Doc' => dirname(__FILE__) . '//Ws/Doc.php',
'Scores_Ws_Exception' => dirname(__FILE__) . '//Ws/Exception.php',
'Scores_Ws_Form_GetIdentite' => dirname(__FILE__) . '//Ws/Form/GetIdentite.php',
'Scores_Ws_Server' => dirname(__FILE__) . '//Ws/Server.php',
'Scores_Ws_Trigger' => dirname(__FILE__) . '//Ws/Trigger.php',
);

View File

@ -1,14 +0,0 @@
<?php
// Generated by ZF's ./bin/classmap_generator.php
return array(
'SdMetier_Graydon_Service' => dirname(__FILE__) . '//Graydon/Service.php',
'SdMetier_Infogreffe_DocAC' => dirname(__FILE__) . '//Infogreffe/DocAC.php',
'SdMetier_Infogreffe_DocBI' => dirname(__FILE__) . '//Infogreffe/DocBI.php',
'SdMetier_Infogreffe_DocST' => dirname(__FILE__) . '//Infogreffe/DocST.php',
'SdMetier_Infogreffe_Service' => dirname(__FILE__) . '//Infogreffe/Service.php',
'SdMetier_Intersud_Service' => dirname(__FILE__) . '//Intersud/Service.php',
'SdMetier_Rnvp_Detail' => dirname(__FILE__) . '//Rnvp/Detail.php',
'SdMetier_Search_Engine' => dirname(__FILE__) . '//Search/Engine.php',
'SdMetier_Sfr_Compile' => dirname(__FILE__) . '//Sfr/Compile.php',
'SdMetier_Sfr_Scoring' => dirname(__FILE__) . '//Sfr/Scoring.php',
);

View File

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

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

@ -20,11 +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__ . '/../../application/autoload_classmap.php',
__DIR__ . '/../../library/Scores/autoload_classmap.php',
__DIR__ . '/../../library/SdMetier/autoload_classmap.php',
__DIR__ . '/../../library/autoload_classmap.php',
),
'Zend_Loader_StandardAutoloader' => array(
'prefixes' => array(

View File

@ -18,11 +18,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__ . '/../../application/autoload_classmap.php',
__DIR__ . '/../../library/Scores/autoload_classmap.php',
__DIR__ . '/../../library/SdMetier/autoload_classmap.php',
__DIR__ . '/../../library/autoload_classmap.php',
),
'Zend_Loader_StandardAutoloader' => array(
'prefixes' => array(

View File

@ -18,11 +18,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__ . '/../../application/autoload_classmap.php',
__DIR__ . '/../../library/Scores/autoload_classmap.php',
__DIR__ . '/../../library/SdMetier/autoload_classmap.php',
__DIR__ . '/../../library/autoload_classmap.php',
),
'Zend_Loader_StandardAutoloader' => array(
'prefixes' => array(
@ -120,7 +116,7 @@ if ( isset($opts->comments) ) {
if (isset($opts->niveau)) {
$cycle = $opts->niveau;
}
if (generateComment($opts->comments, $type, $cycle) === true){
echo "Code généré. \n";
}
@ -404,16 +400,16 @@ function genereCacheRatios()
$iDb = new WDB();
$configFile = APPLICATION_PATH.'/../library/Metier/scores/classMRatios.php';
$fp=fopen($configFile, 'w');
fwrite($fp, '<?php'."\n");
fwrite($fp, "/** Auto generated class ".date('Y-m-d H:i:s')."*/" . "\n");
fwrite($fp, "class MRatios
{
public \$tva = 20.0;
public \$efftr = null;
/**
* Donne le taux d'inflation pour une année donnée
* @param unknown \$annee
@ -426,7 +422,7 @@ function genereCacheRatios()
return \$tabInfla[\$annee];
}
}
/**
* Donne le taux de rendement des actions pour une année donnée
* @param unknown \$annee
@ -439,7 +435,7 @@ function genereCacheRatios()
return \$tabTxRendObli[\$annee];
}
}
/**
* Définit la tranche d'effectif
* @param int \$value
@ -448,7 +444,7 @@ function genereCacheRatios()
{
\$this->efftr = \$value;
}
/**
* Calcul les ratios
* @param array \$bilans
@ -461,14 +457,14 @@ function genereCacheRatios()
{
\$numBil = 0;
foreach (\$bilans as \$k => \$p) {
\$millesime = \$p['CONSOLIDE'];
// --- Utilisation des bilans N ou S uniquement
if ( !in_array(substr(\$millesime, 0, 1), array('S', 'N')) ) {
continue;
}
// --- Calcul
" . "\n");

View File

@ -18,11 +18,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__ . '/../../application/autoload_classmap.php',
__DIR__ . '/../../library/Scores/autoload_classmap.php',
__DIR__ . '/../../library/SdMetier/autoload_classmap.php',
__DIR__ . '/../../library/autoload_classmap.php',
),
'Zend_Loader_StandardAutoloader' => array(
'prefixes' => array(

View File

@ -18,11 +18,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__ . '/../../application/autoload_classmap.php',
__DIR__ . '/../../library/Scores/autoload_classmap.php',
__DIR__ . '/../../library/SdMetier/autoload_classmap.php',
__DIR__ . '/../../library/autoload_classmap.php',
),
'Zend_Loader_StandardAutoloader' => array(
'prefixes' => array(

View File

@ -19,14 +19,10 @@ set_include_path(implode(PATH_SEPARATOR, array(
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__ . '/../../application/autoload_classmap.php',
__DIR__ . '/../../library/Scores/autoload_classmap.php',
__DIR__ . '/../../library/SdMetier/autoload_classmap.php',
__DIR__ . '/../../library/autoload_classmap.php',
),
'Zend_Loader_StandardAutoloader' => array(
'prefixes' => array(
@ -56,47 +52,47 @@ try {
$opts = new Zend_Console_Getopt(
//Options
array(
'help|?' => "Aide.",
'fichier=s' => "Nom du fichier complet : version ",
'affiche=s' => "Affiche resultat traitement "
));
$opts->parse();
}
catch (Zend_Console_Getopt_Exception $e)
{
echo $opts->getUsageMessage();
exit;
}
//Usage
if( count($opts->getOptions())==0 || isset($opts->help))
{
echo $opts->getUsageMessage();
exit;
}
#########################################################
##### Presence te taille du fichier #####
#########################################################
$fichier = $opts->fichier; // $fichier contient chemin/qqchose.csv
$nomfichier = basename($fichier); // $nomfichier contient qqchose.csv, basename retourne un array donc un tableau ayant comme valeur chacun des
// fichiers (chemain absolu) contenu dans le repertoir $directory, ici le repertoir contient normalement une seul fichier a la fois , donc $fichier[]
$fic = $fichier ; // On definti notre variable $fic comme etant notre fichier.
#########################################################
##### Teste de validité du nom du fichier #####
#########################################################
$detect1 = strstr($nomfichier, 'valo_commentaires_');
$detect2 = strstr($nomfichier, 'valo_formules_');
$detect3 = strstr($nomfichier, 'scores_formules_');
$detect4 = strstr($nomfichier, 'scores_commentaires_');
if ($detect1 !== false or $detect2 !== false or $detect3 !== false or $detect4 !== false)
{
echo "\n"." Nom du fichier ok"."\n" ;
@ -112,15 +108,15 @@ try {
echo "\n" . 'scores_formules_' . "\n";
echo "\n" ."ou"."\n";
echo "\n" . 'scores_commentaires_' . "\n";
Exit;
}
#########################################################
##### On indique si le fichier est present ou non #####
#########################################################
if ((file_exists($fichier)))
{
echo "\n Fichier $nomfichier au format csv trouve a l'emplacement prevu : \n";
@ -133,43 +129,43 @@ try {
$file = false;
exit;
}
#########################################################
##### taille du contenu du fichier #####
#########################################################
# déclaration variables :
$fileopen = fopen($fic, 'r');
$contenufichier = fgetcsv($fileopen);
$nblignes=0;
$cnbl = count($nblignes);
$fific = file($fic); // retourner le contenu du fichier dans une chaîne de caractères.
foreach ($fific as $line_num => $line)
{
$nblignes++;
}
echo "\n"." le fichier contient " . $nblignes . " lignes."."\n" ;
#########################################################
##### Routage vers commentaires ou formules #####
#########################################################
#variables :
$doublon = 0; // On initialise la variable doublon.
$row = 0 ; // On initialise les lignes.
$verif = array() ; // creation d'un tableau
$nom_fic = basename($fic) ;
$col3= 0;
$col3= 0;
#########################################################
##### Identification du type de fichier #####
#########################################################
//On commance rechercher si le nom du fichier contient "COMMENTAIRE" pour 4 colonnes sinon 2 colonnes
if (strstr($nom_fic, 'commentaires'))
{
@ -179,26 +175,26 @@ try {
{
$nbcol_cle = 2;
}
// Si $fic est bien ouvert on commence le traitement.
if ($file = true )
{
$fileopen2 = fopen($fic, "r+");
if($fileopen2)
{
$contenufichier=fgetcsv($fileopen2);
$nblignes = file($fic);
// Tant qu'il y a des lignes, lis les et fait en un tableau.
while (($data = fgetcsv($fileopen2,0,';','"')) !== FALSE)
{
$num = count($row); //compte nombre de partits dans la phrase
$row++;
// On fait une concatenation des colonnes de $fic dans un nouveau tableau nomme $cle.
// Cela nous permettera de dedoublonner par la suite.
if ($nbcol_cle == 4) // si nbcol = 4 alors notre clé sera composée de 4 colonnes sinon 3
{
$cle = $data[0].$data[1].$data[2].$data[3];
@ -207,11 +203,11 @@ try {
{
$cle = $data[0].$data[1].$data[2];
}
#########################################################
##### Dédoublonnage #####
#########################################################
// On regarde si on retrouve les valeurs de $verif dans $cle
if (in_array($cle, $verif, TRUE))
{
@ -236,13 +232,13 @@ try {
{
echo "\n"."Erreur ! Vous avez des champs vides commentaires , sur la ligne $num"."\n"."contenant $data[1].$data[2].$data[3].$data[4].$data[5].$data[6].$data[7]";
}
if ($data[0] == 0)
{
echo "\n"."erreur code commentaire ". $data[0] ." null"."\n";
exit;
}
if($data[2] < 0)
{
echo "\n"."erreur code ligne " . $data[2] . "null"."\n";
@ -250,26 +246,26 @@ try {
}
}
elseif (strstr ($nom_fic , 'formules'))
{
{
if (strlen($data[0]) == 0 or strlen($data[1]) == 0 )
{
echo "\n"." Erreur vous avez des champs vides formules , sur la ligne $row"."\n"."contenant $data[0].$data[1]. . ";
exit;
}
if ($data[0] == 0)
{
echo "\n"."erreur code commentaire " . $data[0] . " null"."\n";
exit;
}
if($data[1] < 0)
{
echo "\n"."erreur code code ligne". $data[1] ."null"."\n";
exit;
}
}
}
}
}
}
if ($doublon >= 1)
@ -278,7 +274,7 @@ try {
echo "\n"." $doublon Doublons détectés dans le fichier."."\n";
// Quitte avec un code d'erreur: doublon détecté.
exit(1);
}
elseif ($doublon == 0 && !file_exists($fic))
{
@ -287,26 +283,26 @@ try {
}
else
{
// le script appelant continue.
$ok = true; // petit marqueur de fonctionnement du script jusqu'a présent
$ok = true; // petit marqueur de fonctionnement du script jusqu'a présent
echo "\n Le fichier ne comporte pas de doublon. \n";
}
}
fclose($fileopen);
echo "\n Bon, maintenant on va passer a la base de donnee \n";
echo "\n Bon, maintenant on va passer a la base de donnee \n";
#########################################################
##### ________ ____ ____ #####
### | __ \ | \ | \ ###
# | / | |\ \ | |\ \ #
# | / | |\ \ | |\ \ #
### | __ \ | |/ / | |/ / ###
##### |_______/ |___/ |___/ #####
#########################################################
// si notre scripte est bon on passe a la suite
// si notre scripte est bon on passe a la suite
$c = new Zend_Config($application->getOptions());
try {
$db = Zend_Db::factory($c->profil->db->metier);
@ -315,25 +311,25 @@ try {
}
catch (Zend_Exception $e)
{
echo $e->getMessage();
echo $e->getMessage();
}
if ($db->isConnected())
{
echo "\n***********************************************\n";
echo "\n Connection a la BDD ok \n";
echo "\n***********************************************\n";
}
else
else
{
echo "\n***********************************************\n";
echo "\n !!!! Erreur / ! Pas connecte a la BDD !!!! \n";
echo "\n !!!! Erreur / ! Pas connecte a la BDD !!!! \n";
echo "\n***********************************************\n";
}
$pathCache = APPLICATION_PATH . '/../library/Metier/scores/Variables';
$copy_fic = $nomfichier;
if($nomfichier) // Si le nom du fichier comprend 'scores' ou 'valo'...
{
// On découpe la chaine de caractère à chaque "/" et on fait un array.
@ -341,24 +337,24 @@ else
// On prend ce qui se trouve avant le point
$token1 = strtok($token, ".");
// On effece '_utf8' et '.csv'
$nomtabletemp =(str_replace('_utf8', '', $token));
$nomtable =(str_replace('.csv','', $nomtabletemp));
// Affichage du nom de la table
echo "\n Le nom de la table est : $nomtable . \n";
}
####################################################
##### // Création de la Table Ccmmentaires \\ #####
####################################################
if (strstr($nomtable,"commentaires"))
{
{
try
{
{
// Création d'une table "TEXTE"
$sql_ctc_query = $db->query("CREATE TABLE $nomtable
(
@ -380,16 +376,16 @@ else
{
echo $e->getMessage()."\n";
echo "\n"."!!!!! ERREUR ! / CHARGEMENT ARRETE !!!!!"."\n"."\n";
}
}
echo "\n" . " Table $nomtable cree." ."\n";
}
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$fileopen2 = fopen($fic, "r+");
$nbr=0;
if($fileopen2)
{
$contenufichier=fgetcsv($fileopen2);
@ -398,22 +394,22 @@ else
$null = null;
$zero = 0;
}
else
else
{
exit;
echo "\n"."Erreur a l'ouverture du fichier"."\n";
echo "\n"."Erreur a l'ouverture du fichier"."\n";
}
if(strstr($nomtable,"commentaires"))
{
// Tant qu'il y a des lignes, lis les et fait en un tableau.
while (($data = fgetcsv($fileopen2,0,';','"')) !== FALSE)
{
####################################################
##### encodage et remplacement du contenu #####
####################################################
$data[4] = str_replace(chr(93), "]", $data[4]); // crochet fermant
$data[4] = str_replace(chr(92), "\\" , $data[4]); // anti slash
$data[4] = str_replace(chr(128), '€', $data[4]); // devise euros
@ -425,8 +421,8 @@ else
$data[4] = str_replace(chr(147), '"', $data[4]); // left double quote
$data[4] = str_replace(chr(148), '"', $data[4]); // right double quote
$data[4] = str_replace(chr(150), '', $data[4]); // tiret du 6
$data[5] = str_replace(chr(93), "]", $data[5]); // crochet fermant
$data[5] = str_replace(chr(92), "\\" , $data[5]); // anti slash
$data[5] = str_replace(chr(128), '€', $data[5]); // devise euros
@ -438,25 +434,25 @@ else
$data[5] = str_replace(chr(147), '"', $data[5]); // left double quote
$data[5] = str_replace(chr(148), '"', $data[5]); // right double quote
$data[5] = str_replace(chr(150), '', $data[5]); // tiret du 6
$encode = mb_detect_encoding($data[4]); // detection de l'encodage.
$encode = mb_detect_encoding($data[5]); // detection de l'encodage.
$data[4] = mb_convert_encoding($data[4], $encode, 'UTF-8');
$data[5] = mb_convert_encoding($data[5], $encode, 'UTF-8');
// $Zdata4 = '"'.$db->->real_escape_string($data[4]);
// $Zdata4 = $db->quote($data[4]);
//$Zdata4 = mysqli_real_escape_string($db, $data[4]);
if ($data[5] == null)
{
$data[5] = 0;
}
}
$zdata4= $db->quote($data[4]);
$nbr++;
// ESSAI 1
$sql_insert = array
(
@ -471,13 +467,13 @@ else
'dateInsert' => "$null",
'dateUpdate' => "$null"
);
try
try
{
# $num = count($row); // On compte nombre de parti dans la phrase
# $row++; // à chaques tour de boucle j'ajoute 1 à $row
// ESSAI 2
/*
$sql_itc = $db->query("INSERT INTO $nomtable
@ -488,37 +484,37 @@ else
".$data[0].",".$data[1].",".$data[2].",".$data[3].",".$Zdata4.",".$data[5].",'','','',)
");
*/
$db->insert($nomtable, $sql_insert);
$db->insert($nomtable, $sql_insert);
//`
// Astuce !! La structure de $data[0] étant un int on retire les "
// Astuce !! La colonne 5 contenant des apostrophs étant interprété par le sql comme un nouveau champ il est necessaire de protéger ce champs, du coup in ajoute la fonction mysql_real_escape_string() pour insérer un antislash devant les caractères " NULL, \x00, \n, \r, \, ', " et \x1a. "
}
// Renseignement sur les erreurs possibles
#echo ("$sql_itt");
catch(Zend_Exception $e)
{
echo "\n" . $e->getMessage()."\n";
//echo "\n"."!!!!!!!!!!!!!!!!!!!!! Import de la table $nomtable echouee. !!!!!!!!!!!!!!!!!!!!!"."\n"."\n";
//$sql_erase = $db->query("DROP TABLE $nomtable;");
//echo "La table $nomtable a ete effacee !! \n ";
}
}
}
echo "\n"."Import de la table $nomtable . ok". "\n";
// comptage sql
$comptage = count($sql_itc_query);
echo "\n"."Nombre de lignes importees : "."$nbr"."\n";
exit;
}
elseif(strstr($nomtable,"formules"))
{
####################################################
@ -542,7 +538,7 @@ else
PRIMARY KEY (code,ligne)
)
ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Criteres Valorisation - Formules de calculs' ;");
}
catch (Zend_Exception $e)
{
@ -551,16 +547,16 @@ else
}
echo "\n Table $nomtable cree.\n";
// Tant qu'il y a des lignes, lis les et fait en un tableau.
while (($data = fgetcsv($fileopen2,0,';','"')) !== FALSE)
{
####################################################
##### encodage et remplacement du contenu #####
####################################################
$data[2] = str_replace(chr(93), "]", $data[2]); // crochet fermant
$data[2] = str_replace(chr(92), "\\" , $data[2]); // anti slash
$data[2] = str_replace(chr(128), '€', $data[2]); // devise euros
@ -572,8 +568,8 @@ else
$data[2] = str_replace(chr(147), '"', $data[2]); // left double quote
$data[2] = str_replace(chr(148), '"', $data[2]); // right double quote
$data[2] = str_replace(chr(150), '', $data[2]); // tiret du 6
$data[4] = str_replace(chr(93), "]", $data[4]); // crochet fermant
$data[4] = str_replace(chr(92), "\\" , $data[4]); // anti slash
$data[4] = str_replace(chr(128), '€', $data[4]); // devise euros
@ -585,8 +581,8 @@ else
$data[4] = str_replace(chr(147), '"', $data[4]); // left double quote
$data[4] = str_replace(chr(148), '"', $data[4]); // right double quote
$data[4] = str_replace(chr(150), '', $data[4]); // tiret du 6
$data[5] = str_replace(chr(93), "]", $data[5]); // crochet fermant
$data[5] = str_replace(chr(92), "\\" , $data[5]); // anti slash
$data[5] = str_replace(chr(128), '€', $data[5]); // devise euros
@ -598,7 +594,7 @@ else
$data[5] = str_replace(chr(147), '"', $data[5]); // left double quote
$data[5] = str_replace(chr(148), '"', $data[5]); // right double quote
$data[5] = str_replace(chr(150), '', $data[5]); // tiret du 6
$data[6] = str_replace(chr(93), "]", $data[6]); // crochet fermant
$data[6] = str_replace(chr(92), "\\" , $data[6]); // anti slash
$data[6] = str_replace(chr(128), '€', $data[6]); // devise euros
@ -610,19 +606,19 @@ else
$data[6] = str_replace(chr(147), '"', $data[6]); // left double quote
$data[6] = str_replace(chr(148), '"', $data[6]); // right double quote
$data[6] = str_replace(chr(150), '', $data[6]); // tiret du 6
$encode = mb_detect_encoding($data[2]); // detection de l'encodage.
$encode = mb_detect_encoding($data[5]); // detection de l'encodage.
$encode = mb_detect_encoding($data[4]); // detection de l'encodage.
$encode = mb_detect_encoding($data[6]); // detection de l'encodage.
$data[2] = mb_convert_encoding($data[2], $encode, 'UTF-8');
$data[4] = mb_convert_encoding($data[4], $encode, 'UTF-8');
$data[5] = mb_convert_encoding($data[5], $encode, 'UTF-8');
$data[6] = mb_convert_encoding($data[6], $encode, 'UTF-8');
$sql_insert = array(
$sql_insert = array(
'code' => "$data[0]",
'ligne' => "$data[1]",
'remarque' => "$data[2]",
@ -632,12 +628,12 @@ $sql_insert = array(
'valeur' => "$data[6]",
'tri' => "$null",
'deleted' => "$null",
'idUser' => "$null",
'dateInsert' => "$null",
'idUser' => "$null",
'dateInsert' => "$null",
'dateUpdate' => "$null"
);
$nbr++;
try{
try{
$db->insert($nomtable, $sql_insert);
}
catch (Zend_Exception $e)
@ -646,27 +642,27 @@ $sql_insert = array(
echo "\n"."!!!!! ERREUR ! / CHARGEMENT ARRETE !!!!!"."\n"."\n";
}
}
echo "\n"." Import de la table $nomtable ok."."\n";
// comptage sql
$comptage = count($sql_insert);
echo "\n"." Nombre de lignes importees : "."$nbr"."\n";
fclose($fileopen2);
exit;
}
// Exécution de la requête
//$result = $db->query($sql_ctt);
// Renseignement sur les erreurs possibles
// echo "<strong>" . $Erreur . "</strong> <br /> <br />\n";
//
//
// if ($sql_ctt_query) // si code retour OK
// {
// echo "Création de la table $nomtable ok.<br />";

View File

@ -17,10 +17,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

@ -18,10 +18,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

@ -18,10 +18,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

@ -18,10 +18,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(
@ -426,7 +423,7 @@ foreach ( $tabCommandes as $ref => $commande ) {
$sql->where('type_comptes="consolides"');
}
$item = $bilanM->fetchRow($sql);
// --- Enregistrement
if ( $isFileOnStorage && $item->pdfDate == '0000-00-00' ) {
$infos = $infogreffe->pdfInfos($fileOut);

View File

@ -18,10 +18,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

@ -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(

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(

View File

@ -18,10 +18,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(