Subversion Repositories eFlore/Applications.cel

Rev

Rev 1518 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1518 Rev 1520
Line 24... Line 24...
24
	protected $observations;
24
	protected $observations;
25
	// Paramêtres autorisées lors de l'appel au script en ligne de commande
25
	// Paramêtres autorisées lors de l'appel au script en ligne de commande
26
	protected $parametres_autorises = array(
26
	protected $parametres_autorises = array(
27
		'-n' => array(true, true, 'Nom du fichier ou du dossier à traiter'));
27
		'-n' => array(true, true, 'Nom du fichier ou du dossier à traiter'));
Line 28... Line -...
28
 
-
 
29
 
-
 
30
 
28
 
31
// +-------------------------------------------------------------------------------------------------------------------+
29
// +-------------------------------------------------------------------------------------------------------------------+
32
	public function executer() {
30
	public function executer() {
33
		include_once dirname(__FILE__).'/bibliotheque/Dao.php';
-
 
34
 
31
		include_once dirname(__FILE__).'/bibliotheque/Dao.php';
35
		
32
	
36
		$this->dao = new Dao();
33
		$this->dao = new Dao();
37
		// Récupération de paramétres
34
		// Récupération de paramétres
38
		// Lancement de l'action demandée
35
		// Lancement de l'action demandée
39
		$cmd = $this->getParametre('a');
36
		$cmd = $this->getParametre('a');
40
		switch ($cmd) {
37
		switch ($cmd) {
41
			case 'tout' :
38
			case 'tout' :
42
				// à effectuer manuellement au premier lancement du script
39
				// à effectuer manuellement au premier lancement du script
43
				$this->creerColonne();
40
				$this->creerColonne();
44
				$this->calculerCodeInsee();
41
				$this->calculerCodeInsee();
45
				//$this->modifierCodeInsee();
42
				$this->modifierCodeInsee();
46
				break;
43
				break;
47
			case 'sanscorrespondance' :
44
			case 'sanscorrespondance' :
48
				// devrait être être l'option utilisée dans le cron quotidien
45
				// devrait être être l'option utilisée dans le cron quotidien
49
				$this->calculerCodeInseeSansCorrespondance();
46
				$this->calculerCodeInseeSansCorrespondance();
50
				//$this->modifierCodeInsee();
47
				$this->modifierCodeInsee();
51
			break;
48
			break;
52
			case 'colonne' :
49
			case 'colonne' :
53
				$this->creerColonne();
50
				$this->creerColonne();
54
				break;
51
				break;
Line 98... Line 95...
98
					}
95
					}
99
				}
96
				}
100
			}
97
			}
101
			$i++;
98
			$i++;
102
			$this->afficherAvancement('  Lignes traitées ', $i);
99
			$this->afficherAvancement('  Lignes traitées ', $i);
103
			
-
 
104
			// pause toutes les 1000 requêtes
100
			$this->dao->testerActiviteConnection();
105
			if($i %1000 == 0) {
-
 
106
				sleep(2);
-
 
107
			}
-
 
108
		}
101
		}
109
		echo "\n";
102
		echo "\n";
110
		$fin = microtime(true);
103
		$fin = microtime(true);
111
		echo "-------------------------------------------------------------------\n";
104
		echo "-------------------------------------------------------------------\n";
112
		echo "  Fin du traitement, ".($fin - $debut)." secondes écoulées \n";
105
		echo "  Fin du traitement, ".($fin - $debut)." secondes écoulées \n";
113
		echo "-------------------------------------------------------------------\n";
106
		echo "-------------------------------------------------------------------\n";
114
		echo "\n";
107
		echo "\n";
115
	}
108
	}
116
	
109
		
117
	private function modifierCodeInsee() {
110
	private function modifierCodeInsee() {
118
		$this->dao->modifierCodeInsee();
111
		$this->dao->modifierCodeInsee();
119
	}
112
	}
Line 120... Line 113...
120
	
113