31 final public function write($data)
33 $this->wfp = fopen($this->name,
"wb");
34 fwrite($this->wfp,$data);
41 final public function read()
43 $this->rfp = fopen($this->name,
"rb");
45 while (!feof($this->rfp))
47 $this->contents .= fread($this->rfp, 8192);
50 return $this->contents;
70 chmod(
"../fw_core/", 0777);
71 chmod(
"../fw_cache/", 0777);
72 chmod(
"../fw_headers/", 0777);
73 chmod(
"../fw_modules/", 0777);
74 chmod(
"../fw_libraries/", 0777);
75 chmod(
"../fw_script/", 0777);
84 chmod(
"../fw_core/", 0700);
85 chmod(
"../fw_cache/", 0700);
86 chmod(
"../fw_headers/", 0700);
87 chmod(
"../fw_modules/", 0700);
88 chmod(
"../fw_libraries/", 0700);
89 chmod(
"../fw_script/", 0700);
116 $this->header[
'doctype-def']=
'<!DOCTYPE html>';
117 $this->header[
'html-def']=
'<html><head>';
118 $this->body=
'</head>';
127 $this->header[
'keywords-def'] =
'<meta name="keywords" content="'.$kw.
'" />';
136 $this->header[
'charset-def'] =
'<meta charset="'.$ec.
'" />';
144 $this->header[
'responsive-def'] =
'<meta name="viewport" content="width=device-width, initial-scale=1">';
155 $t = substr($t,0,66).
'...';
157 $this->header[
'title-def'] =
'<title>'.$t.
'</title>';
166 if(strlen($data)>159)
168 $data = substr($data,0,155).
'...';
170 $this->header[
'description-def'] =
'<meta name="description" content="'.$data.
'">';
178 $this->header[
'robots-def'] =
'<meta name="ROBOTS" content="NOODP"><meta name="Slurp" content="NOYDIR">';
187 $this->header[
'owner-def'] =
'<meta name="author" content="'.$author.
'">';
195 $this->header[
'generator-def'] =
'<meta name="generator" content="OpenSencillo Framework (www.opensencillo.com)">';
204 $this->header[
'custom'][] = $code;
212 public function script($code)
214 $this->
custom(
'<script type="text/javascript" src="'.$code.
'"></script>');
223 $this->seo = $this->header[
'doctype-def'];
224 $this->seo .= $this->header[
'html-def'];
225 $this->seo .= $this->header[
'charset-def'];
226 $this->seo .= $this->header[
'responsive-def'];
227 $this->seo .= $this->header[
'title-def'];
228 $this->seo .= $this->header[
'description-def'];
231 unset($this->header[
'html-def']);
232 unset($this->header[
'doctype-def']);
233 unset($this->header[
'charset-def']);
234 unset($this->header[
'responsive-def']);
235 unset($this->header[
'title-def']);
236 unset($this->header[
'description-def']);
238 foreach($this->header as $key => $val)
243 $this->info[
'head'][] = $key;
246 foreach($this->header[
'custom'] as $key => $val)
249 $this->info[
'head'][] = $key;
252 $this->seo .= $this->body;
261 public function lang($lang)
263 unset($this->header[
'html-def']);
264 $this->header[
'html-def']=
'<html lang="'.$lang.
'"><head>';
272 $this->header[
'jquery-js']=
'<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>';
273 $this->header[
'jqueryui-js']=
'<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>';
281 $this->header[
'bootstrap-css']=
'<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">';
282 $this->header[
'jquery-js']=
'<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>';
283 $this->header[
'bootstrap-js']=
'<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>';
300 public $original_request;
315 $this->info=array(
'CMS'=>
'OpenSencillo',
316 'NME'=>
'OpenSencillo',
317 'VSN'=>$version.
'.'.$layout.$build,
318 'FWK'=>
'OpenSencillo '.$version.
'.'.$layout.$build,
319 'ARN'=>
'Bc.Peter Horváth, Mastery s.r.o. CEO and FOUNDER',
320 'CPY'=>
'© COPYRIGHT 2011-'.date(
'Y').
' Bc.Peter Horváth',
321 'HPE'=>
'http://www.opensencillo.com',
322 'DTC'=>
'01.'.$build.
'.'.$version.
':00.00:00.'.$layout.$build,
325 $this->io_validator();
328 public function version_info()
338 public function authorized($domains)
340 if(is_array($domains))
342 $this->authorized=$domains;
343 foreach($this->authorized as $value)
345 if($_SERVER[
'SERVER_NAME']==$value)
347 $this->pid[$value]=
true;
351 $this->pid[$value]=
false;
362 $read =
new fileSystem(
'http://auth.mastery.sk/OpenSencillo2015.004.pid');
363 $exist= fopen($read->name,
"rb");
366 die($this->info[
'PID']);
370 return $read->read();
379 $json=json_decode(self::product(),
true);
380 $this->authorized($json[
'domains']);
381 if($this->pid[$_SERVER[
'SERVER_NAME']]!==
true)
383 die($this->info[
'PID']);
385 $this->info[
'product']=$json;
393 private function io_rw($input)
397 foreach($input as $key=>$val)
401 $arr[$key]=htmlspecialchars($val,ENT_COMPAT | ENT_HTML5);
402 $arr[
'admin_original'][$key]=$val;
414 private function io_validator()
417 'request'=>$this->io_rw($_REQUEST),
418 'get'=>$this->io_rw($_GET),
419 'post'=>$this->io_rw($_POST)
422 $arr[
'get'] = $this->info;
423 $arr[
'request'] = $this->info;
424 $arr[
'post'] = $this->info;
425 $arr[
'request'][
'status'] = 200;
426 $arr[
'get'][
'status'] = 200;
427 $arr[
'post'][
'status'] = 200;
430 $_POST = $arr[
'post'];
431 $_REQUEST = $arr[
'request'];
433 $this->
get = $arr[
'get'];
434 $this->post = $arr[
'post'];
435 $this->request = $arr[
'request'];
437 if(($_GET[
'status']==200)&&($_POST[
'status']==200)&&($_REQUEST[
'status']==200))
447 public function __destruct()
452 $afterBootUp=array();