Suppression lecture de fichier configuration.ini

This commit is contained in:
Michael RICOIS 2012-05-02 19:14:50 +00:00
parent 10d5a73b4f
commit cec606ae72
7 changed files with 1727 additions and 16 deletions

View File

@ -48,7 +48,7 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
protected function _initDb()
{
$dbConfig = new Zend_Config_Ini(APPLICATION_PATH . '/configs/configuration.ini', 'databases');
$dbConfig = Zend_Registry::get('configuration')->databases;
try {
$db = Zend_Db::factory($dbConfig->db);
Zend_Db_Table::setDefaultAdapter ($db);

View File

@ -96,7 +96,8 @@ class ComptageController extends Zend_Controller_Action
$request = $this->getRequest();
$object = new Object_Comptage();
$sirets = $object->count(null, null, true);
$dbConfig = new Zend_Config_Ini(APPLICATION_PATH . '/configs/configuration.ini', 'databases');
$dbConfig = Zend_Registry::get('configuration')->databases;
try {
$dbMetier = Zend_Db::factory($dbConfig->jo);
} catch ( Exception $e ) {

View File

@ -30,7 +30,6 @@ class DashboardController extends Zend_Controller_Action
public function ciblageAction()
{
require_once('Scores/Field.php');
$config = new Zend_Config_Ini(APPLICATION_PATH.'/configs/configuration.ini');
$object = new Object_Dashboard();
$request = $this->getRequest();
$comptage = $object->ciblagedetail($request->getParam('id'));
@ -81,7 +80,6 @@ class DashboardController extends Zend_Controller_Action
{
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
$config = new Zend_Config_Ini(APPLICATION_PATH.'/configs/configuration.ini');
//Criteres => Comptages (last) => enrichissement_identifiants => enrichissement_commandes
$enrichissementsM = new Application_Model_EnrichissementIdentifiants();

View File

@ -227,7 +227,6 @@ class EnrichissementController extends Zend_Controller_Action
->where('id = ?', $id);
$result = $table->fetchRow($sql);
if(!empty($result)) {
$config = new Zend_Config_Ini(APPLICATION_PATH.'/configs/configuration.ini');
$result = $result->toArray();
$date = explode(' ', $result['dateAdded']);
$path = $config->path->data.'/'.substr($date[0], 0, 7).'/';

View File

@ -1,5 +1,6 @@
<?php
require_once 'sphinxapi/sphinxapi-2.0.2.php';
//require_once 'sphinxapi/sphinxapi-2.0.2.php';
require_once 'sphinxapi/sphinxapi-2.0.4.php';
Class Ciblage
{

View File

@ -9,7 +9,7 @@ class Mail
*/
public function __construct()
{
$this->config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/configuration.ini', 'mail');
$this->config = Zend_Registry::get('configuration')->mail;
$this->mail = new Zend_Mail();
if ($this->config->method == 'smtp') {
$tr = new Zend_Mail_Transport_Smtp($this->config->smtp_host);
@ -19,7 +19,7 @@ class Mail
$this->mail->setDefaultTransport($tr);
}
}
/**
* Champ From en fonction de la clé de configuration (configuration.ini)
* @param string $configKey
@ -29,7 +29,7 @@ class Mail
$email = $this->config->$configKey;
$this->mail->setFrom($email, ucfirst($configKey));
}
/**
* Champ To en fonction de la clé de configuration (configuration.ini)
* @param string $configKey
@ -39,7 +39,7 @@ class Mail
$email = $this->config->$configKey;
$this->mail->addTo($email, ucfirst($configKey));
}
/**
* Ajout d'un champ To en spécifiant l'email et le nom qui doit apparaitre
* @param string $email
@ -49,7 +49,7 @@ class Mail
{
$this->mail->addTo($email, $this->txtConvert($nom));
}
/**
* Définit le sujet de l'email
* @param string $texte
@ -58,7 +58,7 @@ class Mail
{
$this->mail->setSubject($this->txtConvert($texte));
}
/**
* Définit le corps de l'email au format texte
* @param string $texte
@ -67,7 +67,7 @@ class Mail
{
$this->mail->setBodyText($this->txtConvert($texte));
}
/**
* Définit le corps de l'email au format html
* @param string $html
@ -76,7 +76,7 @@ class Mail
{
$this->mail->setBodyHtml($this->txtConvert($html));
}
/**
* Envoi de l'emai
*/
@ -84,10 +84,10 @@ class Mail
{
$this->mail->send();
}
//We suppose that character encoding of strings is UTF-8 on PHP script.
protected function txtConvert($string) {
return mb_convert_encoding($string, 'ISO-8859-1', 'UTF-8');
}
}

File diff suppressed because it is too large Load Diff