11 error_reporting(E_ERROR | E_PARSE);
12 require_once(
"./core_interface.php");
13 require_once(
"./core_functions.php");
19 $seo->title($afterBootUp[0]->info[
'FWK'].
' - Installer');
20 $seo->owner(
'Bc. Peter Horváth');
21 $seo->bootstrapDefs();
24 $PHPversion=explode(
".",phpversion());
25 if(($_GET[
'install']==
'true')&&($PHPversion[0]>=5))
27 chmod(
"../fw_headers/", 0777);
28 if(($_POST[
'host']!=
"")&&($_POST[
'user']!=
"")&&($_POST[
'name']!=
"")&&($_POST[
'pass']!=
""))
30 $hash = md5($_SERVER[
'SERVER_NAME'].$_SERVER[
'SERVER_ADDR'].$_POST[
'host'].$_POST[
'user'].$_POST[
'type']);
31 $file =
new fileSystem(
'../fw_headers/mysql-config.php');
34 .---------------------------------------------------------------------------.
35 | Software: OpenSencillo SQL Config |
36 | Version: '.$afterBootUp[0]->info[
'VSN'].
' |
38 | ------------------------------------------------------------------------- |
39 | Author: Bc. Peter Horváth (original founder) |
40 | Copyright (c) 2015, Bc. Peter Horváth. All Rights Reserved. |
41 | ------------------------------------------------------------------------- |
42 | License: Distributed under the General Public License (GPL) |
43 | http://www.gnu.org/licenses/gpl-3.0.html |
44 | This program is distributed in the hope that it will be useful - WITHOUT |
45 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
46 | FITNESS FOR A PARTICULAR PURPOSE. |
47 ´---------------------------------------------------------------------------´
52 const host = "'.$_POST[
'host'].
'";
53 const name = "'.$_POST[
'name'].
'";
54 const user = "'.$_POST[
'user'].
'";
55 const pass = "'.$_POST[
'pass'].
'";
56 const type = "'.$_POST[
'type'].
'";
57 const hash = "'.$hash.
'";
58 const cache= "'.$_POST[
'cache'].
'";
60 //depecrated variables
62 $DBHost = database::host;
64 $DBUser = database::name;
65 $DBName = database::user;
66 $DBPass = database::pass;
68 $DBType = database::type;
70 define("SENCILLO_CONFIG",database::hash);
72 $QUICKCACHE_ON = database::cache;
76 if(!file_exists(
'../yourcode.php'))
83 $seo->title($core->coreSencillo->info["FWK"]." - Example page");
84 $seo->owner("'.$_POST[
'user-new-name'].
', '.$_POST[
'user-new-mail'].
'");
85 $seo->bootstrapDefs();
88 $translate = new translate("translate.json","en");
89 require_once("./fw_templates/welcome.default.screen.php");
93 $json = json_encode(array(
'time'=>date(
"H:i:s"),
94 'date'=>date(
"Y-m-d"),
95 'email'=>$_POST[
'user-new-mail'],
97 'SYSTEM'=>$afterBootUp[0]->info[
'FWK'],
103 $file->write(
'# Create with '.$afterBootUp[0]->info[
'FWK'].
'.
105 <IfModule mod_expires.c>
108 ExpiresByType image/jpg "access plus 1 month"
109 ExpiresByType image/jpeg "access plus 1 month"
110 ExpiresByType image/gif "access plus 1 month"
111 ExpiresByType image/png "access plus 1 month"
114 RewriteCond %{SERVER_PORT} ^443$
115 RewriteRule ^(.*)$ http://'.$_SERVER[
'SERVER_NAME'].
'/$1 [L,R=301]
122 RewriteCond %{REQUEST_FILENAME} !-f
123 RewriteCond %{REQUEST_FILENAME} !-d
124 RewriteCond %{REQUEST_FILENAME} !-l
125 RewriteRule ^(.*)$ index.php?p=$1 [L,QSA]
127 # opensencillo.com -> www.opensencillo.com
128 RewriteCond %{HTTP_HOST} !^'.$_SERVER[
'SERVER_NAME'].
'$ [NC]
129 RewriteRule ^(.*)$ http://'.$_SERVER[
'SERVER_NAME'].
'/$1 [L,R=301]');
130 chmod(
"../fw_core/", 0700);
131 chmod(
"../fw_cache/", 0700);
132 chmod(
"../fw_headers/", 0700);
133 chmod(
"../fw_modules/", 0700);
134 chmod(
"../fw_libraries/", 0700);
135 chmod(
"../fw_script/", 0700);
137 require(
"../fw_headers/mysql-config.php");
138 require(
"../fw_headers/main-config.php");
139 require(
"./core_sql.php");
140 require(
"../fw_libraries/login.management.logman.php");
141 require(
"../fw_libraries/test.tool.framework.php");
144 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
146 $mysql->write($delinsql);
148 SET time_zone = "+00:00";
150 $mysql->write($delinsql);
153 CREATE TABLE IF NOT EXISTS `console` (
154 `id` bigint(20) NOT NULL AUTO_INCREMENT,
155 `time` datetime NOT NULL,
156 `title` varchar(25) NOT NULL,
157 `data` varchar(255) NOT NULL,
159 ) ENGINE=MEMORY DEFAULT CHARSET=utf8 MAX_ROWS=10000 AUTO_INCREMENT=0;
161 $mysql->write($delinsql);
164 CREATE TABLE IF NOT EXISTS `country` (
165 `id` varchar(2) COLLATE utf8_unicode_ci NOT NULL,
166 `id2` varchar(3) COLLATE utf8_unicode_ci DEFAULT NULL,
167 `name` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
169 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
171 $mysql->write($delinsql);
174 CREATE TABLE IF NOT EXISTS `login` (
175 `id` bigint(20) NOT NULL AUTO_INCREMENT,
176 `userid` bigint(20) NOT NULL,
177 `sessionid` longtext NOT NULL,
178 `expiration` int(11) NOT NULL,
179 `perm` int(11) NOT NULL,
181 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=0;
183 $mysql->write($delinsql);
186 CREATE TABLE sencillo_cache (
187 CACHEKEY varchar(255) NOT NULL,
188 CACHEEXPIRATION int(11) NOT NULL,
192 PRIMARY KEY (CACHEKEY)
195 $mysql->write($delinsql);
198 CREATE TABLE IF NOT EXISTS `virtual_system_config` (
199 `id` int(11) NOT NULL AUTO_INCREMENT,
200 `function` varchar(25) NOT NULL,
201 `command` varchar(25) NOT NULL,
202 `commander` int(11) NOT NULL,
204 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ;
206 $mysql->write($delinsql);
209 $logman=
new logMan($DBHost,$DBName,$DBUser,$DBPass);
215 'virtual_system_config'=>array(
217 'function'=>
'superuser',
218 'command'=>$_POST[
'user-new-name'],
221 $mysql->insert($delinsql);
225 'virtual_system_config'=>array(
227 'function'=>
'superpass',
228 'command'=>md5($_POST[
'user-new-pass']),
231 $mysql->insert($delinsql);
234 'virtual_system_config'=>array(
236 'function'=>
'supermail',
237 'command'=>$_POST[
'user-new-mail'],
240 $mysql->insert($delinsql);
243 'virtual_system_config'=>array(
245 'function'=>
'systemhash',
249 $mysql->insert($delinsql);
252 'virtual_system_config'=>array(
254 'function'=>
'servername',
255 'command'=>$_SERVER[
'SERVER_NAME'],
258 $mysql->insert($delinsql);
261 'virtual_system_config'=>array(
263 'function'=>
'htaccess_config',
264 'command'=>
'default',
267 $mysql->insert($delinsql);
270 'virtual_system_config'=>array(
272 'function'=>
'phpversion',
273 'command'=>phpversion(),
276 $mysql->insert($delinsql);
281 'sign'=>
"'first_use'",
283 'login'=>
"'".$_POST[
'user-new-name'].
"'",
284 'pass'=>
"'".md5($_POST[
'user-new-pass']).
"'",
285 'email'=>
"'".$_POST[
'user-new-mail'].
"'",
289 'ip'=>
"'".$_SERVER[
'REMOTE_ADDR'].
"'",
290 'agent'=>
"'".$_SERVER[
'HTTP_USER_AGENT'].
"'",
291 'date'=>
'DATE(NOW())',
292 'time'=>
'TIME(NOW())',
294 $mysql->insert($delinsql,
false);
297 require_once
'../fw_templates/installer.main.screen.php';