prepend.php 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. /*DEBUG_FLAG
  23. error_reporting(E_ALL);
  24. //*/
  25. # If you renamed your "ecrire" folder
  26. if (!defined('DC_ECRIRE')) {
  27. define('DC_ECRIRE','ecrire');
  28. }
  29. require_once dirname(__FILE__).'/../inc/magic_strip.php';
  30. require dirname(__FILE__).'/cookie.session.php';
  31. $ses = new cookieSession('DC_INSTALL');
  32. #Version de DotClear
  33. if (file_exists(dirname(__FILE__).'/../VERSION')) {
  34. define('DC_VERSION',trim(implode('',file(dirname(__FILE__).'/../VERSION'))));
  35. } else {
  36. define('DC_VERSION','?');
  37. }
  38. if (defined('STEP') && $ses->f('step') != STEP) {
  39. header('Location: index.php');
  40. exit;
  41. }
  42. require_once dirname(__FILE__).'/../inc/classes/class.mysql.php';
  43. require_once dirname(__FILE__).'/../inc/classes/class.blog.php';
  44. require_once dirname(__FILE__).'/../inc/classes/class.checklist.php';
  45. require_once dirname(__FILE__).'/../inc/classes/class.xmlsql.php';
  46. require_once dirname(__FILE__).'/../inc/classes/class.ini.file.php';
  47. require_once dirname(__FILE__).'/../inc/libs/lib.form.php';
  48. require_once dirname(__FILE__).'/../inc/libs/lib.util.php';
  49. require_once dirname(__FILE__).'/../inc/libs/lib.files.php';
  50. require_once dirname(__FILE__).'/../inc/libs/lib.l10n.php';
  51. if (!empty($_POST['lang'])) {
  52. $ses->reg('lang',$_POST['lang']);
  53. }
  54. if (!empty($_POST['encoding'])) {
  55. $ses->reg('encoding',$_POST['encoding']);
  56. }
  57. if ($ses->f('encoding') !== null && $ses->f('encoding') == 'UTF-8') {
  58. define('ENCODING','UTF-8');
  59. define('LANG_PREFIX','-utf8');
  60. } else {
  61. define('ENCODING','ISO-8859-1');
  62. define('LANG_PREFIX','');
  63. }
  64. l10n::init();
  65. if ($ses->f('lang') !== null) {
  66. l10n::set(dirname(__FILE__).'/../l10n/'.$ses->f('lang').LANG_PREFIX.'/install');
  67. }
  68. if (file_exists(dirname(__FILE__).'/../conf/config.php') && !defined('NOT_CHECK_CONFIG')) {
  69. header('Content-Type: text/plain');
  70. echo __('This weblog is still installed. You must remove conf/config.php first');
  71. exit;
  72. }
  73. # Conf
  74. $img_chk_on = '../'.DC_ECRIRE.'/images/check_on.png';
  75. $img_chk_off = '../'.DC_ECRIRE.'/images/check_off.png';
  76. $img_chk_wrn = '../'.DC_ECRIRE.'/images/check_wrn.png';
  77. ?>