SystemLog.php 685 B

123456789101112131415161718192021
  1. <?php
  2. class SystemLog {
  3. private static $logPath = __DIR__.'/lib/';
  4. private $logFile;
  5. public static function GET_LOG_PATH($file,$system_uname,$param){
  6. try{
  7. $file_path = self::$logPath.$file['system']."/".$file['controller'].".php";
  8. if(!file_exists($file_path)){
  9. throw new Exception("文件不存在");
  10. }
  11. $data = include(self::$logPath.$file['system'].'/'.$file['controller'].'.php');
  12. return sprintf($data[$file['action']]['msg'],$system_uname,$param[$data[$file['action']]['resplace'][0]??0]??'');
  13. }catch (Exception $e){
  14. return "文件不存在";
  15. }
  16. }
  17. }