refactoring new project structure
This commit is contained in:
@@ -17,18 +17,19 @@ class LanguageManager
|
||||
|
||||
function load()
|
||||
{
|
||||
$file = './app/lang/en.php';
|
||||
$file = '../lang/en.php';
|
||||
if (!file_exists($file)){
|
||||
echo 'ERROR: en.php not found';
|
||||
die();
|
||||
//TODO add lng EXEPTIONS
|
||||
}
|
||||
$arrayFirst = include($file);
|
||||
$file = './app/lang/' . $this->lngCode . '.php';
|
||||
$file = '../lang/' . $this->lngCode . '.php';
|
||||
$arraySecond = [];
|
||||
if (file_exists($file)){
|
||||
$arraySecond = include($file);
|
||||
}
|
||||
$this->lngDatabase = array_merge($arrayFirst,$arraySecond);
|
||||
$this->lngDatabase = array_merge($arrayFirst, $arraySecond);
|
||||
return true;
|
||||
}
|
||||
|
@@ -48,7 +48,7 @@ class LogManager
|
||||
$record = "[".date("H:m:s")."][".$type."]" . $value . "\n";
|
||||
if (strlen($record) > 65 ) {
|
||||
$record = Utilities::stringInsert($record,"\n",65);
|
||||
}
|
||||
}
|
||||
fwrite($this->logFile, $record);
|
||||
}
|
||||
|
||||
|
@@ -1,13 +1,13 @@
|
||||
<?php
|
||||
class Partial{
|
||||
var $assignedValues = [];
|
||||
var $partBuffer;
|
||||
var $path;
|
||||
var $debug;
|
||||
private $assignedValues = [];
|
||||
private $partBuffer;
|
||||
private $path;
|
||||
private $debug;
|
||||
|
||||
function __construct($path = "", $debug = false) {
|
||||
$this->debug = $debug;
|
||||
if (!empty('app/templates/part/' . $path . '.phtml') && file_exists('app/templates/part/' . $path . '.phtml')) {
|
||||
if (!empty('../app/templates/part/' . $path . '.phtml') && file_exists('../app/templates/part/' . $path . '.phtml')) {
|
||||
$this->path = $path;
|
||||
} else {
|
||||
echo '<pre>';
|
||||
@@ -29,6 +29,6 @@ class Partial{
|
||||
extract($this->assignedValues);
|
||||
}
|
||||
|
||||
require('app/templates/part/' . $this->path . '.phtml');
|
||||
require('../app/templates/part/' . $this->path . '.phtml');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user