index.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /**
  3. * tt管理工具
  4. * 作者:于斌
  5. */
  6. #管理接口
  7. define('TT_HTTP' , 'http://' . $_SERVER['HTTP_HOST'] . substr($_SERVER['PHP_SELF'], 0, strpos($_SERVER['PHP_SELF'], 'index.php')));
  8. include(str_replace('manage', '', dirname(__FILE__)) . '/core.php');
  9. $config['name'] = 'ttserver manage v1.0';
  10. $config['request'] = $_REQUEST;
  11. if(isset($config['request']['service']))
  12. {
  13. include(TT_SERVICE_PATH . $config['request']['service'] . '.php');
  14. $project = $config['request']['project'];
  15. tt_echo("正在" . $config['lang'] . "ttserver服务...");
  16. if($project)
  17. {
  18. tt_load($project.'.php', $config['oper']);
  19. }
  20. else
  21. {
  22. $data = tt_config();
  23. foreach($data as $k => $v)
  24. {
  25. tt_load($v, $config['oper']);
  26. }
  27. }
  28. echo tt_echo('程序执行完毕');
  29. }
  30. elseif(isset($config['request']['view']) && $config['request']['view'] != 'index')
  31. {
  32. is_file($config['request']['view'] . '.php') && include($config['request']['view'] . '.php');
  33. $data = $$config['request']['view'];
  34. $config['request']['type'] && $config['request']['view'] .= '.'.$config['request']['type'];
  35. tt_view($config['request']['view'], $data);
  36. }
  37. else
  38. {
  39. tt_view('index', $config);
  40. }
  41. /**
  42. * tt_view()
  43. */
  44. function tt_view($html, $data)
  45. {
  46. include(TT_MANAGE_PATH . 'view/'.$html.'.htm');
  47. }