PHP-CS-Fixer
This commit is contained in:
parent
d9c224ef30
commit
ce9b83194a
@ -22,13 +22,13 @@ $application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/config
|
||||
// --- Options
|
||||
$displayUsage = false;
|
||||
try {
|
||||
$opts = new Zend_Console_Getopt(array(
|
||||
'help|?' => "Displays usage information.",
|
||||
$opts = new Zend_Console_Getopt(array(
|
||||
'help|?' => "Displays usage information.",
|
||||
'in' => "",
|
||||
'seq=s' => "Spécifier le numéro de séquence pour traitement",
|
||||
'cron' => "Mandatory option for launch the cli in cron",
|
||||
'cron' => "Mandatory option for launch the cli in cron",
|
||||
));
|
||||
$opts->parse();
|
||||
$opts->parse();
|
||||
} catch (Zend_Console_Getopt_Exception $e) {
|
||||
$displayUsage = true;
|
||||
}
|
||||
@ -46,8 +46,7 @@ if ($displayUsage) {
|
||||
}
|
||||
|
||||
//Chargement des éléments à surveiller
|
||||
if ( $opts->in ) {
|
||||
|
||||
if ($opts->in) {
|
||||
$c = new Zend_Config($application->getOptions());
|
||||
$db = Zend_Db::factory($c->profil->db->metier);
|
||||
Zend_Db_Table_Abstract::setDefaultAdapter($db);
|
||||
@ -77,14 +76,13 @@ if ( $opts->in ) {
|
||||
$seq = null;
|
||||
|
||||
// => Automatic mode
|
||||
if ( $opts->cron ) {
|
||||
if ($opts->cron) {
|
||||
|
||||
// Guess the last Seq Number
|
||||
try {
|
||||
$stmt = $conn->executeQuery('SELECT NumSeq, dateInsert FROM jo.sfr_data ORDER BY id DESC LIMIT 0,1');
|
||||
$result = $stmt->fetch(\PDO::FETCH_OBJ);
|
||||
}
|
||||
catch(\Doctrine\DBAL\DBALException $e) {
|
||||
} catch (\Doctrine\DBAL\DBALException $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
$seq = $result->NumSeq;
|
||||
@ -99,11 +97,11 @@ if ( $opts->in ) {
|
||||
}
|
||||
}
|
||||
|
||||
if ( is_string($opts->seq) ) {
|
||||
$seq = $opts->seq;
|
||||
if (is_string($opts->seq)) {
|
||||
$seq = $opts->seq;
|
||||
}
|
||||
|
||||
if ( $seq===null ) {
|
||||
if ($seq===null) {
|
||||
echo date('Y-m-d H:i:s')." - Aucune numéro de séquence.\n";
|
||||
exit;
|
||||
}
|
||||
@ -121,8 +119,7 @@ if ( $opts->in ) {
|
||||
)";
|
||||
try {
|
||||
$conn->executeQuery($sql);
|
||||
}
|
||||
catch (\Doctrine\DBAL\DBALException $e) {
|
||||
} catch (\Doctrine\DBAL\DBALException $e) {
|
||||
echo date('Y-m-d H:i:s')." - Erreur ajout des SIREN.\n";
|
||||
}
|
||||
|
||||
@ -135,8 +132,7 @@ if ( $opts->in ) {
|
||||
$stmt = $conn->executeQuery($sql);
|
||||
$nbRowsAffected = $stmt->rowCount();
|
||||
echo date('Y-m-d H:i:s')." - $nbRowsAffected lignes supprimés.\n";
|
||||
}
|
||||
catch (\Doctrine\DBAL\DBALException $e) {
|
||||
} catch (\Doctrine\DBAL\DBALException $e) {
|
||||
echo date('Y-m-d H:i:s')." - Erreur suppression des SIREN.\n";
|
||||
}
|
||||
|
||||
@ -155,8 +151,7 @@ if ( $opts->in ) {
|
||||
$stmt = $conn->executeQuery($sql);
|
||||
$nbRowsAffected = $stmt->rowCount();
|
||||
echo date('Y-m-d H:i:s')." - $nbRowsAffected lignes confirmées." . PHP_EOL;
|
||||
}
|
||||
catch (\Doctrine\DBAL\DBALException $e) {
|
||||
} catch (\Doctrine\DBAL\DBALException $e) {
|
||||
echo date('Y-m-d H:i:s')." - Erreur confirmation des SIREN." . PHP_EOL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user