Skip to content

Commit d10e393

Browse files
author
Erik Frèrejean
committed
[stk/ascraeus] Split constants
Properly define global constants in constant files and separate dynamic and static constants.
1 parent efd0433 commit d10e393

File tree

3 files changed

+36
-26
lines changed

3 files changed

+36
-26
lines changed

stk/includes/bootstrap.php

+2-19
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,7 @@
99

1010
$starttime = microtime(true);
1111

12-
// Define some initial constants
13-
if (!defined('STK_ROOT'))
14-
{
15-
define('STK_ROOT', __DIR__ . '/../');
16-
}
17-
18-
if (!defined('PHPBB_FILES'))
19-
{
20-
define('PHPBB_FILES', STK_ROOT . 'phpBB/');
21-
}
22-
23-
if (!defined('IN_PHPBB'))
24-
{
25-
define('IN_PHPBB', true);
26-
}
27-
28-
// Enforce the usage of the SID
29-
define('NEED_SID', true);
12+
require (__DIR__ . '/static_constants.php');
3013

3114
// Setup the DI container
3215
require STK_ROOT . 'core/Pimple.php';
@@ -246,4 +229,4 @@
246229
$stk['phpbb']['style']->set_custom_style();
247230

248231
// Include some STK files that can't be autoloaded
249-
require STK_ROOT . 'includes/constants.php';
232+
require STK_ROOT . 'includes/dynamic_constants.php';

stk/includes/constants.php stk/includes/dynamic_constants.php

-7
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,5 @@
77
*
88
*/
99

10-
// Version constants
11-
define('STK_VERSION', '2.0.0-dev');
12-
define('STK_QA', true);
13-
1410
// The web path
1511
define('STK_WEB_PATH', generate_board_url(true));
16-
17-
// Tool options
18-
define('TOOL_OVERVIEW_TRIGGER', 1);

stk/includes/static_constants.php

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
/**
3+
*
4+
* @package SupportToolkit
5+
* @copyright (c) 2012 phpBB Group
6+
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
7+
*
8+
*/
9+
10+
// Define some initial constants
11+
if (!defined('STK_ROOT'))
12+
{
13+
define('STK_ROOT', __DIR__ . '/../');
14+
}
15+
16+
if (!defined('PHPBB_FILES'))
17+
{
18+
define('PHPBB_FILES', STK_ROOT . 'phpBB/');
19+
}
20+
21+
if (!defined('IN_PHPBB'))
22+
{
23+
define('IN_PHPBB', true);
24+
}
25+
26+
// Version constants
27+
define('STK_VERSION', '2.0.0-dev');
28+
define('STK_QA', true);
29+
30+
// Enforce the usage of the SID
31+
define('NEED_SID', true);
32+
33+
// Tool options
34+
define('TOOL_OVERVIEW_TRIGGER', 1);

0 commit comments

Comments
 (0)