Ejemplo n.º 1
0
 /**
  *  アラートメールを送信する
  *
  *  @access protected
  *  @param  string  $message    ログメッセージ
  *  @return int     0:正常終了
  *  @deprecated
  */
 public function _alert($message)
 {
     restore_error_handler();
     // ヘッダ
     $header = "Mime-Version: 1.0\n";
     $header .= "Content-Type: text/plain; charset=ISO-2022-JP\n";
     $header .= "X-Alert: " . $this->controller->getAppId();
     $subject = sprintf("[%s] alert (%s%s)\n", $this->controller->getAppId(), substr($message, 0, 12), strlen($message) > 12 ? "..." : "");
     // 本文
     $mail = sprintf("--- [log message] ---\n%s\n\n", $message);
     if (function_exists("debug_backtrace")) {
         $bt = debug_backtrace();
         $mail .= sprintf("--- [backtrace] ---\n%s\n", Ethna_Util::FormatBacktrace($bt));
     }
     foreach ($this->alert_mailaddress as $mailaddress) {
         mail($mailaddress, $subject, mb_convert_encoding($mail, "ISO-2022-JP"), $header);
     }
     set_error_handler("ethna_error_handler");
     return 0;
 }
Ejemplo n.º 2
0
 public function testGetAppId()
 {
     $this->controller->getAppId()->willReturn("CHOBIE");
     $backend = new Ethna_Mock_Backend($this->controller->reveal());
     $this->assertEquals("CHOBIE", $backend->getAppId());
 }
Ejemplo n.º 3
0
 /**
  *  オブジェクト生成メソッド(session)
  *
  *  @access protected
  *  @param  string  $class_name     クラス名
  *  @return object  生成されたオブジェクト(エラーならnull)
  */
 function _getObject_Session($class_name)
 {
     $_ret_object = new $class_name($this->ctl, $this->ctl->getAppId());
     return $_ret_object;
 }
Ejemplo n.º 4
0
 /**
  *  アプリケーションIDを返す
  *
  *  @access public
  *  @return string  アプリケーションID
  */
 public function getAppId()
 {
     return $this->controller->getAppId();
 }
Ejemplo n.º 5
0
 /**
  *  設定ファイル名を取得する
  *
  *  @access private
  *  @return string  設定ファイルへのフルパス名
  */
 function _getConfigFile()
 {
     return $this->controller->getDirectory('etc') . '/' . strtolower($this->controller->getAppId()) . '-ini.php';
 }