Browse Source

Small bootstrap.php cleanup.

new-tests
Dmitry Khomutov 1 year ago
parent
commit
fee4b127b0
No known key found for this signature in database GPG Key ID: EC19426474B37AAC
2 changed files with 7 additions and 11 deletions
  1. +5
    -2
      bootstrap.php
  2. +2
    -9
      tests/bootstrap.php

+ 5
- 2
bootstrap.php View File

@@ -26,7 +26,10 @@ if (!defined('RUNTIME_DIR')) {

require_once(ROOT_DIR . 'vendor/autoload.php');

$config = new PHPCensor\Config();
use PHPCensor\Config;
use PHPCensor\Helper\Lang;

$config = new Config();

$configFile = APP_DIR . 'config.yml';
if (file_exists($configFile)) {
@@ -37,4 +40,4 @@ if (!defined('APP_URL') && !empty($config)) {
define('APP_URL', $config->get('php-censor.url', '') . '/');
}

\PHPCensor\Helper\Lang::init($config);
Lang::init($config);

+ 2
- 9
tests/bootstrap.php View File

@@ -24,15 +24,8 @@ if (!defined('RUNTIME_DIR')) {
define('RUNTIME_DIR', ROOT_DIR . 'runtime/');
}

require_once(ROOT_DIR . 'vendor/autoload.php');

$conf = [];
$conf['php-censor']['url'] = 'http://php-censor.local';

$config = new PHPCensor\Config($conf);

if (!defined('APP_URL')) {
define('APP_URL', $config->get('php-censor.url', '') . '/');
define('APP_URL', 'http://php-censor.local/');
}

\PHPCensor\Helper\Lang::init($config);
require_once(ROOT_DIR . 'vendor/autoload.php');

Loading…
Cancel
Save