27 error_reporting(E_ERROR | E_PARSE);
28 require_once(
"./core_functions.php");
34 $seo->title($afterBootUp[0]->info[
'FWK'].
' - Installer');
35 $seo->owner(
'Bc. Peter Horváth');
36 $seo->bootstrapDefs();
39 $PHPversion=explode(
".",phpversion());
40 if(($_GET[
'install']==
'true')&&($PHPversion[0]>=5))
42 chmod(
"../fw_headers/", 0777);
43 if(($_POST[
'host']!=
"")&&($_POST[
'user']!=
"")&&($_POST[
'name']!=
"")&&($_POST[
'pass']!=
""))
45 $hash = md5($_SERVER[
'SERVER_NAME'].$_SERVER[
'SERVER_ADDR'].$_POST[
'host'].$_POST[
'user'].$_POST[
'type']);
46 $file =
new fileSystem(
'../fw_headers/mysql-config.php');
49 .---------------------------------------------------------------------------.
50 | Software: OpenSencillo SQL Config |
51 | Version: '.$afterBootUp[0]->info[
'VSN'].
' |
53 | ------------------------------------------------------------------------- |
54 | Author: Bc. Peter Horváth (original founder) |
55 | Copyright (c) 2015, Bc. Peter Horváth. All Rights Reserved. |
56 | ------------------------------------------------------------------------- |
57 | License: Distributed under the General Public License (GPL) |
58 | http://www.gnu.org/licenses/gpl-3.0.html |
59 | This program is distributed in the hope that it will be useful - WITHOUT |
60 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
61 | FITNESS FOR A PARTICULAR PURPOSE. |
62 ´---------------------------------------------------------------------------´
65 $DBHost = "'.$_POST[
'host'].
'";
67 $DBUser = "'.$_POST[
'user'].
'";
68 $DBName = "'.$_POST[
'name'].
'";
69 $DBPass = "'.$_POST[
'pass'].
'";
71 $DBType = "'.$_POST[
'type'].
'";
73 define("SENCILLO_CONFIG","'.$hash.
'");
75 $QUICKCACHE_ON = '.$_POST[
'cache'].
';
79 if(!file_exists(
'../yourcode.php'))
84 //write your PHP code here
87 $json = json_encode(array(
'time'=>date(
"H:i:s"),
88 'date'=>date(
"Y-m-d"),
89 'email'=>$_POST[
'user-new-mail'],
91 'SYSTEM'=>$afterBootUp[0]->info[
'FWK'],
97 $file->write(
'# Create with '.$afterBootUp[0]->info[
'FWK'].
'.
99 <IfModule mod_expires.c>
102 ExpiresByType image/jpg "access plus 1 month"
103 ExpiresByType image/jpeg "access plus 1 month"
104 ExpiresByType image/gif "access plus 1 month"
105 ExpiresByType image/png "access plus 1 month"
108 RewriteCond %{SERVER_PORT} ^443$
109 RewriteRule ^(.*)$ http://'.$_SERVER[
'SERVER_NAME'].
'/$1 [L,R=301]
116 RewriteCond %{REQUEST_FILENAME} !-f
117 RewriteCond %{REQUEST_FILENAME} !-d
118 RewriteCond %{REQUEST_FILENAME} !-l
119 RewriteRule ^(.*)$ index.php?p=$1 [L,QSA]
121 # opensencillo.com -> www.opensencillo.com
122 RewriteCond %{HTTP_HOST} !^'.$_SERVER[
'SERVER_NAME'].
'$ [NC]
123 RewriteRule ^(.*)$ http://'.$_SERVER[
'SERVER_NAME'].
'/$1 [L,R=301]');
124 chmod(
"../fw_core/", 0700);
125 chmod(
"../fw_cache/", 0700);
126 chmod(
"../fw_headers/", 0700);
127 chmod(
"../fw_modules/", 0700);
128 chmod(
"../fw_libraries/", 0700);
129 chmod(
"../fw_script/", 0700);
131 require(
"../fw_headers/mysql-config.php");
132 require(
"../fw_headers/main-config.php");
133 require(
"./core_sql.php");
136 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
138 $mysql->write($delinsql);
140 SET time_zone = "+00:00";
142 $mysql->write($delinsql);
145 CREATE TABLE IF NOT EXISTS `console` (
146 `id` bigint(20) NOT NULL AUTO_INCREMENT,
147 `time` datetime NOT NULL,
148 `title` varchar(25) NOT NULL,
149 `data` varchar(255) NOT NULL,
151 ) ENGINE=MEMORY DEFAULT CHARSET=utf8 MAX_ROWS=10000 AUTO_INCREMENT=0;
153 $mysql->write($delinsql);
156 CREATE TABLE IF NOT EXISTS `country` (
157 `id` varchar(2) COLLATE utf8_unicode_ci NOT NULL,
158 `id2` varchar(3) COLLATE utf8_unicode_ci DEFAULT NULL,
159 `name` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
161 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
163 $mysql->write($delinsql);
166 CREATE TABLE IF NOT EXISTS `login` (
167 `id` bigint(20) NOT NULL AUTO_INCREMENT,
168 `userid` bigint(20) NOT NULL,
169 `sessionid` longtext NOT NULL,
170 `expiration` int(11) NOT NULL,
171 `perm` int(11) NOT NULL,
173 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=0;
175 $mysql->write($delinsql);
178 CREATE TABLE sencillo_cache (
179 CACHEKEY varchar(255) NOT NULL,
180 CACHEEXPIRATION int(11) NOT NULL,
184 PRIMARY KEY (CACHEKEY)
187 $mysql->write($delinsql);
190 CREATE TABLE IF NOT EXISTS `virtual_system_config` (
191 `id` int(11) NOT NULL AUTO_INCREMENT,
192 `function` varchar(25) NOT NULL,
193 `command` varchar(25) NOT NULL,
194 `commander` int(11) NOT NULL,
196 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ;
198 $mysql->write($delinsql);
201 INSERT INTO `virtual_system_config` (`id`,`function`,`command`,`commander`) VALUES (``,`superuser`,`'.$_POST[
'user-new-name'].
'`,0);
203 $mysql->write($delinsql);
206 INSERT INTO `virtual_system_config` (`id`,`function`,`command`,`commander`) VALUES (``,`superpass`,`'.$_POST[
'user-new-pass'].
'`,0);
208 $mysql->write($delinsql);
211 INSERT INTO `virtual_system_config` (`id`,`function`,`command`,`commander`) VALUES (``,`superemail`,`'.$_POST[
'user-new-mail'].
'`,0);
213 $mysql->write($delinsql);
216 INSERT INTO `virtual_system_config` (`id`,`function`,`command`,`commander`) VALUES (``,`systemhash`,`'.$hash.
'`,0);
218 $mysql->write($delinsql);
221 INSERT INTO `virtual_system_config` (`id`,`function`,`command`,`commander`) VALUES (``,`servername`,`'.$_SERVER[
'SERVER_NAME'].
'`,0);
223 $mysql->write($delinsql);
226 INSERT INTO `virtual_system_config` (`id`,`function`,`command`,`commander`) VALUES (``,`htaccess_config`,`default`,0);
228 $mysql->write($delinsql);
231 INSERT INTO `virtual_system_config` (`id`,`function`,`command`,`commander`) VALUES (``,`phpversion`,`'.phpversion().
'`,0);
233 $mysql->write($delinsql);
237 require_once
'../fw_templates/installer.main.screen.php';