Ajout configuration + modif clé bdd

This commit is contained in:
Michael RICOIS 2013-08-28 10:23:01 +00:00
parent fc25a8c591
commit 78b20d7b86
4 changed files with 52 additions and 67 deletions

View File

@ -1,7 +1,7 @@
<?php
/**
* SD => Client
* Attention le script doit s'executer avec l'utilisateur root, afin de lire le fichier même
* Attention le script doit s'executer avec l'utilisateur root, afin de lire le fichier même
* s'il n'a pas les droits
*/
@ -58,10 +58,10 @@ $sql = $fluxM->select()->where('dateEnd!=?','0000-00-00 00:00:00');
//Get specific file
if ( isset($opts->file) && isset($opts->client) ) {
$sql->where('client=?', $opts->client)
->where('fileOut=?', $opts->file);
->where('fileOut=?', $opts->file);
} else {
$sql->where('dateEnd!=?', '0000-00-00 00:00:00');
$sql->where('dateDepot=?', '0000-00-00 00:00:00');
$sql->where('depotDate=?', '0000-00-00 00:00:00');
}
$result = $fluxM->fetchAll($sql);
@ -73,27 +73,27 @@ if ( $result->count() > 0 ) {
DIRECTORY_SEPARATOR . $item->client .
DIRECTORY_SEPARATOR . 'recv' .
DIRECTORY_SEPARATOR . $item->fileOut;
switch ($item->typeDepot) {
case 'FTP':
$dest = $c->profil->path->ftp .
$dest = $c->profil->path->ftp .
DIRECTORY_SEPARATOR . $item->client .
DIRECTORY_SEPARATOR . 'recv' .
DIRECTORY_SEPARATOR . $item->fileOut;
break;
case 'SFTP':
$dest = $c->profil->path->sftp .
$dest = $c->profil->path->sftp .
DIRECTORY_SEPARATOR . $item->client .
DIRECTORY_SEPARATOR . 'recv' .
DIRECTORY_SEPARATOR . $item->fileOut;
break;
break;
}
if ( copy($source, $dest) ) {
$fluxM->update(array(
'dateDepot' => date('YmdHis'),
), 'id='.$item->id);
'depotDate' => date('YmdHis'),
), 'id='.$item->id);
}
}
}
}

View File

@ -63,7 +63,7 @@ if ( isset($opts->file) )
$client = basename(dirname($pathParts['dirname']));
$dateFile = date('YmdHis', filectime($opts->file));
$startpos = strlen("/home/data/");
$startpos = strlen( $c->profil->path->data . DIRECTORY_SEPARATOR );
if ( 'sftp' == substr($opts->file,$startpos,4) ) {
$type = 'SFTP';
} elseif ( 'ftp' == substr($opts->file,$startpos,3) ) {
@ -132,9 +132,9 @@ if ( isset($opts->file) )
$fluxM->insert(array(
'client' => $client,
'name' => $prestation,
'typeDepot' => $type,
'dateDepot' => $dateFile,
'fileDepot' => $filename,
'depotType' => $type,
'depotDate' => $dateFile,
'depotFile' => $filename,
'nbLines' => $nbLines,
'dateInsert' => date('YmdHis'),
'dateExecute' => '0000-00-00 00:00:00',

View File

@ -0,0 +1,37 @@
[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/storage"
; Database configuration
profil.db.metier.adapter=mysqli
profil.db.metier.params.host=192.168.3.30
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"
[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

View File

@ -1,52 +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.session.save_path = APPLICATION_PATH "/../data/sessions"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.plugins.Auth = "Application_Controller_Plugin_Auth"
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.server.name = development
profil.mail.method = smtp
profil.mail.smtp_host = smtp.free.fr
profil.mail.email.support = supportdev@scores-decisions.com
profil.mail.email.supportdev = supportdev@scores-decisions.com
profil.mail.email.contact = supportdev@scores-decisions.com
profil.mail.email.production = supportdev@scores-decisions.com
profil.path.batch = APPLICATION_PATH "/../scripts/jobs"
profil.path.cache = APPLICATION_PATH "/../data/cache"
profil.path.files = APPLICATION_PATH "/../data/files"
profil.path.log = APPLICATION_PATH "/../data/log"
profil.path.data = "c:\Users\mricois\www\data\ws"
profil.path.secure = "c:\Users\mricois\www\data\ws"
; Database configuration - For old configuration - see Configure.php
profil.db.metier.adapter=mysqli
profil.db.metier.params.host=192.168.78.230
profil.db.metier.params.username=wsuser
profil.db.metier.params.password=scores
profil.db.metier.params.dbname=sdv1
profil.db.metier.params.driver_options.MYSQLI_INIT_COMMAND = "SET NAMES utf8"
[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