run.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. define('InShopNC',true);
  3. define('BASE_ROOT_PATH',str_replace('\\','/',dirname(__FILE__)));
  4. echo BASE_ROOT_PATH."\n";
  5. require_once (BASE_ROOT_PATH . '/fooder.php');
  6. echo $argv;
  7. function help_out()
  8. {
  9. echo "fetch_goods:start fetch goods.\r\n";
  10. echo "fillgcid:start fill all goods class id.\r\n";
  11. echo "checkgoods:check all goods class id.\r\n";
  12. }
  13. $time = -microtime();
  14. //$hash = 0;
  15. //for ($i=0; $i < rand(1000,4000); ++$i) {
  16. // $hash ^= md5(substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, rand(1,10)));
  17. //}
  18. $time += microtime();
  19. $y = sprintf('%f', $time);
  20. $y = strtotime('2016-12-12 01:01:01');
  21. $y = urldecode('%E4%B8%AD%E9%80%9A%E5%BF%AB%E9%80%92');
  22. $x=new date();
  23. define('StartTime', microtime(true));
  24. define('TIMESTAMP', time());
  25. if(count($argv) == 1) {
  26. return;
  27. }
  28. $gfcgi_run = 1;
  29. if($gfcgi_run == 0) { //模拟请求
  30. $file = BASE_ROOT_PATH . '/debug_run.php';
  31. include $file;
  32. Base::mobile_init();
  33. Base::mobile_control();
  34. } elseif ($gfcgi_run == 1) {
  35. $file = BASE_ROOT_PATH . '/research/research_run.php';
  36. include $file;
  37. } else {
  38. Base::run_util();
  39. $file = BASE_CRONTAB_PATH . '/crawl/fetch_goods.php';
  40. require $file;
  41. }
  42. ?>