2013-08-29 32 views
0

我有這個問題:試圖使管理面板,那裏我有輸入的用戶和SMTP帳戶的傳遞,我需要儘可能安全之前發送到數據庫和我做這樣的:加密用戶SMTP之前發送到數據庫在codeigniter

$config = array(
'protocol' => 'smtp', 
'smtp_host' => Settings_model::$db_config['smtp_host'], 
'smtp_port' => Settings_model::$db_config['smtp_port'], 
'smtp_user' => $this->encrypt->decode(Settings_model::$db_config['smtp_user']), 
'smtp_pass' => $this->encrypt->decode(Settings_model::$db_config['smtp_pass']), 
'smtp_timeout' => 30, 
'charset' => "utf-8", 
'newline' => "\r\n" 
      ); 

,我得到這個錯誤: Fatal error: Using $this when not in object context in /application/helpers/send_email_helper.php on line 29

此行:

'smtp_user' => $this->encrypt->decode(Settings_model::$db_config['smtp_user']),

'smtp_pass' => $this->encrypt->decode(Settings_model::$db_config['smtp_pass']),

任何想法?我不想在文件中公開通行證和用戶。 在此先感謝!

回答

0

不能使用$this運算符以靜態方法。

對於靜態方法,您應該使用self::而不是$this

相關問題