5. The XML Configuration File
这
<phpunit>
Element
这
backupGlobals
Attribute
Possible values:
true
或者
false
(default:
false
)
PHPUnit can optionally backup all global and super-global variables before each test and restore this backup after each test.
This attribute configures this operation for all tests. This configuration can be overridden using the
@backupGlobals
annotation on the test case class and test method level.
这
backupStaticProperties
Attribute
Possible values:
true
或者
false
(default:
false
)
PHPUnit can optionally backup all static properties in all declared classes before each test and restore this backup after each test.
This attribute configures this operation for all tests. This configuration can be overridden using the
BackupStaticProperties
attribute on the test case class and test method level.
这
bootstrap
Attribute
This attribute configures the bootstrap script that is loaded before the tests are executed. This script usually only registers the autoloader callback that is used to load the code under test.
这
cacheDirectory
Attribute
This attribute configures the directory in which PHPUnit caches information such as test results (see below) or the result of static code analysis that is performed for code coverage reporting.
这
cacheResult
Attribute
Possible values:
true
或者
false
(default:
true
)
This attribute configures the caching of test results. This caching is required for ordering tests by defects or duration with the
executionOrder
attribute (see
The executionOrder Attribute
)。
这
colors
Attribute
Possible values:
true
或者
false
(default:
false
)
This attribute configures whether colors are used in PHPUnit’s output.
Setting this attribute to
true
is equivalent to using the
--colors=auto
CLI option.
Setting this attribute to
false
is equivalent to using the
--colors=never
CLI option.
这
columns
Attribute
Possible values: integer or string
max
(default:
80
)
This attribute configures the number of columns to use for progress output.
如果
max
is defined as value, the number of columns will be maximum of the current terminal.
这
controlGarbageCollector
Attribute
Possible values:
true
或者
false
(default:
false
)
When the PHP runtime automatically performs garbage collection then this may happen in the middle of the preparation (fixture setup) of a test or in the middle of the execution of a test. This can have a negative impact on test execution performance.
Configuring
controlGarbageCollector="true"
has the following effects:
Deactivate automatic garbage collection using
gc_disable()before the first test is runTrigger garbage collection using
gc_collect_cycles()before the first test is runTrigger garbage collection using
gc_collect_cycles()after each n-th testTrigger garbage collection after using
gc_collect_cycles()after the last test was runActivate automatic garbage collection using
gc_enable()after the last test was run
The number of tests to execute before garbage collection is triggered is controlled by
numberOfTestsBeforeGarbageCollection
(see below).
这
numberOfTestsBeforeGarbageCollection
Attribute
Possible values: integer (default:
100
)
Configures the number of tests to execute before garbage collection is triggered (see above).
这
requireCoverageMetadata
Attribute
Possible values:
true
或者
false
(default:
false
)
This attribute configures whether a test will be marked as risky (see Unintentionally Covered Code ) when it does not indicate the code it intends to cover using an attribute in code or an annotation in a code comment.
这
processIsolation
Attribute
Possible values:
true
或者
false
(default:
false
)
This attribute configures whether each test should be run in a separate PHP process for increased isolation.
这
stopOnDefect
Attribute
Possible values:
true
或者
false
(default:
false
)
This attribute configures whether the test suite execution should be stopped after the first error, failure, warning, or risky test.
这
stopOnError
Attribute
Possible values:
true
或者
false
(default:
false
)
This attribute configures whether the test suite execution should be stopped after the first error.
这
stopOnFailure
Attribute
Possible values:
true
或者
false
(default:
false
)
This attribute configures whether the test suite execution should be stopped after the first failure.
这
stopOnWarning
Attribute
Possible values:
true
或者
false
(default:
false
)
This attribute configures whether the test suite execution should be stopped after the first test warning.
这
stopOnRisky
Attribute
Possible values:
true
或者
false
(default:
false
)
This attribute configures whether the test suite execution should be stopped after the first risky test.
这
stopOnDeprecation
Attribute
Possible values:
true
或者
false
(default:
false
)
This attribute configures whether the test suite execution should be stopped after first test
that triggered a deprecation (
E_DEPRECATED
,
E_USER_DEPRECATED
, or PHPUnit deprecation).
这
stopOnNotice
Attribute
Possible values:
true
或者
false
(default:
false
)
This attribute configures whether the test suite execution should be stopped after first test
that triggered a notice (
E_STRICT
,
E_NOTICE
, 或者
E_USER_NOTICE
)。
这
stopOnSkipped
Attribute
Possible values:
true
或者
false
(default:
false
)
This attribute configures whether the test suite execution should be stopped after first skipped test.
这
stopOnIncomplete
Attribute
Possible values:
true
或者
false
(default:
false
)
This attribute configures whether the test suite execution should be stopped after first incomplete test.
这
failOnEmptyTestSuite
Attribute
Possible values:
true
或者
false
(default:
false
)
This attribute configures whether the PHPUnit test runner should exit with a shell exit code that indicates failure when the configured test suite is empty.
这
failOnWarning
Attribute
Possible values:
true
或者
false
(default:
false
)
This attribute configures whether the PHPUnit test runner should exit with a shell exit code that indicates failure when all tests are successful but there are tests that had warnings.
这
failOnRisky
Attribute
Possible values:
true
或者
false
(default:
false
)
This attribute configures whether the PHPUnit test runner should exit with a shell exit code that indicates failure when all tests are successful but there are tests that were marked as risky.
这
failOnDeprecation
Attribute
Possible values:
true
或者
false
(default:
false
)
This attribute configures whether the PHPUnit test runner should exit with a shell exit code that indicates failure when all tests are successful but there are tests that triggered a deprecation (
E_DEPRECATED
,
E_USER_DEPRECATED
, or PHPUnit deprecation).
这
failOnNotice
Attribute
Possible values:
true
或者
false
(default:
false
)
This attribute configures whether the PHPUnit test runner should exit with a shell exit code that indicates failure when all tests are successful but there are tests that triggered a notice (
E_STRICT
,
E_NOTICE
, 或者
E_USER_NOTICE
)。
这
failOnSkipped
Attribute
Possible values:
true
或者
false
(default:
false
)
This attribute configures whether the PHPUnit test runner should exit with a shell exit code that indicates failure when all tests are successful but there are tests that were marked as skipped.
这
failOnIncomplete
Attribute
Possible values:
true
或者
false
(default:
false
)
This attribute configures whether the PHPUnit test runner should exit with a shell exit code that indicates failure when all tests are successful but there are tests that were marked as incomplete.
这
beStrictAboutChangesToGlobalState
Attribute
Possible values:
true
或者
false
(default:
false
)
This attribute configures whether PHPUnit should mark a test as risky when global state is manipulated by the code under test (or the test code).
这
beStrictAboutOutputDuringTests
Attribute
Possible values:
true
或者
false
(default:
false
)
This attribute configures whether PHPUnit should mark a test as risky when the code under test (or the test code) prints output.
这
beStrictAboutTestsThatDoNotTestAnything
Attribute
Possible values:
true
或者
false
(default:
true
)
This attribute configures whether PHPUnit should mark a test as risky when no assertions are performed (expectations are also considered).
这
beStrictAboutCoverageMetadata
Attribute
Possible values:
true
或者
false
(default:
false
)
This attribute configures whether PHPUnit should mark a test as risky when it executes code that is not specified to be covered or used using an attribute in code or an annotation in a code comment.
这
enforceTimeLimit
Attribute
Possible values:
true
或者
false
(default:
false
)
This attribute configures whether time limits should be enforced.
这
defaultTimeLimit
Attribute
Possible values: integer (default:
0
)
This attribute configures the default time limit (in seconds).
这
timeoutForSmallTests
Attribute
Possible values: integer (default:
1
)
This attribute configures the time limit for tests annotated with
@small
(in seconds).
这
timeoutForMediumTests
Attribute
Possible values: integer (default:
10
)
This attribute configures the time limit for tests annotated with
@medium
(in seconds).
这
timeoutForLargeTests
Attribute
Possible values: integer (default:
60
)
This attribute configures the time limit for tests annotated with
@large
(in seconds).
这
defaultTestSuite
Attribute
This attribute configures the name of the default test suite.
这
stderr
Attribute
Possible values:
true
或者
false
(default:
false
)
This attribute configures whether PHPUnit should print its output to
stderr
代替
stdout
。
这
reverseDefectList
Attribute
Possible values:
true
或者
false
(default:
false
)
This attribute configures whether tests that are not successful should be printed in reverse order.
这
registerMockObjectsFromTestArgumentsRecursively
Attribute
Possible values:
true
或者
false
(default:
false
)
This attribute configures whether arrays and object graphs that are passed from one test to another using the
@depends
annotation should be recursively scanned for mock objects.
这
extensionsDirectory
Attribute
什么时候
phpunit.phar
is used then this attribute may be used to configure a directory from which all
*.phar
files will be loaded as extensions for the PHPUnit test runner.
这
executionOrder
Attribute
Possible values:
default
,
defects
,
depends
,
no-depends
,
duration
,
random
,
reverse
,
size
(default:
default
)
Using multiple values is possible. These need to be separated by
,
。
This attribute configures the order in which tests are executed.
default: ordered as PHPUnit found the testsdefects: ordered by defect (errored, failed, warning, incomplete, risky, skipped, unknown, passed), requires enabled result cachedepends: ordered by dependency (tests without dependencies first, dependent tests last)depends,defects: ordered by dependency first, then ordered by defectsdepends,duration: ordered by dependency first, then ordered by durationdepends,random: ordered by dependency first, then ordered randomlydepends,reverse: ordered by dependency first, then ordered in reverseduration: ordered by duration (fastest test first, slowest test last), requires enabled result cacheno-depends: not ordered by dependencyno-depends,defects: not ordered by dependency, then ordered by defectsno-depends,duration: not ordered by dependency, then ordered by durationno-depends,random: not ordered by dependency, then ordered randomlyno-depends,reverse: not ordered by dependency, then ordered in reverseno-depends,size: not ordered by dependency, then ordered by sizerandom: ordered randomlyreverse: ordered as PHPUnit found the tests, then ordered in reversesize: ordered by size (small, medium, large, unknown), also see (see @small , @medium , 和 @large )
这
resolveDependencies
Attribute
Possible values:
true
或者
false
(default:
true
)
This attribute configures whether dependencies between tests (expressed using the
@depends
annotation) should be resolved.
这
testdox
Attribute
Possible values:
true
或者
false
(default:
false
)
This attribute configures whether the output should be printed in TestDox format.
这
displayDetailsOnIncompleteTests
Attribute
Possible values:
true
或者
false
(default:
false
)
This attribute configures whether details on incomplete tests should be printed.
这
displayDetailsOnSkippedTests
Attribute
Possible values:
true
或者
false
(default:
false
)
This attribute configures whether details on skipped tests should be printed.
这
displayDetailsOnTestsThatTriggerDeprecations
Attribute
Possible values:
true
或者
false
(default:
false
)
This attribute configures whether details on tests that triggered deprecations should be printed.
这
displayDetailsOnTestsThatTriggerErrors
Attribute
Possible values:
true
或者
false
(default:
false
)
This attribute configures whether details on tests that triggered errors should be printed.
这
displayDetailsOnTestsThatTriggerNotices
Attribute
Possible values:
true
或者
false
(default:
false
)
This attribute configures whether details on tests that triggered notices should be printed.
这
displayDetailsOnTestsThatTriggerWarnings
Attribute
Possible values:
true
或者
false
(default:
false
)
This attribute configures whether details on tests that triggered warnings should be printed.
这
<testsuites>
Element
Parent element:
<phpunit>
This element is the root for one or more
<testsuite>
elements that are used to configure the tests that are to be executed.
这
<testsuite>
Element
Parent element:
<testsuites>
A
<testsuite>
element must have a
name
attribute and may have one or more
<directory>
and/or
<file>
child elements that configure directories and/or files, respectively, that should be searched for tests.
<testsuites>
<testsuite name="unit">
<directory>tests/unit</directory>
</testsuite>
<testsuite name="integration">
<directory>tests/integration</directory>
</testsuite>
<testsuite name="edge-to-edge">
<directory>tests/edge-to-edge</directory>
</testsuite>
</testsuites>
使用
phpVersion
和
phpVersionOperator
attributes, a required PHP version can be specified:
<testsuites>
<testsuite name="unit">
<directory phpVersion="8.0.0" phpVersionOperator=">=">tests/unit</directory>
</testsuite>
</testsuites>
In the example above, the tests from the
tests/unit
directory are only added to the test suite if the PHP version is at least 8.0.0. The
phpVersionOperator
attribute is optional and defaults to
>=
。
这
<source>
Element
Parent element:
<phpunit>
Configures the project’s source code files. This is used to restrict code coverage analysis and reporting of deprecations, notices, and warnings to your own code, for instance, while excluding code from third-party dependencies.
这
<include>
Element
Parent element:
<source>
Configures a set of files to be included in the list of the project’s source code files.
<include>
<directory suffix=".php">src</directory>
</include>
The example shown above instructs PHPUnit to include all source code files with
.php
suffix in the
src
directory and its sub-directories.
这
<exclude>
Element
Parent element:
<source>
Configures a set of files to be excluded from the list of the project’s source code files.
<include>
<directory suffix=".php">src</directory>
</include>
<exclude>
<directory suffix=".php">src/generated</directory>
<file>src/autoload.php</file>
</exclude>
The example shown above instructs PHPUnit to include all source code files with
.php
suffix in the
src
directory and its sub-directories, but to exclude all files with
.php
suffix in the
src/generated
directory and its sub-directories as well as the
src/autoload.php
文件。
这
<directory>
Element
Parent elements:
<include>
,
<exclude>
Configures a directory and its sub-directories for inclusion in or exclusion from the list of the project’s source code files.
这
prefix
Attribute
Possible values: string
Configures a prefix-based filter that is applied to the names of files in the directory and its sub-directories.
这
suffix
Attribute
Possible values: string (default:
'.php'
)
Configures a suffix-based filter that is applied to the names of files in the directory and its sub-directories.
这
<file>
Element
Parent elements:
<include>
,
<exclude>
Configures a file for inclusion in or exclusion from the list of the project’s source code files.
这
<restrictDeprecations>
Attribute
Possible values:
true
或者
false
(default:
false
)
Restricts the reporting of
E_DEPRECATED
和
E_USER_DEPRECATED
errors
到
list of the project’s source code files.
这
<restrictNotices>
Attribute
Possible values:
true
或者
false
(default:
false
)
Restricts the reporting of
E_STRICT
,
E_NOTICE
, 和
E_USER_NOTICE
errors
到
list of the project’s source code files.
这
<restrictWarnings>
Attribute
Possible values:
true
或者
false
(default:
false
)
Restricts the reporting of
E_WARNING
和
E_USER_WARNING
errors
到
list of the project’s source code files.
这
<baseline>
Attribute
Possible values: string
The baseline file to be used when running the test suite.
这
<ignoreSuppressionOfDeprecations>
Attribute
Possible values:
true
或者
false
(default:
false
)
Ignore the suppression (using the
@
operator) of
E_USER_DEPRECATED
errors
。
这
<ignoreSuppressionOfPhpDeprecations>
Attribute
Possible values:
true
或者
false
(default:
false
)
Ignore the suppression (using the
@
operator) of
E_DEPRECATED
errors
。
这
<ignoreSuppressionOfErrors>
Attribute
Possible values:
true
或者
false
(default:
false
)
Ignore the suppression (using the
@
operator) of
E_USER_ERROR
errors
。
这
<ignoreSuppressionOfNotices>
Attribute
Possible values:
true
或者
false
(default:
false
)
Ignore the suppression (using the
@
operator) of
E_USER_NOTICE
errors
。
这
<ignoreSuppressionOfPhpNotices>
Attribute
Possible values:
true
或者
false
(default:
false
)
Ignore the suppression (using the
@
operator) of
E_STRICT
和
E_NOTICE
errors
。
这
<ignoreSuppressionOfWarnings>
Attribute
Possible values:
true
或者
false
(default:
false
)
Ignore the suppression (using the
@
operator) of
E_USER_WARNING
errors
。
这
<ignoreSuppressionOfPhpWarnings>
Attribute
Possible values:
true
或者
false
(default:
false
)
Ignore the suppression (using the
@
operator) of
E_WARNING
errors
。
这
<coverage>
Element
Parent element:
<phpunit>
这
<coverage>
element and its children can be used to configure code coverage:
<coverage includeUncoveredFiles="true"
pathCoverage="false"
ignoreDeprecatedCodeUnits="true"
disableCodeCoverageIgnore="true">
<!-- ... -->
</coverage>
这
includeUncoveredFiles
Attribute
Possible values:
true
或者
false
(default:
true
)
When set to
true
, all source code files that are configured to be considered for code coverage analysis will be included in the code coverage report(s). This includes source code files that are not executed while the tests are running.
这
ignoreDeprecatedCodeUnits
Attribute
Possible values:
true
或者
false
(default:
false
)
This attribute configures whether code units annotated with
@deprecated
should be ignored from code coverage.
这
pathCoverage
Attribute
Possible values:
true
或者
false
(default:
false
)
When set to
false
, only line coverage data will be collected, processed, and reported.
When set to
true
, line coverage, branch coverage, and path coverage data will be collected, processed, and reported. This requires a code coverage driver that supports path coverage. Path Coverage is currently only implemented by Xdebug.
这
disableCodeCoverageIgnore
Attribute
Possible values:
true
或者
false
(default:
false
)
This attribute configures whether metadata to ignore code should be ignored.
这
<report>
Element
Parent element:
<coverage>
Configures the code coverage reports to be generated.
<report>
<clover outputFile="clover.xml"/>
<cobertura outputFile="cobertura.xml"/>
<crap4j outputFile="crap4j.xml" threshold="50"/>
<html outputDirectory="html-coverage" lowUpperBound="50" highLowerBound="90"/>
<php outputFile="coverage.php"/>
<text outputFile="coverage.txt" showUncoveredFiles="false" showOnlySummary="true"/>
<xml outputDirectory="xml-coverage"/>
</report>
这
<clover>
Element
Parent element:
<report>
Configures a code coverage report in Clover XML format.
这
outputFile
Attribute
Possible values: string
The file to which the Clover XML report is written.
这
<cobertura>
Element
Parent element:
<report>
Configures a code coverage report in Cobertura XML format.
这
outputFile
Attribute
Possible values: string
The file to which the Cobertura XML report is written.
这
<crap4j>
Element
Parent element:
<report>
Configures a code coverage report in Crap4J XML format.
这
outputFile
Attribute
Possible values: string
The file to which the Crap4J XML report is written.
这
threshold
Attribute
Possible values: integer (default:
50
)
这
<html>
Element
Parent element:
<report>
Configures a code coverage report in HTML format.
这
outputDirectory
Attribute
The directory to which the HTML report is written.
这
lowUpperBound
Attribute
Possible values: integer (default:
50
)
The upper bound of what should be considered “low coverage”.
这
highLowerBound
Attribute
Possible values: integer (default:
90
)
The lower bound of what should be considered “high coverage”.
这
colorSuccessHigh
Attribute
Possible values: string (default:
#99cb84
)
The color used to indicate that a line of code is covered by small (and larger) tests, for instance.
这
colorSuccessMedium
Attribute
Possible values: string (default:
#c3e3b5
)
The color used to indicate that a line of code is covered by medium (and large) tests, for instance.
这
colorSuccessLow
Attribute
Possible values: string (default:
#dff0d8
)
The color used to indicate that a line of code is covered by large tests, for instance.
这
colorWarning
Attribute
Possible values: string (default:
#fcf8e3
)
The color used to indicate that a line of code cannot be covered, for instance.
这
colorDanger
Attribute
Possible values: string (default:
#f2dede
)
The color used to indicate that a line of code can be covered but is not covered, for instance.
这
customCssFile
Attribute
Possible values: string
The path to a custom CSS file.
这
<php>
Element
Parent element:
<report>
Configures a code coverage report in PHP format.
这
outputFile
Attribute
Possible values: string
The file to which the PHP report is written.
这
<text>
Element
Parent element:
<report>
Configures a code coverage report in text format.
这
outputFile
Attribute
Possible values: string
The file to which the text report is written.
这
showUncoveredFiles
Attribute
Possible values:
true
或者
false
(default:
false
)
这
showOnlySummary
Attribute
Possible values:
true
或者
false
(default:
false
)
这
<xml>
Element
Parent element:
<report>
Configures a code coverage report in PHPUnit XML format.
这
outputDirectory
Attribute
Possible values: string
The directory to which the PHPUnit XML report is written.
这
<logging>
Element
Parent element:
<phpunit>
这
<logging>
element and its children can be used to configure the logging of the test execution.
<logging>
<junit outputFile="junit.xml"/>
<teamcity outputFile="teamcity.txt"/>
<testdoxHtml outputFile="testdox.html"/>
<testdoxText outputFile="testdox.txt"/>
</logging>
这
<junit>
Element
Parent element:
<logging>
Configures a test result logfile in JUnit XML format.
这
outputFile
Attribute
Possible values: string
The file to which the test result logfile in JUnit XML format is written.
这
<teamcity>
Element
Parent element:
<logging>
Configures a test result logfile in TeamCity format.
这
outputFile
Attribute
Possible values: string
The file to which the test result logfile in TeamCity format is written.
这
<testdoxHtml>
Element
Parent element:
<logging>
Configures a test result logfile in TestDox HTML format.
这
outputFile
Attribute
Possible values: string
The file to which the test result logfile in TestDox HTML format is written.
这
<testdoxText>
Element
Parent element:
<logging>
Configures a test result logfile in TestDox text format.
这
outputFile
Attribute
Possible values: string
The file to which the test result logfile in TestDox text format is written.
这
<groups>
Element
Parent element:
<phpunit>
这
<groups>
element and its
<include>
,
<exclude>
, 和
<group>
children can be used to select groups of tests marked with the
@group
annotation (documented in
@group
) that should (not) be run:
<groups>
<include>
<group>name</group>
</include>
<exclude>
<group>name</group>
</exclude>
</groups>
The example shown above is equivalent to invoking the PHPUnit test runner with
--group name --exclude-group name
。
这
<extensions>
Element
Parent element:
<phpunit>
这
<extensions>
element and its
<bootstrap>
children can be used to register test runner extensions.
这
<bootstrap>
Element
Parent element:
<extensions>
<extensions>
<bootstrap class="Vendor\ExampleExtensionForPhpunit\Extension"/>
</extensions>
这
<parameter>
Element
Parent element:
<bootstrap>
这
<parameter>
element can be used to configure parameters that are passed
to the extension for bootstrapping.
<extensions>
<bootstrap class="Vendor\ExampleExtensionForPhpunit\Extension">
<parameter name="message" value="the-message"/>
</bootstrap>
</extensions>
这
<php>
Element
Parent element:
<phpunit>
这
<php>
element and its children can be used to configure PHP settings, constants, and global variables. It can also be used to prepend the
include_path
。
这
<includePath>
Element
Parent element:
<php>
This element can be used to prepend a path to the
include_path
。
这
<ini>
Element
Parent element:
<php>
This element can be used to set a PHP configuration setting.
<php>
<ini name="foo" value="bar"/>
</php>
The XML configuration above corresponds to the following PHP code:
ini_set('foo', 'bar');
这
<const>
Element
Parent element:
<php>
This element can be used to set a global constant.
<php>
<const name="foo" value="bar"/>
</php>
The XML configuration above corresponds to the following PHP code:
define('foo', 'bar');
这
<var>
Element
Parent element:
<php>
This element can be used to set a global variable.
<php>
<var name="foo" value="bar"/>
</php>
The XML configuration above corresponds to the following PHP code:
$GLOBALS['foo'] = 'bar';
这
<env>
Element
Parent element:
<php>
This element can be used to set a value in the super-global array
$_ENV
。
<php>
<env name="foo" value="bar"/>
</php>
The XML configuration above corresponds to the following PHP code:
$_ENV['foo'] = 'bar';
By default, environment variables are not overwritten if they exist already.
To force overwriting existing variables, use the
force
attribute:
<php>
<env name="foo" value="bar" force="true"/>
</php>
这
<get>
Element
Parent element:
<php>
This element can be used to set a value in the super-global array
$_GET
。
<php>
<get name="foo" value="bar"/>
</php>
The XML configuration above corresponds to the following PHP code:
$_GET['foo'] = 'bar';
这
<post>
Element
Parent element:
<php>
This element can be used to set a value in the super-global array
$_POST
。
<php>
<post name="foo" value="bar"/>
</php>
The XML configuration above corresponds to the following PHP code:
$_POST['foo'] = 'bar';
这
<server>
Element
Parent element:
<php>
This element can be used to set a value in the super-global array
$_SERVER
。
<php>
<server name="foo" value="bar"/>
</php>
The XML configuration above corresponds to the following PHP code:
$_SERVER['foo'] = 'bar';
这
<files>
Element
Parent element:
<php>
This element can be used to set a value in the super-global array
$_FILES
。
<php>
<files name="foo" value="bar"/>
</php>
The XML configuration above corresponds to the following PHP code:
$_FILES['foo'] = 'bar';
这
<request>
Element
Parent element:
<php>
This element can be used to set a value in the super-global array
$_REQUEST
。
<php>
<request name="foo" value="bar"/>
</php>
The XML configuration above corresponds to the following PHP code:
$_REQUEST['foo'] = 'bar';