Go to the documentation of this file.
27 require_once(
"./core_functions.php");
33 $seo->title(
'LightWeight Sencillo - Install');
34 $seo->owner(
'Bc. Peter Horváth');
37 echo(
"<body><form method='post' action='http://".$_SERVER[
'SERVER_NAME'].$_SERVER[
'REQUEST_URI'].
"?install=true'><table>");
38 echo(
"<tr><td><b>System:</b></td><td>".
$afterBootUp[0]->info[
'FWK'].
"</td></tr>");
39 echo(
"<tr><td><b>Installation mode:</b></td><td>default</td></tr>");
40 echo(
"<tr><td><b>By:</b></td><td>".
$afterBootUp[0]->info[
'CPY'].
"</td></tr>");
41 echo(
"<tr><td><b>PHP:</b></td><td>".phpversion().
"</td></tr>");
42 echo(
"<tr><td><b>DB charset:</b></td><td>UTF-8</td></tr>");
43 echo(
"<tr><td><b>System charset:</b></td><td>UTF-8</td></tr>");
44 echo(
"<tr><td><b>Database</b></td><td></td></tr>");
48 echo(
"<tr><td><b>Host:</b></td><td><input type='text' name='host'></td></tr>");
49 echo(
"<tr><td><b>Name:</b></td><td><input type='text' name='name'></td></tr>");
50 echo(
"<tr><td><b>User:</b></td><td><input type='text' name='user'></td></tr>");
51 echo(
"<tr><td><b>Pass:</b></td><td><input type='text' name='pass'></td></tr>");
52 echo(
"<tr><td><b>SQL type:</b></td><td><select name='type'>
53 <option value='mysql' selected>MySQL</option>
54 <option value='mariasql'>MariaSQL</option>
55 <option value='pgsql'>PgSQL</option>
56 </select></td></tr>");
57 echo(
"<tr><td></td><td><input type='submit' value='Install'></td></tr>");
61 chmod(
"../fw_headers/", 0777);
62 if(($_POST[
'host']!=
"")&&($_POST[
'user']!=
"")&&($_POST[
'name']!=
"")&&($_POST[
'pass']!=
""))
67 .---------------------------------------------------------------------------.
68 | Software: Sencillo SQL Config |
71 | ------------------------------------------------------------------------- |
72 | Author: Bc. Peter Horváth (original founder) |
73 | Copyright (c) 2014, Bc. Peter Horváth. All Rights Reserved. |
74 | ------------------------------------------------------------------------- |
75 | License: Distributed under the General Public License (GPL) |
76 | http://www.gnu.org/copyleft/gpl.html |
77 | This program is distributed in the hope that it will be useful - WITHOUT |
78 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
79 | FITNESS FOR A PARTICULAR PURPOSE. |
80 ´---------------------------------------------------------------------------´
83 $DBHost = "'.$_POST[
'host'].
'";
85 $DBUser = "'.$_POST[
'user'].
'";
86 $DBName = "'.$_POST[
'name'].
'";
87 $DBPass = "'.$_POST[
'pass'].
'";
89 $DBType = "'.$_POST[
'type'].
'";
95 //write your PHP code here
100 <IfModule mod_expires.c>
103 ExpiresByType image/jpg "access plus 1 month"
104 ExpiresByType image/jpeg "access plus 1 month"
105 ExpiresByType image/gif "access plus 1 month"
106 ExpiresByType image/png "access plus 1 month"
109 RewriteCond %{SERVER_PORT} ^443$
110 RewriteRule ^(.*)$ http://'.$_SERVER[
'SERVER_NAME'].
'/$1 [L,R=301]
117 RewriteCond %{REQUEST_FILENAME} !-f
118 RewriteCond %{REQUEST_FILENAME} !-d
119 RewriteCond %{REQUEST_FILENAME} !-l
120 RewriteRule ^(.*)$ index.php?p=$1 [L,QSA]
122 # opensencillo.com -> www.opensencillo.com
123 RewriteCond %{HTTP_HOST} !^'.$_SERVER[
'SERVER_NAME'].
'$ [NC]
124 RewriteRule ^(.*)$ http://'.$_SERVER[
'SERVER_NAME'].
'/$1 [L,R=301]');
125 chmod(
"../fw_core/", 0700);
126 chmod(
"../fw_cache/", 0700);
127 chmod(
"../fw_headers/", 0700);
128 chmod(
"../fw_modules/", 0700);
129 chmod(
"../fw_libraries/", 0700);
130 chmod(
"../fw_script/", 0700);
133 require(
"../cms_headers/mysql-config.php");
134 require(
"../cms_headers/main-config.php");
135 require(
"./core_sql.php");
137 echo(
"<tr><td><b>Host:</b></td><td>".$_POST[
'host'].
"</td></tr>");
138 echo(
"<tr><td><b>Name:</b></td><td>".$_POST[
'name'].
"</td></tr>");
139 echo(
"<tr><td><b>User:</b></td><td>".$_POST[
'user'].
"</td></tr>");
140 echo(
"<tr><td><b>Pass:</b></td><td>****</td></tr>");
143 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
147 SET time_zone = "+00:00";
152 CREATE TABLE IF NOT EXISTS `console` (
153 `id` bigint(20) NOT NULL AUTO_INCREMENT,
154 `time` datetime NOT NULL,
155 `title` varchar(25) NOT NULL,
156 `data` varchar(255) NOT NULL,
158 ) ENGINE=MEMORY DEFAULT CHARSET=utf8 MAX_ROWS=10000 AUTO_INCREMENT=0;
163 CREATE TABLE IF NOT EXISTS `country` (
164 `id` varchar(2) COLLATE utf8_unicode_ci NOT NULL,
165 `id2` varchar(3) COLLATE utf8_unicode_ci DEFAULT NULL,
166 `name` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
168 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
173 CREATE TABLE IF NOT EXISTS `login` (
174 `id` bigint(20) NOT NULL AUTO_INCREMENT,
175 `userid` bigint(20) NOT NULL,
176 `sessionid` longtext NOT NULL,
177 `expiration` int(11) NOT NULL,
178 `perm` int(11) NOT NULL,
180 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=0;
185 CREATE TABLE sencillo_cache (
186 CACHEKEY varchar(255) NOT NULL,
187 CACHEEXPIRATION int(11) NOT NULL,
191 PRIMARY KEY (CACHEKEY)
197 CREATE TABLE IF NOT EXISTS `virtual_system_config` (
198 `id` int(11) NOT NULL AUTO_INCREMENT,
199 `function` varchar(25) NOT NULL,
200 `command` varchar(25) NOT NULL,
201 `commander` int(11) NOT NULL,
203 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ;
207 echo(
"<tr><td></td><td><b>Success</b></td></tr>");
209 echo(
"</table></form></body>");