Example #1
0
 public function __construct()
 {
     // parent::__construct();
     config::getInstance();
     config::getConfig();
     $router = new Router();
     $router->explodeUri();
     /*
     apenas para checagem dos caminhos
     //echo '<p>ROUT FILE: '.$routFile.'</p>';
     echo '<pre >';
     echo '<p>ROTA COMPLETA: '.$this->getRoute().'</p>';
     echo '<p>NOME Controller: '.$this->getController().'</p>';
     echo '<p>NOME METODO: '.$this->getAction().'</p>';
     echo '</pre>';
     */
     define('ROUTE', $router->getRoute());
     define('CONTROLLER', $router->getController());
     define('ACTION', $router->getAction());
     $filename = BASEPATH . DIRECTORY_SEPARATOR . APPPATH . DIRECTORY_SEPARATOR . CONTROLLERS . DIRECTORY_SEPARATOR . ROUTE . CONTROLLER . '.controller.php';
     if (file_exists($filename)) {
         require_once $filename;
         $_controllerName = CONTROLLER;
         $_controller = new $_controllerName();
         $action = ACTION;
         if (method_exists($_controller, $action)) {
             $_controller->{$action}();
         } else {
             require_once BASEPATH . DIRECTORY_SEPARATOR . APPPATH . DIRECTORY_SEPARATOR . CONTROLLERS . DIRECTORY_SEPARATOR . 'error404.controller.php';
             $errorController = new error404();
             $errorController->index();
         }
     } else {
         require_once BASEPATH . DIRECTORY_SEPARATOR . APPPATH . DIRECTORY_SEPARATOR . CONTROLLERS . DIRECTORY_SEPARATOR . 'error404.controller.php';
         $errorController = new error404();
         $errorController->index();
     }
 }
Example #2
0
 /**
  * Return connection settings.
  *
  * @return config
  */
 public function getConfig()
 {
     $this->config = config::getConfig();
     $this->config = $this->config['connections'];
     return $this;
 }
Example #3
0
 public function alipayapi()
 {
     vendor('alipay.config');
     $this->alipay_config = config::getConfig();
 }
function getSubscribersEmail($cnx, $table_config, $email, $from, $from_name, $list_id = '')
{
    $cnx->query("SET NAMES UTF8");
    $conf = new config();
    $conf->getConfig($db_host, $db_login, $db_pass, $db_name, $table_config);
    $db = new Db();
    $db->DbConnect($db_host, $db_login, $db_pass, $db_name);
    $sql = "SELECT DISTINCT email  FROM {$conf->table_email} ";
    if (!empty($list_id)) {
        $sql .= "WHERE list_id='{$list_id}'";
    }
    $cnx->SqlRow($sql);
    if ($db->DbError()) {
        echo $db->DbError();
        return -1;
    }
    $body = "adresse email des abonnés:\n";
    $body .= "-------------------------\n";
    while ($a = $db->DbNextRow()) {
        $body .= $a[0] . "\n";
    }
    return sendEmail($conf->sending_method, $email, $from, $from_name, "Liste des adresses", $body, $conf->smtp_auth, $conf->smtp_host = '', $conf->smtp_login = '', $conf->smtp_pass);
}
Example #5
0
 public function notify_url()
 {
     vendor('alipay.config');
     $this->alipay_config = config::getConfig();
 }