Add options NoLog to get file without save it in database
This commit is contained in:
parent
19b6bf6fd9
commit
6a4e805282
1
README
1
README
@ -24,3 +24,4 @@ Options list
|
||||
- CopyAddDate - Copy file and add a timestamp to the end of the filename
|
||||
- CopyDeleteAfter - After copying the file delete it in repository
|
||||
- RunWithEndFile - Only execute action when we receive file with extension .fin or .end
|
||||
- NoLOg - Don't log transfert
|
@ -33,4 +33,16 @@ return array(
|
||||
),
|
||||
),
|
||||
),
|
||||
'bilansext' => array(
|
||||
'prestations' => array(
|
||||
array(
|
||||
'name' => 'EXTRANET',
|
||||
'type' => 'FTP',
|
||||
'options' => array(
|
||||
'CopyDeleteAfter' => true,
|
||||
'NoLog' => true,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
41
fileSend.php
41
fileSend.php
@ -57,6 +57,7 @@ if ( isset($opts->file) )
|
||||
$optionsCopyAddDate = false;
|
||||
$optionsCopyDeleteAfter = false;
|
||||
$optionsRunWithEndFile = false;
|
||||
$optionsNoLog = false;
|
||||
$repositoryDir = 'send';
|
||||
|
||||
$c = new Zend_Config($application->getOptions());
|
||||
@ -231,25 +232,27 @@ if ( isset($opts->file) )
|
||||
echo date('Y-m-d H:i:s')." - Copie du fichier $filenameIn dans $destDir\n";
|
||||
|
||||
//Execute
|
||||
$db = Zend_Db::factory($c->profil->db->metier);
|
||||
Zend_Db_Table::setDefaultAdapter($db);
|
||||
try {
|
||||
$fluxM = new Application_Model_Sdv1FluxFileIn();
|
||||
$fluxM->insert(array(
|
||||
'client' => $client,
|
||||
'name' => $prestation,
|
||||
'depotType' => $type,
|
||||
'depotDate' => $dateFile,
|
||||
'depotFile' => $filenameOut,
|
||||
'nbLines' => $nbLines,
|
||||
'dateInsert' => date('YmdHis'),
|
||||
'dateExecute' => '0000-00-00 00:00:00',
|
||||
));
|
||||
echo date('Y-m-d H:i:s')." - Enregistrement client:$client fichier:$filenameOut\n";
|
||||
}
|
||||
catch (Zend_Db_Exception $e)
|
||||
{
|
||||
echo date('Y-m-d H:i:s')." - ERREUR Enregistrement client:$client fichier:$filenameOut\n";
|
||||
if ($optionsNoLog === false) {
|
||||
$db = Zend_Db::factory($c->profil->db->metier);
|
||||
Zend_Db_Table::setDefaultAdapter($db);
|
||||
try {
|
||||
$fluxM = new Application_Model_Sdv1FluxFileIn();
|
||||
$fluxM->insert(array(
|
||||
'client' => $client,
|
||||
'name' => $prestation,
|
||||
'depotType' => $type,
|
||||
'depotDate' => $dateFile,
|
||||
'depotFile' => $filenameOut,
|
||||
'nbLines' => $nbLines,
|
||||
'dateInsert' => date('YmdHis'),
|
||||
'dateExecute' => '0000-00-00 00:00:00',
|
||||
));
|
||||
echo date('Y-m-d H:i:s')." - Enregistrement client:$client fichier:$filenameOut\n";
|
||||
}
|
||||
catch (Zend_Db_Exception $e)
|
||||
{
|
||||
echo date('Y-m-d H:i:s')." - ERREUR Enregistrement client:$client fichier:$filenameOut\n";
|
||||
}
|
||||
}
|
||||
|
||||
//Suppression des fichiers
|
||||
|
@ -1 +0,0 @@
|
||||
/home/data/sftp/gefacto/send IN_CLOSE_WRITE php /home/batchFlux/fileSend.php --debug --file $@/$#
|
@ -1 +0,0 @@
|
||||
/home/data/sftp/sfrbtr/send IN_CLOSE_WRITE php /home/batchFlux/fileSend.php --debug --file $@/$#
|
Loading…
Reference in New Issue
Block a user