index.php 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <?php
  2. # ***** BEGIN LICENSE BLOCK *****
  3. # This file is part of DotClear.
  4. # Copyright (c) 2004 Olivier Meunier and contributors. All rights
  5. # reserved.
  6. #
  7. # DotClear is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 2 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # DotClear is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with DotClear; if not, write to the Free Software
  19. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. #
  21. # ***** END LICENSE BLOCK *****
  22. buffer::str(
  23. '<h2>'.__('Informations').'</h2>'.
  24. '<h3>'.__('General informations').'</h3>'
  25. );
  26. # Version de dotclear
  27. buffer::str(
  28. sprintf(__('You are using DotClear version %s'),'<strong>'.DC_VERSION.'</strong>').'</p>'
  29. );
  30. # Les tables de la base de données
  31. $rs = $con->select('SHOW TABLE STATUS LIKE \''.DB_PREFIX.'%\'');
  32. buffer::str(
  33. '<p>'.__('DotClear tables in your database are').'&nbsp;:</p>'.
  34. '<table class="clean-table">'.
  35. '<tr><th>'.__('Name').'</th><th>'.__('Records').'</th><th>'.__('Size').'</th></tr>'
  36. );
  37. while ($rs->fetch())
  38. {
  39. buffer::str(
  40. '<tr>'.
  41. '<td>'.$rs->f('name').'</td>'.
  42. '<td>'.$rs->f('rows').'</td>'.
  43. '<td>'.files::size($rs->f('Data_length')+$rs->f('Index_length')).'</td>'.
  44. '</tr>'
  45. );
  46. }
  47. buffer::str('</table>');
  48. buffer::str(
  49. '<h3>'.__('Files informations').'</h3>'.
  50. '<p>'.__('Files or directories permissions. If a file or a folder from this '.
  51. 'list is not writable, it wont prevent DotClear to work properly. It will only '.
  52. 'prevent some tools to work.').'</p>'
  53. );
  54. $img_check = '<img src="images/check_%s.png" alt="" />';
  55. if (is_writable(dirname(__FILE__).'/../../../conf/dotclear.ini')) {
  56. buffer::str(
  57. '<p>'.sprintf($img_check,'on').' '.
  58. sprintf(__('File %s is writable.'),'conf/dotclear.ini').
  59. '</p>'
  60. );
  61. } else {
  62. buffer::str(
  63. '<p>'.sprintf($img_check,'off').' '.
  64. sprintf(__('File %s is not writable.'),'conf/dotclear.ini').
  65. '</p>'
  66. );
  67. }
  68. if (is_writable(dirname(__FILE__).'/../../../conf/UPDATE')) {
  69. buffer::str(
  70. '<p>'.sprintf($img_check,'on').' '.
  71. sprintf(__('File %s is writable.'),'conf/UPDATE').
  72. '</p>'
  73. );
  74. } else {
  75. buffer::str(
  76. '<p>'.sprintf($img_check,'off').' '.
  77. sprintf(__('File %s is not writable.'),'conf/UPDATE').
  78. '</p>'
  79. );
  80. }
  81. if (is_writable(dc_img_root)) {
  82. buffer::str(
  83. '<p>'.sprintf($img_check,'on').' '.
  84. sprintf(__('Directory %s is writable.'),dc_img_root).
  85. '</p>'
  86. );
  87. } else {
  88. buffer::str(
  89. '<p>'.sprintf($img_check,'off').' '.
  90. sprintf(__('Directory %s is not writable.'),dc_img_root).
  91. '</p>'
  92. );
  93. }
  94. if (is_writable(dirname(__FILE__).'/../../../themes')) {
  95. buffer::str(
  96. '<p>'.sprintf($img_check,'on').' '.
  97. sprintf(__('Directory %s is writable.'),'themes/').
  98. '</p>'
  99. );
  100. } else {
  101. buffer::str(
  102. '<p>'.sprintf($img_check,'off').' '.
  103. sprintf(__('Directory %s is not writable.'),'themes/').
  104. '</p>'
  105. );
  106. }
  107. if (is_writable(dirname(__FILE__).'/../')) {
  108. buffer::str(
  109. '<p>'.sprintf($img_check,'on').' '.
  110. sprintf(__('Directory %s is writable.'),DC_ECRIRE.'/tools').
  111. '</p>'
  112. );
  113. } else {
  114. buffer::str(
  115. '<p>'.sprintf($img_check,'off').' '.
  116. sprintf(__('Directory %s is not writable.'),DC_ECRIRE.'/tools').
  117. '</p>'
  118. );
  119. }
  120. if (is_writable(DC_SHARE_DIR)) {
  121. buffer::str(
  122. '<p>'.sprintf($img_check,'on').' '.
  123. sprintf(__('Directory %s is writable.'),'share/').
  124. '</p>'
  125. );
  126. } else {
  127. buffer::str(
  128. '<p>'.sprintf($img_check,'off').' '.
  129. sprintf(__('Directory %s is not writable.'),'share/').
  130. '</p>'
  131. );
  132. }
  133. if (!defined('DC_UPDATE_FILE_W') || !DC_UPDATE_FILE_W) {
  134. buffer::str(
  135. '<p><strong>'.__('Important').'&nbsp;:</strong> '.
  136. sprintf(__('the file %s is not writable. While this does not prevent '.
  137. 'DotClear from running, you should consider changing this for performance '.
  138. 'reasons (HTTP cache).'),'conf/UPDATE')
  139. );
  140. }
  141. buffer::str(
  142. '<h3>'.__('Server informations').'</h3>'.
  143. '<p>'.sprintf(__('Your PHP version is %s'),'<strong>'.phpversion().'</strong>').'</p>'
  144. );
  145. if (($rs = $con->select('SELECT VERSION() AS version')) !== false)
  146. {
  147. $mysql_version = preg_replace('/-log$/','',$rs->f(0));
  148. buffer::str(
  149. '<p>'.sprintf(__('Your MySQL version is %s'),
  150. '<strong>'.preg_replace('/-log$/','',$rs->f(0)).'</strong>').'</p>'
  151. );
  152. $mysql_version = preg_replace('/-log$/','',$rs->f(0));
  153. }
  154. if (!empty($_SERVER["SERVER_SOFTWARE"])) {
  155. buffer::str(
  156. '<p>'.sprintf(__('Your Web server is %s'),
  157. '<strong>'.$_SERVER["SERVER_SOFTWARE"].'</strong>').'</p>'
  158. );
  159. }
  160. ?>