コード例 #1
0
ファイル: xserveradd.php プロジェクト: Ch0wW/xiii-weblist
<?php

require "include/lib_xiii.php";
$info = new XIIICreatorInfo();
$log = new LogFile();
// Quick check.
function IsEmpty($var)
{
    if ($var == -1) {
        return true;
    }
    return false;
}
// Check for illegal inputs.
if (IsEmpty($info->Get_HashCode()) && $info->Get_HashCode() != KEYPASS) {
    return;
}
// Invalid Port range.
if ($info->Get_Port() > MAXPORT && $info->Get_Port() < MINPORT || $info->Get_QueryPort() > MAXPORT && $info->Get_QueryPort() < MINPORT) {
    return;
}
// Our checks seem to be "OK", so log it.
$log->DateLog("[ASK] - Server " . $info->Get_Ip() . ":" . $info->Get_Port() . " asks for MasterServer regisration.");
// Check if we got already the ip/port into our database.
$idcheck = $info->CheckServerAlive($info->Get_Ip(), $info->Get_Port());
if ($idcheck != "") {
    if ($info->UpdateServer($idcheck)) {
        $log->DateLog("[SUCCESS] - Server at ip " . $info->Get_Ip() . ":" . $info->Get_Port() . " successfully updated for 6 more minutes!");
    }
} else {
    if ($info->AddServer($info->Get_Ip(), $info->Get_Port(), $info->Get_QueryPort())) {
コード例 #2
0
 private function makeLogFile(&$contents)
 {
     // ログファイルオブジェクト生成
     $logFile = new LogFile();
     // オペレーター情報取得
     $operatorId = $this->_core->getLoginLoginId();
     $operatorName = $this->_core->getLoginName();
     // オペレーター設定
     $logFile->setOperationLog($operatorId, $operatorName);
     // 出力ディレクトリ、ファイル名設定
     $logFile->setPath($this->_core->getBaseName());
     // ログファイル作成
     $logFile->outputWithOpearationLog($contents);
 }
コード例 #3
0
 private function makeLogFile(&$result)
 {
     $header = "";
     $header .= "案件ID,";
     $header .= "アクション日時,";
     $header .= "アクションID,";
     $header .= "メディアID,";
     $header .= "任意のID,";
     $header .= "売上(単価),";
     $header .= "原価(卸値),";
     $header .= "ステータス,";
     $header .= "締め日,";
     $header .= "備考,";
     //追加パラメーター1
     if (isset($this->_option['option1']['option_name'])) {
         $header .= $this->_option['option1']['option_name'] . ",";
     }
     //追加パラメーター2
     if (isset($this->_option['option2']['option_name'])) {
         $header .= $this->_option['option2']['option_name'] . ",";
     }
     //追加パラメーター3
     if (isset($this->_option['option3']['option_name'])) {
         $header .= $this->_option['option3']['option_name'] . ",";
     }
     //追加パラメーター4
     if (isset($this->_option['option4']['option_name'])) {
         $header .= $this->_option['option4']['option_name'] . ",";
     }
     //追加パラメーター5
     if (isset($this->_option['option5']['option_name'])) {
         $header .= $this->_option['option5']['option_name'] . ",";
     }
     $header .= "結果";
     $header .= "\r\n";
     $str = "";
     foreach ($result as $d) {
         $a = array();
         $a[] = $d['data']['anken_id'];
         //案件ID
         $a[] = $d['data']['action_time'];
         //アクション日時
         $a[] = $d['data']['action_id'];
         //アクションID
         $a[] = $d['data']['media_id'];
         //メディアID
         $a[] = $d['data']['client_user_id'];
         //任意のID
         $a[] = $d['data']['accept_price'];
         //売上
         $a[] = $d['data']['accept_oroshi'];
         //原価
         $a[] = $d['data']['accept_flg'];
         //ステータス
         $a[] = $d['data']['accept_date'];
         //締め日
         $a[] = $d['data']['memo'];
         //備考
         //追加パラメーター1
         if (isset($this->_option['option1']['option_name'])) {
             $a[] = $d['data']['option1'];
         }
         //追加パラメーター2
         if (isset($this->_option['option2']['option_name'])) {
             $a[] = $d['data']['option2'];
         }
         //追加パラメーター3
         if (isset($this->_option['option3']['option_name'])) {
             $a[] = $d['data']['option3'];
         }
         //追加パラメーター4
         if (isset($this->_option['option4']['option_name'])) {
             $a[] = $d['data']['option4'];
         }
         //追加パラメーター5
         if (isset($this->_option['option5']['option_name'])) {
             $a[] = $d['data']['option5'];
         }
         // 結果メッセージ
         $msg = "";
         $err = array();
         if ($d['eListCount'] != 0) {
             foreach ($d['eList'] as $e) {
                 $m = $e->code . ": " . $e->msg;
                 if ($e->getMessage()) {
                     $m .= " : {$e->getMessage()}";
                 }
                 $err[] = $m;
             }
             $m = implode("\r\n", $err);
             $msg = "\"{$m}\"";
         } else {
             $msg = "更新しました。";
         }
         $a[] = $msg;
         $str .= implode(',', $a) . "\r\n";
     }
     $contents = $header . $str;
     // ログファイルオブジェクト生成
     $logFile = new LogFile();
     // オペレーター情報取得
     $operatorId = $this->_core->getLoginLoginId();
     $operatorName = $this->_core->getLoginName();
     // オペレーター設定
     $logFile->setOperationLog($operatorId, $operatorName);
     // 出力ディレクトリ、ファイル名設定
     $logFile->setPath($this->_core->getBaseName());
     // ログファイル作成
     $contents = $header . $str;
     $logFile->outputWithOpearationLog($contents);
     return $logFile->getPath();
 }
コード例 #4
0
 protected function __construct()
 {
     parent::__construct('access.log');
 }
コード例 #5
0
 private function makeLogFile(&$old, &$new)
 {
     // 変更前データ
     $oldDataList = $old->getArray();
     $oldHeader = "変更前\r\n";
     $oldData = "";
     foreach ($oldDataList as $column => $value) {
         $oldHeader .= $column . ",";
         $oldData .= $value . ",";
     }
     $oldHeader = substr($oldHeader, 0, -1);
     $oldData = substr($oldData, 0, -1);
     $oldHeader .= "\r\n";
     $oldData .= "\r\n";
     // 変更後データ
     $newDataList = $new->getarray();
     $newHeader = "変更後\r\n";
     $newData = "";
     foreach ($newDataList as $column => $value) {
         $newHeader .= $column . ",";
         $newData .= $value . ",";
     }
     $newHeader = substr($newHeader, 0, -1);
     $newData = substr($newData, 0, -1);
     $newHeader .= "\r\n";
     $newData .= "\r\n";
     $contents = $oldHeader . $oldData . $newHeader . $newData;
     // ログファイルオブジェクト生成
     $logFile = new LogFile();
     // オペレーター情報取得
     $operatorId = $this->_core->getLoginLoginId();
     $operatorName = $this->_core->getLoginName();
     // オペレーター設定
     $logFile->setOperationLog($operatorId, $operatorName);
     // 出力ディレクトリ、ファイル名設定
     $logFile->setPath($this->_core->getBaseName());
     // ログファイル作成
     $logFile->outputWithOpearationLog($contents);
 }
コード例 #6
0
ファイル: LogFile.php プロジェクト: zentefi/zentefi-laravel
 /**
  *
  * @return LogFile
  *
  */
 public static function log($log_name, $var, $name = null, $date = null)
 {
     $log = new LogFile($log_name);
     $log->add_log($var, $name, $date);
     return $log;
 }