public function __construct() { $config = ['className' => 'Cake\\Database\\Connection', 'driver' => 'Cake\\Database\\Driver\\Mysql', 'database' => Configure::get('database.database'), 'username' => Configure::get('database.username'), 'password' => Configure::get('database.password'), 'host' => Configure::get('database.host'), 'persistent' => Configure::get('database.persistant'), 'encoding' => Configure::get('database.encoding'), 'timezone' => Configure::get('database.timezone'), 'quoteIdentifiers' => Configure::get('database.quoteIdentifiers'), 'log' => Configure::get('database.log')]; ConnectionManager::config('default', $config); $link = ConnectionManager::get('default'); self::$_logger = new QueryLogger(); $link->logger(self::$_logger); }
public function __construct() { parent::__construct(); $settings = Configure::get('Mailer'); if ($settings['useSMTP']) { $this->isSMTP(); $this->Host = $settings['Host']; $this->SMTPAuth = $settings['SMTPAuth']; $this->Username = $settings['Username']; $this->Password = $settings['Password']; $this->SMTPSecure = $settings['SMTPSecure']; $this->Port = $settings['Port']; $this->setLanguage($settings['Language']); $this->CharSet = 'utf8'; } if ($settings['FromEmail']) { $this->setFrom($settings['FromEmail'], $settings['FromName']); } if ($settings['ReplyEmail']) { $this->addReplyTo($settings['ReplyEmail'], $settings['ReplyName']); } return $this; }
<?php use Frambox\Kernel\ErrorHandler; use Frambox\Kernel\Configure; Configure::getInstance(); mb_internal_encoding(Configure::get('globals.encoding')); date_default_timezone_set(Configure::get('globals.timezone')); ini_set('intl.default_locale', Configure::get('globals.locale')); ErrorHandler::setDebug(Configure::get('globals.debug'));