2 /********************************************************************
6 Copyright 2008-2009 Radosław Pietruszewski
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 version 2 as published by the Free Software Foundation.
12 This program 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.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 ********************************************************************/
23 $_w_startTime = microtime();
24 $_w_startTime = explode(' ', $_w_startTime);
25 $_w_startTime_msec = substr($_w_startTime[0],2);
26 $_w_startTime_sec = $_w_startTime[1];
27 $_w_startTime = $_w_startTime_sec . $_w_startTime_msec;
28 $_w_startTime = substr($_w_startTime, 0, -2);
32 session_regenerate_id();
34 header("Content-Type: text/html; charset=UTF-8");
37 ## magic quotes - odwracamy skutki działań magic quotes
40 if(get_magic_quotes_gpc())
42 function stripslashes_deep($value)
44 $value = is_array($value) ?
array_map('stripslashes_deep', $value) : stripslashes($value);
47 $_POST = array_map('stripslashes_deep', $_POST);
48 $_GET = array_map('stripslashes_deep', $_GET);
49 $_COOKIE = array_map('stripslashes_deep', $_COOKIE);
50 $_REQUEST = array_map('stripslashes_deep', $_REQUEST);
54 ## wczytujemy plik z konfiguracją
57 if(file_exists('config.php'))
61 if(!isset($_w_baseURL))
63 header('Location: wtrmln/install/index.php');
69 header('Location: wtrmln/install/index.php');
74 ## definiowanie podstawowych stałych
77 $_w_basePath = str_replace('\\', '/', realpath(dirname(__FILE__
))) . '/';
79 define('WTRMLN_BASEURL' , $_w_baseURL );
80 define('WTRMLN_SITEURL' , $_w_siteURL );
81 define('WTRMLN_ADMINURL' , $_w_adminURL );
82 define('WTRMLN_CMSDIR' , $_w_cmsDir );
83 define('WTRMLN_THEME' , $_w_theme );
84 define('WTRMLN_DEFAULTCNT' , $_w_defaultCnt );
85 define('WTRMLN_SITENAME' , $_w_siteName );
86 define('WTRMLN_SITESLOGAN' , $_w_siteSlogan );
88 define('WTRMLN_CMSURL' , $_w_baseURL . WTRMLN_CMSDIR
);
89 define('WTRMLN_CMSPATH' , $_w_basePath . WTRMLN_CMSDIR
);
90 define('WTRMLN_APPPATH' , WTRMLN_CMSPATH
. 'modules/' );
92 define('WTRMLN_THEMEURL' , WTRMLN_CMSURL
. 'themes/' . WTRMLN_THEME
. '/');
93 define('WTRMLN_THEMEPATH' , WTRMLN_CMSPATH
. 'themes/' . WTRMLN_THEME
. '/');
94 define('WTRMLN_LIBS' , WTRMLN_CMSPATH
. 'libs/' );
95 define('WTRMLN_ADMINLIBS' , WTRMLN_CMSPATH
. 'admin/libs/' );
96 define('WTRMLN_HELPERS' , WTRMLN_CMSPATH
. 'helpers/' );
97 define('WTRMLN_CACHE' , WTRMLN_CMSPATH
. 'cache/' );
98 define('WTRMLN_FILES' , WTRMLN_CMSURL
. 'files/' );
99 define('WTRMLN_CONTROLLERS' , WTRMLN_APPPATH
. 'controllers/' );
100 define('WTRMLN_VIEWS' , WTRMLN_APPPATH
. 'views/' );
101 define('WTRMLN_MODELS' , WTRMLN_APPPATH
. 'models/' );
102 define('WTRMLN_BLOCKS' , WTRMLN_APPPATH
. 'blocks/' );
103 define('WTRMLN_PLUGINS' , WTRMLN_APPPATH
. 'plugins/' );
105 include WTRMLN_LIBS
. 'config.php';
107 Config
::$theme = $_w_theme;
108 Config
::$defaultController = $_w_defaultCnt;
109 Config
::$hashAlgo = $_w_hashAlgo;
110 Config
::$defaultHashAlgo = $_w_dHashAlgo;
111 Config
::$siteName = $_w_siteName;
112 Config
::$siteSlogan = $_w_siteSlogan;
113 Config
::setSuperusers($_w_superusers);
116 ## odpalamy główny plik CMS-a
119 include WTRMLN_CMSPATH
. 'system.php';