dp_index.php 947 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. //设置插件别名
  3. $plugins = array(
  4. 'uc' => 'ucenter',
  5. 'dpcl' => 'dpcl',
  6. 'dpyh' => 'dpyh',
  7. 'dpsb' => 'dpsb',
  8. 'dpsj' => 'dpsj',
  9. 'dpxf' => 'dpxf',
  10. 'dpqd' => 'dpqd',
  11. 'dpjk' => 'dpjk',
  12. );
  13. //获取并检查插件标识前缀
  14. if(PHP_SAPI == 'cli'){
  15. if(count($argv) >= 2 && in_array($argv[1],array('start','stop','status')) ){
  16. if(count($argv)>=3 && $argv[2] == '-d')
  17. $_GET['s'] = $argv[3];
  18. else
  19. $_GET['s'] = $argv[2];
  20. } else{
  21. $_GET['s'] = $argv[1];
  22. }
  23. }
  24. else{
  25. if(! isset($_GET['s']))
  26. $_GET['s'] = 'uc_manage/login';
  27. }
  28. $prefix = substr( $_GET['s'] ,0,strpos($_GET['s'] ,'_'));
  29. if(!isset($plugins[$prefix]))
  30. die('unknown plugin prefix - ' . $prefix);
  31. //运行相应插件
  32. $path = __DIR__ . '/' . $plugins[$prefix] . '/stub.php';
  33. if(! file_exists($path) )
  34. die('invalid plugin path - ' . $path);
  35. define('SCRIPT_FILENAME', $path);
  36. require $path;
  37. require __DIR__.'/jrtp/stub.php';