check.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. define('STEP',2);
  23. require dirname(__FILE__).'/prepend.php';
  24. $php_check = new checkList();
  25. # Vérification de la version PHP
  26. $php_check->addItem('php',version_compare(phpversion(),'4.1','>='),
  27. sprintf(__('PHP version is %s.'),phpversion()),
  28. sprintf(__('PHP version is %s. Version 4.1 or better is required.'),phpversion())
  29. );
  30. # Vérification de la présence des fonctions MySQL
  31. $php_check->addItem('mysql',function_exists('mysql_connect'),
  32. sprintf(__('%s module is present.'),'MySQL'),
  33. sprintf(__('%s module is not present.'),'MySQL')
  34. );
  35. # Vérification de la présence du module XML
  36. $php_check->addItem('xml',function_exists('xml_parser_create'),
  37. sprintf(__('%s module is present.'),'XML'),
  38. sprintf(__('%s module is not present.'),'XML')
  39. );
  40. $files_check = new checkList();
  41. # Vérification des droits sur /conf
  42. $files_check->addItem('conf',is_writable(dirname(__FILE__).'/../conf'),
  43. sprintf(__('%s is writable.'),'conf/'),
  44. sprintf(__('%s is not writable. Please change its permissions to install.'),'conf/')
  45. );
  46. if ($php_check->checkAll() && $files_check->checkAll()) {
  47. $ses->reg('step',3);
  48. }
  49. require dirname(__FILE__).'/__top.php';
  50. echo '<h2>'.__('Checking your configuration').'</h2>';
  51. echo '<h3>'.__('PHP version and modules').'</h3>';
  52. echo $php_check->getHTML($img_chk_on,$img_chk_off,$img_chk_wrn);
  53. echo '<h3>'.__('Files permissions').'</h3>';
  54. echo $files_check->getHTML($img_chk_on,$img_chk_off,$img_chk_wrn);
  55. if ($php_check->checkAll() && $files_check->checkAll())
  56. {
  57. echo
  58. '<p><strong>'.__('DotClear can be installed on your site.').'</strong></p>';
  59. echo
  60. '<form action="db-pref.php" method="post">'.
  61. '<p><input type="submit" class="submit" value="'.__('Next step').' &#187;" /></p>'.
  62. '</form>';
  63. }
  64. else
  65. {
  66. echo
  67. '<p class="important">'.
  68. __('DotClear cannot be installed.').
  69. '</p>';
  70. if (!$php_check->checkAll()) {
  71. echo
  72. '<p>'.__('Your PHP configuration is not valid. '.
  73. 'Please contact your Web host to solve this problem.').'</p>';
  74. }
  75. if (!$files_check->checkAll()) {
  76. echo
  77. '<p>'.__('Some files or directories are not writable. Please '.
  78. 'change their permissions to install DotClear.').'</p>';
  79. }
  80. }
  81. ?>
  82. <?php require dirname(__FILE__).'/__bottom.php'; ?>