Renommage des fichiers
This commit is contained in:
parent
e0987c8e85
commit
99859bb39b
@ -73,7 +73,7 @@ if ( isset($opts->file) )
|
||||
$fluxRepository = str_replace(array($fluxBasePath.'/', '/'.$filenameIn), array('', ''), $opts->file);
|
||||
|
||||
// --- Match prestation
|
||||
$prestations = include __DIR__ . '/fileConfig.php';
|
||||
$prestations = include __DIR__ . '/config.php';
|
||||
$prestation = null;
|
||||
if (array_key_exists($client, $prestations))
|
||||
{
|
@ -98,7 +98,7 @@ if ( $result->count() > 0 ) {
|
||||
$optionsLog = false;
|
||||
|
||||
// Match prestation
|
||||
$prestations = include __DIR__ . '/fileConfig.php';
|
||||
$prestations = include __DIR__ . '/config.php';
|
||||
$prestation = null;
|
||||
if (array_key_exists($item->client, $prestations))
|
||||
{
|
@ -1,58 +0,0 @@
|
||||
<?php
|
||||
// --- Define path to application directory
|
||||
defined('APPLICATION_PATH')
|
||||
|| define('APPLICATION_PATH', realpath(__DIR__ . '/../../application'));
|
||||
|
||||
// --- Define application environment
|
||||
defined('APPLICATION_ENV')
|
||||
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
|
||||
|
||||
// --- Composer autoload
|
||||
require_once realpath(__DIR__ . '/../../vendor/autoload.php');
|
||||
|
||||
try {
|
||||
$opts = new Zend_Console_Getopt(
|
||||
//Options
|
||||
array(
|
||||
'help|?' => "Display usage information.",
|
||||
'install=s' => "Make install operation.",
|
||||
)
|
||||
);
|
||||
$opts->parse();
|
||||
} catch (Zend_Console_Getopt_Exception $e) {
|
||||
echo $e->getUsageMessage();
|
||||
exit;
|
||||
}
|
||||
|
||||
//Usage
|
||||
if (isset($opts->help))
|
||||
{
|
||||
echo $opts->getUsageMessage();
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
if ( ! empty($opts->install) )
|
||||
{
|
||||
echo date('Y-m-d H:i:s')." - Démarrage de la configuration.\n";
|
||||
|
||||
//Copy configuration
|
||||
$configDir = realpath(dirname(__FILE__)).'/profil';
|
||||
$appconfigDir = APPLICATION_PATH.'/configs';
|
||||
$profil = $opts->install;
|
||||
|
||||
if ( !file_exists( $appconfigDir.'/application.ini') ) {
|
||||
$result = copy($configDir.'/'.$profil.'/application.ini', $appconfigDir.'/application.ini');
|
||||
if ($result !== true) {
|
||||
echo date('Y-m-d H:i:s')." - Impossible de copier la configuration.\n";
|
||||
exit(1);
|
||||
}
|
||||
} else {
|
||||
echo date('Y-m-d H:i:s')." - Le profil de configuration existe déja.\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
echo date('Y-m-d H:i:s')." - Fin de la configuration.\n";
|
||||
} else {
|
||||
echo date('Y-m-d H:i:s')." - Je n'ai rien fait !\n";
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
|
||||
# Gestion des flux a envoyer au client
|
||||
*/15 4-18 * * * root php /home/flux/fileRecv.php --cron >> /home/log/recv.log 2>&1
|
||||
*/15 4-18 * * * root php /home/flux/current/recv.php --cron >> /home/log/recv.log 2>&1
|
||||
|
||||
# Nettoyage
|
||||
01 18 * * * root php /home/flux/fileClean.php --cron >> /home/log/clean.log 2>&1
|
||||
01 18 * * * root php /home/flux/current/clean.php --cron >> /home/log/clean.log 2>&1
|
@ -38,7 +38,7 @@ if(isset($opts->help))
|
||||
exit;
|
||||
}
|
||||
|
||||
$prestations = include APPLICATION_PATH . '/../fileConfig.php';
|
||||
$prestations = include APPLICATION_PATH . '/../config.php';
|
||||
|
||||
if ($opts->list)
|
||||
{
|
||||
@ -83,7 +83,7 @@ if ($opts->generate)
|
||||
}
|
||||
$fluxBasePath = '/home/data/' . strtolower($item['type']) . '/' . $client . '/' . $directory;
|
||||
$file = __DIR__ . '/incron.d/' . strtolower($item['type']) . '_' . $client;
|
||||
file_put_contents($file, "$fluxBasePath IN_CLOSE_WRITE php /home/batchFlux/fileSend.php --file $@/$# >> /home/log/send.log 2>&1");
|
||||
file_put_contents($file, "$fluxBasePath IN_CLOSE_WRITE php /home/flux/current/send.php --file $@/$# >> /home/log/send.log 2>&1");
|
||||
echo "File created $file\n";
|
||||
}
|
||||
}
|
||||
@ -109,7 +109,7 @@ if ($opts->generate)
|
||||
}
|
||||
$fluxBasePath = '/home/data/' . strtolower($item['type']) . '/' . $client. '/' . $directory;
|
||||
$file = __DIR__ . '/incron.d/' . strtolower($item['type']) . '_' . $client . '_recv';
|
||||
file_put_contents($file, "$fluxBasePath IN_ACCESS php /home/batchFlux/fileRead.php --file $@/$# >> /home/log/read.log 2>&1");
|
||||
file_put_contents($file, "$fluxBasePath IN_ACCESS php /home/flux/current/read.php --file $@/$# >> /home/log/read.log 2>&1");
|
||||
echo "File created $file\n";
|
||||
}
|
||||
}
|
||||
|
@ -1,43 +0,0 @@
|
||||
[production]
|
||||
phpSettings.date.timezone = "Europe/Paris"
|
||||
phpSettings.display_startup_errors = 0
|
||||
phpSettings.display_errors = 0
|
||||
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
|
||||
bootstrap.class = "Bootstrap"
|
||||
appnamespace = "Application"
|
||||
resources.frontController.params.displayExceptions = 0
|
||||
resources.layout.layout = "main"
|
||||
resources.layout.layoutPath = APPLICATION_PATH "/views"
|
||||
resources.view.basePath = APPLICATION_PATH "/views"
|
||||
autoloaderNamespaces[] = "Application_"
|
||||
autoloaderNamespaces[] = "Scores_"
|
||||
autoloaderNamespaces[] = "Metier_"
|
||||
|
||||
; Scores configuration
|
||||
profil.path.data = "/home/data"
|
||||
profil.path.storage = "/home/data/clients"
|
||||
profil.path.ftp = "/home/data/ftp"
|
||||
profil.path.sftp = "/home/data/sftp"
|
||||
|
||||
; Database configuration
|
||||
profil.db.metier.adapter=mysqli
|
||||
profil.db.metier.params.host=192.168.3.28
|
||||
profil.db.metier.params.username=batchuser
|
||||
profil.db.metier.params.password=2XQTpKatBVRezXE9
|
||||
profil.db.metier.params.dbname=sdv1
|
||||
profil.db.metier.params.driver_options.MYSQLI_INIT_COMMAND = "SET NAMES utf8"
|
||||
|
||||
; Mail configuration
|
||||
profil.db.method = sendmail
|
||||
|
||||
[staging : production]
|
||||
resources.frontController.params.displayExceptions = 1
|
||||
|
||||
[development : production]
|
||||
phpSettings.display_startup_errors = 1
|
||||
phpSettings.display_errors = 1
|
||||
resources.frontController.params.displayExceptions = 1
|
||||
|
||||
[testing : production]
|
||||
phpSettings.display_startup_errors = 1
|
||||
phpSettings.display_errors = 1
|
@ -64,7 +64,7 @@ if ( isset($opts->file) )
|
||||
}
|
||||
// --- Don't play with *.tck files
|
||||
if ($extension == 'tck') {
|
||||
passthru(__DIR__ . '/fileTck.php --file '.$opts->file.' >> /home/log/tck.log 2>&1');
|
||||
passthru(__DIR__ . '/tck.php --file '.$opts->file.' >> /home/log/tck.log 2>&1');
|
||||
exit;
|
||||
}
|
||||
$client = basename(dirname($pathParts['dirname']));
|
||||
@ -82,7 +82,7 @@ if ( isset($opts->file) )
|
||||
$fluxRepository = str_replace(array($fluxBasePath.'/', '/'.$filenameIn), array('', ''), $opts->file);
|
||||
|
||||
// --- Match prestation
|
||||
$prestations = include __DIR__ . '/fileConfig.php';
|
||||
$prestations = include __DIR__ . '/config.php';
|
||||
$prestation = null;
|
||||
if (array_key_exists($client, $prestations)) {
|
||||
$clientPrestations = $prestations[$client]['prestations'];
|
@ -81,7 +81,7 @@ if ( isset($opts->file) )
|
||||
$fluxRepository = str_replace(array($fluxBasePath.'/', '/'.$filenameIn), array('', ''), $opts->file);
|
||||
|
||||
// --- Match prestation
|
||||
$prestations = include __DIR__ . '/fileConfig.php';
|
||||
$prestations = include __DIR__ . '/config.php';
|
||||
$prestation = null;
|
||||
if (array_key_exists($client, $prestations))
|
||||
{
|
@ -47,16 +47,16 @@ switch($opts->event)
|
||||
{
|
||||
case 'IN_CLOSE_WRITE':
|
||||
if ($extension == 'tck') {
|
||||
passthru(__DIR__ . '/fileTck.php --file '.$opts->file.' >> /home/log/tck.log 2>&1');
|
||||
passthru(__DIR__ . '/tck.php --file '.$opts->file.' >> /home/log/tck.log 2>&1');
|
||||
} else {
|
||||
passthru(__DIR__ . '/fileSend.php --file '.$opts->file.' >> /home/log/send.log 2>&1');
|
||||
passthru(__DIR__ . '/send.php --file '.$opts->file.' >> /home/log/send.log 2>&1');
|
||||
}
|
||||
break;
|
||||
case 'IN_ACCESS':
|
||||
case 'IN_CLOSE_NOWRITE':
|
||||
passthru(__DIR__ . '/fileRead.php --file '.$opts->file.' >> /home/log/read.log 2>&1');
|
||||
passthru(__DIR__ . '/read.php --file '.$opts->file.' >> /home/log/read.log 2>&1');
|
||||
break;
|
||||
case 'IN_DELETE':
|
||||
passthru(__DIR__ . '/fileRead.php --file '.$opts->file.' >> /home/log/read.log 2>&1');
|
||||
passthru(__DIR__ . '/read.php --file '.$opts->file.' >> /home/log/read.log 2>&1');
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user