Mise à jour de la configuration
This commit is contained in:
parent
2d1c282af5
commit
da3836d96e
4
README
4
README
@ -114,8 +114,8 @@ Send 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
|
||||
- Log - Log transfert disable by default
|
||||
|
||||
Recv Options list
|
||||
-----------------
|
||||
- NoLog - Don't log read
|
||||
- Log - Log read disable by default
|
@ -45,7 +45,6 @@ return array(
|
||||
'type' => 'FTP',
|
||||
'in' => array(
|
||||
'CopyDeleteAfter' => true,
|
||||
'NoLog' => true,
|
||||
),
|
||||
'out' => array(),
|
||||
),
|
||||
|
20
fileRecv.php
20
fileRecv.php
@ -104,8 +104,8 @@ if ( $result->count() > 0 ) {
|
||||
$optionsCopyAddDate = false;
|
||||
$optionsCopyDeleteAfter = false;
|
||||
$optionsRunWithEndFile = false;
|
||||
$optionsNoLog = false;
|
||||
|
||||
$optionsLog = false;
|
||||
|
||||
// Match prestation
|
||||
$prestations = include __DIR__ . '/fileConfig.php';
|
||||
$prestation = null;
|
||||
@ -119,11 +119,11 @@ if ( $result->count() > 0 ) {
|
||||
{
|
||||
$repositoryDir = $p['directory'];
|
||||
}
|
||||
|
||||
|
||||
if ($item->depotType == $p['type'] && $fluxRepository == $repositoryDir)
|
||||
{
|
||||
$prestation = $p['name'];
|
||||
|
||||
|
||||
// Set option
|
||||
if (array_key_exists('out', $p) && count($p['out']) > 0)
|
||||
{
|
||||
@ -132,15 +132,15 @@ if ( $result->count() > 0 ) {
|
||||
${'options'.$option} = $value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// --- Copy du fichier
|
||||
if ( copy($source, $dest) ) {
|
||||
|
||||
|
||||
// --- Detail du fichier
|
||||
$nbLines = 0;
|
||||
if ( strtolower(substr(basename($source), -3)) == 'csv' ) {
|
||||
@ -157,7 +157,7 @@ if ( $result->count() > 0 ) {
|
||||
elseif($item->depotType == 'SFTP') {
|
||||
chown($dest, $item->client);
|
||||
}
|
||||
|
||||
|
||||
// --- Mise à jour information de remise
|
||||
$fluxM->update(array(
|
||||
'depotFileSize' => $size,
|
||||
@ -165,14 +165,14 @@ if ( $result->count() > 0 ) {
|
||||
), 'id='.$item->id);
|
||||
|
||||
// --- Envoi email
|
||||
if ($optionsNoLog === false) {
|
||||
if ($optionsLog === true) {
|
||||
$subject = "[Flux] - Envoi d'un fichier " . $item->client;
|
||||
$txt = "Envoi d'un fichier après traitement\n";
|
||||
$txt.= "Client : ".$item->client."\n";
|
||||
$txt.= "Mode de transmission : ".$item->depotType."\n";
|
||||
$txt.= "Fichier : ".$item->fileOut."\n";
|
||||
$txt.= "Nombre de Lignes : $nbLines\n";
|
||||
|
||||
|
||||
$mail = new Zend_Mail('UTF-8');
|
||||
$tr = new Zend_Mail_Transport_Sendmail();
|
||||
$mail->setDefaultTransport($tr);
|
||||
|
@ -57,7 +57,7 @@ if ( isset($opts->file) )
|
||||
$optionsCopyAddDate = false;
|
||||
$optionsCopyDeleteAfter = false;
|
||||
$optionsRunWithEndFile = false;
|
||||
$optionsNoLog = false;
|
||||
$optionsLog = false;
|
||||
$repositoryDir = 'send';
|
||||
|
||||
$c = new Zend_Config($application->getOptions());
|
||||
@ -238,7 +238,7 @@ if ( isset($opts->file) )
|
||||
echo date('Y-m-d H:i:s')." - Copie du fichier $filenameIn dans $destDir\n";
|
||||
|
||||
// --- Execute
|
||||
if ($optionsNoLog === false)
|
||||
if ($optionsLog === true)
|
||||
{
|
||||
$db = Zend_Db::factory($c->profil->db->metier);
|
||||
Zend_Db_Table::setDefaultAdapter($db);
|
||||
|
@ -1,3 +1,5 @@
|
||||
|
||||
# Gestion des flux a envoyer au client
|
||||
*/20 4-18 * * * root php /home/batchFlux/fileRecv.php --cron >> /home/log/recv.log 2>&1
|
||||
*/15 4-18 * * * root php /home/batchFlux/fileRecv.php --cron >> /home/log/recv.log 2>&1
|
||||
|
||||
# Nettoyage
|
||||
|
Loading…
Reference in New Issue
Block a user