This repository has been archived by the owner on May 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4c751c6
commit 4ec06d0
Showing
4 changed files
with
23 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,13 @@ | ||
<?php | ||
|
||
|
||
use Adianti\Base\App\Lib\Util\ApplicationTranslator; | ||
use Adianti\Base\Lib\Core\TApplication; | ||
use App\Init; | ||
|
||
require_once 'init.php'; | ||
new Init(); | ||
|
||
function _t($msg, $param1 = null, $param2 = null, $param3 = null) | ||
{ | ||
return ApplicationTranslator::translate($msg, $param1, $param2, $param3); | ||
} | ||
|
||
TApplication::run(true); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,26 @@ | ||
<?php | ||
namespace App; | ||
|
||
// define the autoloader | ||
//require_once 'lib/adianti/core/AdiantiCoreLoader.php'; | ||
//spl_autoload_register(array('Adianti\Core\AdiantiCoreLoader', 'autoload')); | ||
//Adianti\Core\AdiantiCoreLoader::loadClassMap(); | ||
|
||
use Adianti\Base\App\Lib\Util\ApplicationTranslator; | ||
use Adianti\Base\Lib\Core\AdiantiApplicationConfig; | ||
use Adianti\Base\Lib\Core\AdiantiCoreTranslator; | ||
|
||
class Init | ||
{ | ||
private $ini; | ||
|
||
public function __construct() | ||
{ | ||
$loader = require 'vendor/autoload.php'; | ||
$loader->register(); | ||
|
||
$loader = require 'vendor/autoload.php'; | ||
$loader->register(); | ||
// read configurations | ||
$ini = parse_ini_file('app/config/application.ini', true); | ||
date_default_timezone_set($ini['general']['timezone']); | ||
AdiantiCoreTranslator::setLanguage($ini['general']['language']); | ||
ApplicationTranslator::setLanguage($ini['general']['language']); | ||
AdiantiApplicationConfig::load($ini); | ||
|
||
// read configurations | ||
$this->ini = parse_ini_file('app/config/application.ini', true); | ||
date_default_timezone_set($this->ini['general']['timezone']); | ||
AdiantiCoreTranslator::setLanguage($this->ini['general']['language']); | ||
ApplicationTranslator::setLanguage($this->ini['general']['language']); | ||
AdiantiApplicationConfig::load($this->ini); | ||
// define constants | ||
define('APPLICATION_NAME', $ini['general']['application']); | ||
define('OS', strtoupper(substr(PHP_OS, 0, 3))); | ||
define('PATH', dirname(__FILE__)); | ||
define('LANG', $ini['general']['language']); | ||
|
||
// define constants | ||
define('APPLICATION_NAME', $this->ini['general']['application']); | ||
define('OS', strtoupper(substr(PHP_OS, 0, 3))); | ||
define('PATH', dirname(__FILE__)); | ||
define('LANG', $this->ini['general']['language']); | ||
|
||
if (version_compare(PHP_VERSION, '5.5.0') == -1) { | ||
die(AdiantiCoreTranslator::translate('The minimum version required for PHP is ^1', '5.5.0')); | ||
} | ||
} | ||
|
||
public function getIni() | ||
{ | ||
return $this->ini; | ||
} | ||
if (version_compare(PHP_VERSION, '5.5.0') == -1) { | ||
die(AdiantiCoreTranslator::translate('The minimum version required for PHP is ^1', '5.5.0')); | ||
} | ||
|
||
|
||
return $ini; |