PushLog.class.php 385 B

12345678910111213141516171819
  1. <?php
  2. /**
  3. *
  4. */
  5. class PushLog
  6. {
  7. public static function log($content)
  8. {
  9. if (!is_string($content)) {
  10. $content = json_encode($content);
  11. }
  12. $handle = fopen(APP_ROOT_PATH . 'public/push.log', "a");
  13. if ($handle) {
  14. fwrite($handle, date('Y-m-d H:i:s') . ':' . $content . PHP_EOL);
  15. fclose($handle);
  16. }
  17. }
  18. }