人人商城

systeminfo.ctrl.php 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. /**
  3. * [WeEngine System] Copyright (c) 2014 WE7.CC
  4. * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
  5. */
  6. defined('IN_IA') or exit('Access Denied');
  7. load()->model('system');
  8. $dos = array('display', 'get_attach_size');
  9. $do = in_array($do, $dos) ? $do : 'display';
  10. if ($do == 'display') {
  11. $_W['page']['title'] = '系统信息 - 工具 - 系统管理';
  12. $info = array(
  13. 'os' => php_uname(),
  14. 'php' => phpversion(),
  15. 'sapi' => $_SERVER['SERVER_SOFTWARE'] ? $_SERVER['SERVER_SOFTWARE'] : php_sapi_name(),
  16. );
  17. $size = 0;
  18. $size = @ini_get('upload_max_filesize');
  19. if ($size) {
  20. $size = bytecount($size);
  21. }
  22. if ($size > 0) {
  23. $ts = @ini_get('post_max_size');
  24. if ($ts) {
  25. $ts = bytecount($size);
  26. }
  27. if ($ts > 0) {
  28. $size = min($size, $ts);
  29. }
  30. $ts = @ini_get('memory_limit');
  31. if ($ts) {
  32. $ts = bytecount($size);
  33. }
  34. if ($ts > 0) {
  35. $size = min($size, $ts);
  36. }
  37. }
  38. if (empty($size)) {
  39. $size = '';
  40. } else {
  41. $size = sizecount($size);
  42. }
  43. $info['limit'] = $size;
  44. $sql = 'SELECT VERSION();';
  45. $info['mysql']['version'] = pdo_fetchcolumn($sql);
  46. $tables = pdo_fetchall("SHOW TABLE STATUS LIKE '".$_W['config']['db']['tablepre']."%'");
  47. $size = 0;
  48. foreach ($tables as &$table) {
  49. $size += $table['Data_length'] + $table['Index_length'];
  50. }
  51. if (empty($size)) {
  52. $size = '';
  53. } else {
  54. $size = sizecount($size);
  55. }
  56. $info['mysql']['size'] = $size;
  57. $info['attach']['url'] = $_W['attachurl'];
  58. template('system/systeminfo');
  59. }
  60. if ($do == 'get_attach_size') {
  61. $path = IA_ROOT . '/' . $_W['config']['upload']['attachdir'];
  62. $size = dir_size($path);
  63. if (empty($size)) {
  64. $size = '';
  65. } else {
  66. $size = sizecount($size);
  67. }
  68. iajax(0, array('attach_size' => $size));
  69. }