mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-12 20:56:40 +02:00
[ticket/12620] Use PHPBB_ENVIRONMENT
PHPBB3-12620
This commit is contained in:
@ -29,9 +29,9 @@ $phpbb_class_loader->register();
|
|||||||
$phpbb_config_php_file = new \phpbb\config_php_file($phpbb_root_path, $phpEx);
|
$phpbb_config_php_file = new \phpbb\config_php_file($phpbb_root_path, $phpEx);
|
||||||
extract($phpbb_config_php_file->get_all());
|
extract($phpbb_config_php_file->get_all());
|
||||||
|
|
||||||
if (!defined('ENVIRONMENT'))
|
if (!defined('PHPBB_ENVIRONMENT'))
|
||||||
{
|
{
|
||||||
@define('ENVIRONMENT', 'production');
|
@define('PHPBB_ENVIRONMENT', 'production');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!defined('PHPBB_INSTALLED'))
|
if (!defined('PHPBB_INSTALLED'))
|
||||||
@ -96,7 +96,7 @@ set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handle
|
|||||||
$phpbb_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/", $phpEx);
|
$phpbb_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/", $phpEx);
|
||||||
$phpbb_class_loader_ext->register();
|
$phpbb_class_loader_ext->register();
|
||||||
|
|
||||||
if (ENVIRONMENT == 'debug' && !class_exists('Goutte\Client', true))
|
if (PHPBB_ENVIRONMENT == 'debug' && !class_exists('Goutte\Client', true))
|
||||||
{
|
{
|
||||||
trigger_error(
|
trigger_error(
|
||||||
'Composer development dependencies have not been set up for the development environment yet, run ' .
|
'Composer development dependencies have not been set up for the development environment yet, run ' .
|
||||||
@ -115,7 +115,7 @@ try
|
|||||||
catch (InvalidArgumentException $e)
|
catch (InvalidArgumentException $e)
|
||||||
{
|
{
|
||||||
trigger_error(
|
trigger_error(
|
||||||
'The requested environment ' . ENVIRONMENT . ' is not available.',
|
'The requested environment ' . PHPBB_ENVIRONMENT . ' is not available.',
|
||||||
E_USER_ERROR
|
E_USER_ERROR
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -453,11 +453,11 @@ function phpbb_create_config_file_data($data, $dbms, $debug = false, $debug_cont
|
|||||||
|
|
||||||
if ($debug)
|
if ($debug)
|
||||||
{
|
{
|
||||||
$config_data .= "@define('ENVIRONMENT', 'development');\n";
|
$config_data .= "@define('PHPBB_ENVIRONMENT', 'development');\n";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$config_data .= "@define('ENVIRONMENT', 'production');\n";
|
$config_data .= "@define('PHPBB_ENVIRONMENT', 'production');\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($debug_container)
|
if ($debug_container)
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
define('IN_PHPBB', true);
|
define('IN_PHPBB', true);
|
||||||
define('IN_INSTALL', true);
|
define('IN_INSTALL', true);
|
||||||
define('ENVIRONMENT', 'production');
|
define('PHPBB_ENVIRONMENT', 'production');
|
||||||
/**#@-*/
|
/**#@-*/
|
||||||
|
|
||||||
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../';
|
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../';
|
||||||
|
@ -50,7 +50,7 @@ class core extends Extension
|
|||||||
public function load(array $config, ContainerBuilder $container)
|
public function load(array $config, ContainerBuilder $container)
|
||||||
{
|
{
|
||||||
$loader = new YamlFileLoader($container, new FileLocator(phpbb_realpath($this->config_path)));
|
$loader = new YamlFileLoader($container, new FileLocator(phpbb_realpath($this->config_path)));
|
||||||
$loader->load(ENVIRONMENT . '/environment.yml');
|
$loader->load(PHPBB_ENVIRONMENT . '/environment.yml');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
define('ENVIRONMENT', 'production');
|
define('PHPBB_ENVIRONMENT', 'production');
|
||||||
|
|
||||||
require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
|
require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user