aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2014-11-21 18:20:19 +0100
committerNils Adermann <naderman@naderman.de>2014-11-21 18:20:19 +0100
commit040d451dcca9ae54d8f4b7bdd2f231033765a8f2 (patch)
tree28ac46737634c2eae0a2228fcb9b66360dd5cc2e /phpBB/includes
parent6fa0ca1f96fa75624ab2b4fca8b390568440b3c1 (diff)
parent54d529994029564d5cecbec2aaac36a0544552a0 (diff)
downloadforums-040d451dcca9ae54d8f4b7bdd2f231033765a8f2.tar
forums-040d451dcca9ae54d8f4b7bdd2f231033765a8f2.tar.gz
forums-040d451dcca9ae54d8f4b7bdd2f231033765a8f2.tar.bz2
forums-040d451dcca9ae54d8f4b7bdd2f231033765a8f2.tar.xz
forums-040d451dcca9ae54d8f4b7bdd2f231033765a8f2.zip
Merge pull request #2883 from Nicofuma/ticket/12620
[ticket/12620] Allow the user to define multiples environments
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/functions_install.php11
-rw-r--r--phpBB/includes/functions_url_matcher.php112
2 files changed, 8 insertions, 115 deletions
diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php
index 28cc603bdb..a60ddd40c5 100644
--- a/phpBB/includes/functions_install.php
+++ b/phpBB/includes/functions_install.php
@@ -451,13 +451,17 @@ function phpbb_create_config_file_data($data, $dbms, $debug = false, $debug_cont
$config_data .= "\n@define('PHPBB_INSTALLED', true);\n";
$config_data .= "// @define('PHPBB_DISPLAY_LOAD_TIME', true);\n";
- if ($debug)
+ if ($debug_test)
+ {
+ $config_data .= "@define('PHPBB_ENVIRONMENT', 'test');\n";
+ }
+ else if ($debug)
{
- $config_data .= "@define('DEBUG', true);\n";
+ $config_data .= "@define('PHPBB_ENVIRONMENT', 'development');\n";
}
else
{
- $config_data .= "// @define('DEBUG', true);\n";
+ $config_data .= "@define('PHPBB_ENVIRONMENT', 'production');\n";
}
if ($debug_container)
@@ -472,6 +476,7 @@ function phpbb_create_config_file_data($data, $dbms, $debug = false, $debug_cont
if ($debug_test)
{
$config_data .= "@define('DEBUG_TEST', true);\n";
+ $config_data .= "@define('DEBUG', true);\n"; // Mandatory for the functional tests, will be removed by PHPBB3-12623
}
return $config_data;
diff --git a/phpBB/includes/functions_url_matcher.php b/phpBB/includes/functions_url_matcher.php
deleted file mode 100644
index b965046aad..0000000000
--- a/phpBB/includes/functions_url_matcher.php
+++ /dev/null
@@ -1,112 +0,0 @@
-<?php
-/**
-*
-* This file is part of the phpBB Forum Software package.
-*
-* @copyright (c) phpBB Limited <https://www.phpbb.com>
-* @license GNU General Public License, version 2 (GPL-2.0)
-*
-* For full copyright and license information, please see
-* the docs/CREDITS.txt file.
-*
-*/
-
-use Symfony\Component\Routing\Matcher\Dumper\PhpMatcherDumper;
-use Symfony\Component\Routing\Matcher\UrlMatcher;
-use Symfony\Component\Routing\RequestContext;
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
-* Create a new UrlMatcher class and dump it into the cache file
-*
-* @param \phpbb\extension\manager $manager Extension manager
-* @param RequestContext $context Symfony RequestContext object
-* @param string $root_path Root path
-* @param string $php_ext PHP file extension
-* @return null
-*/
-function phpbb_get_url_matcher(\phpbb\extension\manager $manager, RequestContext $context, $root_path, $php_ext)
-{
- if (defined('DEBUG'))
- {
- return phpbb_create_url_matcher($manager, $context, $root_path);
- }
-
- if (!phpbb_url_matcher_dumped($root_path, $php_ext))
- {
- phpbb_create_dumped_url_matcher($manager, $root_path, $php_ext);
- }
-
- return phpbb_load_url_matcher($context, $root_path, $php_ext);
-}
-
-/**
-* Create a new UrlMatcher class and dump it into the cache file
-*
-* @param \phpbb\extension\manager $manager Extension manager
-* @param string $root_path Root path
-* @param string $php_ext PHP file extension
-* @return null
-*/
-function phpbb_create_dumped_url_matcher(\phpbb\extension\manager $manager, $root_path, $php_ext)
-{
- $provider = new \phpbb\controller\provider();
- $provider->find_routing_files($manager->get_finder());
- $routes = $provider->find($root_path)->get_routes();
- $dumper = new PhpMatcherDumper($routes);
- $cached_url_matcher_dump = $dumper->dump(array(
- 'class' => 'phpbb_url_matcher',
- ));
-
- file_put_contents($root_path . 'cache/url_matcher.' . $php_ext, $cached_url_matcher_dump);
-}
-
-/**
-* Create a non-cached UrlMatcher
-*
-* @param \phpbb\extension\manager $manager Extension manager
-* @param RequestContext $context Symfony RequestContext object
-* @return UrlMatcher
-*/
-function phpbb_create_url_matcher(\phpbb\extension\manager $manager, RequestContext $context, $root_path)
-{
- $provider = new \phpbb\controller\provider();
- $provider->find_routing_files($manager->get_finder());
- $routes = $provider->find($root_path)->get_routes();
- return new UrlMatcher($routes, $context);
-}
-
-/**
-* Load the cached phpbb_url_matcher class
-*
-* @param RequestContext $context Symfony RequestContext object
-* @param string $root_path Root path
-* @param string $php_ext PHP file extension
-* @return phpbb_url_matcher
-*/
-function phpbb_load_url_matcher(RequestContext $context, $root_path, $php_ext)
-{
- require($root_path . 'cache/url_matcher.' . $php_ext);
- return new phpbb_url_matcher($context);
-}
-
-/**
-* Determine whether we have our dumped URL matcher
-*
-* The class is automatically dumped to the cache directory
-*
-* @param string $root_path Root path
-* @param string $php_ext PHP file extension
-* @return bool True if it exists, false if not
-*/
-function phpbb_url_matcher_dumped($root_path, $php_ext)
-{
- return file_exists($root_path . 'cache/url_matcher.' . $php_ext);
-}