Skip to content

Commit 7423af4

Browse files
committed
mongo removed xml php config
1 parent 55f53db commit 7423af4

File tree

10 files changed

+66
-49
lines changed

10 files changed

+66
-49
lines changed

tests/Fixtures/app/config/reference.php

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
11
<?php
22

3-
/*
4-
* This file is part of the API Platform project.
5-
*
6-
* (c) Kévin Dunglas <[email protected]>
7-
*
8-
* For the full copyright and license information, please view the LICENSE
9-
* file that was distributed with this source code.
10-
*/
11-
12-
declare(strict_types=1);
13-
143
// This file is auto-generated and is for apps only. Bundles SHOULD NOT rely on its content.
154

165
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
@@ -464,8 +453,8 @@
464453
* platform_service?: scalar|null, // Deprecated: The "platform_service" configuration key is deprecated since doctrine-bundle 2.9. DBAL 4 will not support setting a custom platform via connection params anymore.
465454
* auto_commit?: bool,
466455
* schema_filter?: scalar|null,
467-
* logging?: bool, // Default: true
468-
* profiling?: bool, // Default: true
456+
* logging?: bool, // Default: false
457+
* profiling?: bool, // Default: false
469458
* profiling_collect_backtrace?: bool, // Enables collecting backtraces when profiling is enabled // Default: false
470459
* profiling_collect_schema_errors?: bool, // Enables collecting schema errors when profiling is enabled // Default: true
471460
* disable_type_comments?: bool,
@@ -604,7 +593,7 @@
604593
* pool?: scalar|null,
605594
* },
606595
* region_lock_lifetime?: scalar|null, // Default: 60
607-
* log_enabled?: bool, // Default: true
596+
* log_enabled?: bool, // Default: false
608597
* region_lifetime?: scalar|null, // Default: 3600
609598
* enabled?: bool, // Default: true
610599
* factory?: scalar|null,
@@ -997,7 +986,7 @@
997986
* http_method_override?: bool, // Set true to enable support for the '_method' request parameter to determine the intended HTTP method on POST requests. // Default: false
998987
* allowed_http_method_override?: list<string>|null,
999988
* trust_x_sendfile_type_header?: scalar|null, // Set true to enable support for xsendfile in binary file responses. // Default: "%env(bool:default::SYMFONY_TRUST_X_SENDFILE_TYPE_HEADER)%"
1000-
* ide?: scalar|null, // Default: "%env(default::SYMFONY_IDE)%"
989+
* ide?: scalar|null, // Default: null
1001990
* test?: bool,
1002991
* default_locale?: scalar|null, // Default: "en"
1003992
* set_locale_from_accept_language?: bool, // Whether to use the Accept-Language HTTP header to set the Request locale (only when the "_locale" request attribute is not passed). // Default: false
@@ -1154,7 +1143,7 @@
11541143
* paths?: array<string, scalar|null>,
11551144
* excluded_patterns?: list<scalar|null>,
11561145
* exclude_dotfiles?: bool, // If true, any files starting with "." will be excluded from the asset mapper. // Default: true
1157-
* server?: bool, // If true, a "dev server" will return the assets from the public directory (true in "debug" mode only by default). // Default: true
1146+
* server?: bool, // If true, a "dev server" will return the assets from the public directory (true in "debug" mode only by default). // Default: false
11581147
* public_prefix?: scalar|null, // The public path where the assets will be written to (and served from when "server" is true). // Default: "/assets/"
11591148
* missing_import_mode?: "strict"|"warn"|"ignore", // Behavior if an asset cannot be found when imported from JavaScript or CSS files - e.g. "import './non-existent.js'". "strict" means an exception is thrown, "warn" means a warning is logged, "ignore" means the import is left as-is. // Default: "warn"
11601149
* extensions?: array<string, scalar|null>,
@@ -1274,7 +1263,7 @@
12741263
* },
12751264
* php_errors?: array{ // PHP errors handling configuration
12761265
* log?: mixed, // Use the application logger instead of the PHP logger for logging PHP errors. // Default: true
1277-
* throw?: bool, // Throw PHP errors as \ErrorException instances. // Default: true
1266+
* throw?: bool, // Throw PHP errors as \ErrorException instances. // Default: false
12781267
* },
12791268
* exceptions?: array<string, array{ // Default: []
12801269
* log_level?: scalar|null, // The level of log message. Null to let Symfony decide. // Default: null
@@ -1337,7 +1326,7 @@
13371326
* scheduler?: bool|array{ // Scheduler configuration
13381327
* enabled?: bool, // Default: false
13391328
* },
1340-
* disallow_search_engine_index?: bool, // Enabled by default when debug is enabled. // Default: true
1329+
* disallow_search_engine_index?: bool, // Enabled by default when debug is enabled. // Default: false
13411330
* http_client?: bool|array{ // HTTP Client configuration
13421331
* enabled?: bool, // Default: true
13431332
* max_host_connections?: int, // The maximum number of connections to a single host.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
_main:
2-
resource: routing_test.yml
2+
resource: routing_test.php
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
4+
use Symfony\Bundle\WebProfilerBundle\WebProfilerBundle;
5+
6+
return function (RoutingConfigurator $routes) {
7+
$routes->import('routing_common.yml');
8+
$routes->import('@TestBundle/Controller/MongoDbOdm', 'attribute');
9+
10+
if (class_exists(WebProfilerBundle::class)) {
11+
// 2. Resolve the actual directory of the bundle
12+
$reflection = new \ReflectionClass(WebProfilerBundle::class);
13+
$bundleDir = dirname($reflection->getFileName());
14+
15+
// 3. Check if the PHP config exists on the filesystem
16+
$usePhp = file_exists($bundleDir . '/Resources/config/routing/wdt.php');
17+
$ext = $usePhp ? 'php' : 'xml';
18+
19+
// 4. Import dynamically based on the extension found
20+
$routes->import("@WebProfilerBundle/Resources/config/routing/wdt.$ext")
21+
->prefix('/_wdt');
22+
23+
$routes->import("@WebProfilerBundle/Resources/config/routing/profiler.$ext")
24+
->prefix('/_profiler');
25+
}
26+
};
Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,2 @@
11
_main:
2-
resource: routing_common.yml
3-
4-
controller:
5-
resource: '@TestBundle/Controller/MongoDbOdm'
6-
type: attribute
7-
8-
web_profiler_wdt:
9-
resource: '@WebProfilerBundle/Resources/config/routing/wdt.php'
10-
prefix: /_wdt
11-
12-
web_profiler_profiler:
13-
resource: '@WebProfilerBundle/Resources/config/routing/profiler.php'
14-
prefix: /_profiler
2+
resource: routing_mongodb.php
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
_main:
2-
resource: routing_test.yml
2+
resource: routing_test.php
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
_main:
2-
resource: routing_test.yml
2+
resource: routing_test.php
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
_main:
2-
resource: routing_test.yml
2+
resource: routing_test.php
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
_main:
2-
resource: routing_test.yml
2+
resource: routing_test.php
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
4+
use Symfony\Bundle\WebProfilerBundle\WebProfilerBundle;
5+
6+
return function (RoutingConfigurator $routes) {
7+
$routes->import('routing_common.yml');
8+
$routes->import('@TestBundle/Controller/Orm', 'attribute');
9+
10+
if (class_exists(WebProfilerBundle::class)) {
11+
// 2. Resolve the actual directory of the bundle
12+
$reflection = new \ReflectionClass(WebProfilerBundle::class);
13+
$bundleDir = dirname($reflection->getFileName());
14+
15+
// 3. Check if the PHP config exists on the filesystem
16+
$usePhp = file_exists($bundleDir . '/Resources/config/routing/wdt.php');
17+
$ext = $usePhp ? 'php' : 'xml';
18+
19+
// 4. Import dynamically based on the extension found
20+
$routes->import("@WebProfilerBundle/Resources/config/routing/wdt.$ext")
21+
->prefix('/_wdt');
22+
23+
$routes->import("@WebProfilerBundle/Resources/config/routing/profiler.$ext")
24+
->prefix('/_profiler');
25+
}
26+
};
Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,2 @@
11
_main:
2-
resource: routing_common.yml
3-
4-
controller:
5-
resource: '@TestBundle/Controller/Orm'
6-
type: attribute
7-
8-
web_profiler_wdt:
9-
resource: '@WebProfilerBundle/Resources/config/routing/wdt.php'
10-
prefix: /_wdt
11-
12-
web_profiler_profiler:
13-
resource: '@WebProfilerBundle/Resources/config/routing/profiler.php'
14-
prefix: /_profiler
2+
resource: routing_test.php

0 commit comments

Comments
 (0)