VM暫存
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

38 行
1.1KB

  1. <?php
  2. /*
  3. file: call_sync_daily.php 每日自動呼叫
  4. */
  5. // 場站共用設定檔
  6. require_once '/home/bigbang/apps/coworker/station.config.php';
  7. define('APP_NAME', 'sync_hq_daily'); // application name
  8. // 發生錯誤時集中在此處理
  9. function error_handler($errno, $errstr, $errfile, $errline, $errcontext)
  10. {
  11. $str = date('H:i:s')."|{$errstr}|{$errfile}|{$errline}|{$errno}\n";
  12. error_log($str, 3, LOG_PATH.APP_NAME . '.' . date('Ymd').'.log.txt'); // 3代表參考後面的檔名
  13. }
  14. set_error_handler('error_handler', E_ALL);
  15. trigger_error('..start..');
  16. try
  17. {
  18. $ch = curl_init();
  19. curl_setopt($ch, CURLOPT_URL, "http://localhost/admins_station.html/do_sync_batch_100");
  20. curl_setopt($ch, CURLOPT_HEADER, FALSE);
  21. curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
  22. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  23. curl_setopt($ch, CURLOPT_POST, FALSE);
  24. $output = curl_exec($ch);
  25. curl_close($ch);
  26. }
  27. catch(Exception $e)
  28. {
  29. trigger_error('ERROR: ' . $e->getMessage());
  30. }
  31. trigger_error('..completed..');