Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 148 Revision 991
Zeile 7... Zeile 7...
7
 * For the full copyright and license information, please view the LICENSE
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
8
 * file that was distributed with this source code.
9
 */
9
 */
10
namespace PHPUnit\Util;
10
namespace PHPUnit\Util;
Zeile -... Zeile 11...
-
 
11
 
-
 
12
use const PHP_MAJOR_VERSION;
11
 
13
use const PHP_MINOR_VERSION;
12
use function array_keys;
14
use function array_keys;
13
use function array_reverse;
15
use function array_reverse;
14
use function array_shift;
16
use function array_shift;
15
use function defined;
17
use function defined;
Zeile 46... Zeile 48...
46
        '_FILES',
48
        '_FILES',
47
        '_REQUEST',
49
        '_REQUEST',
48
    ];
50
    ];
Zeile 49... Zeile 51...
49
 
51
 
-
 
52
    /**
-
 
53
     * @psalm-var array<string, array<string, true>>
-
 
54
     */
-
 
55
    private const DEPRECATED_INI_SETTINGS = [
-
 
56
        '7.3' => [
-
 
57
            'iconv.input_encoding'       => true,
-
 
58
            'iconv.output_encoding'      => true,
-
 
59
            'iconv.internal_encoding'    => true,
-
 
60
            'mbstring.func_overload'     => true,
-
 
61
            'mbstring.http_input'        => true,
-
 
62
            'mbstring.http_output'       => true,
-
 
63
            'mbstring.internal_encoding' => true,
-
 
64
            'string.strip_tags'          => true,
-
 
65
        ],
-
 
66
 
-
 
67
        '7.4' => [
-
 
68
            'iconv.input_encoding'       => true,
-
 
69
            'iconv.output_encoding'      => true,
-
 
70
            'iconv.internal_encoding'    => true,
-
 
71
            'mbstring.func_overload'     => true,
-
 
72
            'mbstring.http_input'        => true,
-
 
73
            'mbstring.http_output'       => true,
-
 
74
            'mbstring.internal_encoding' => true,
-
 
75
            'pdo_odbc.db2_instance_name' => true,
-
 
76
            'string.strip_tags'          => true,
-
 
77
        ],
-
 
78
 
-
 
79
        '8.0' => [
-
 
80
            'iconv.input_encoding'       => true,
-
 
81
            'iconv.output_encoding'      => true,
-
 
82
            'iconv.internal_encoding'    => true,
-
 
83
            'mbstring.http_input'        => true,
-
 
84
            'mbstring.http_output'       => true,
-
 
85
            'mbstring.internal_encoding' => true,
-
 
86
        ],
-
 
87
 
-
 
88
        '8.1' => [
-
 
89
            'auto_detect_line_endings'     => true,
-
 
90
            'filter.default'               => true,
-
 
91
            'iconv.input_encoding'         => true,
-
 
92
            'iconv.output_encoding'        => true,
-
 
93
            'iconv.internal_encoding'      => true,
-
 
94
            'mbstring.http_input'          => true,
-
 
95
            'mbstring.http_output'         => true,
-
 
96
            'mbstring.internal_encoding'   => true,
-
 
97
            'oci8.old_oci_close_semantics' => true,
-
 
98
        ],
-
 
99
 
-
 
100
        '8.2' => [
-
 
101
            'auto_detect_line_endings'     => true,
-
 
102
            'filter.default'               => true,
-
 
103
            'iconv.input_encoding'         => true,
-
 
104
            'iconv.output_encoding'        => true,
-
 
105
            'iconv.internal_encoding'      => true,
-
 
106
            'mbstring.http_input'          => true,
-
 
107
            'mbstring.http_output'         => true,
-
 
108
            'mbstring.internal_encoding'   => true,
-
 
109
            'oci8.old_oci_close_semantics' => true,
-
 
110
        ],
-
 
111
 
-
 
112
        '8.3' => [
-
 
113
            'auto_detect_line_endings'     => true,
-
 
114
            'filter.default'               => true,
-
 
115
            'iconv.input_encoding'         => true,
-
 
116
            'iconv.output_encoding'        => true,
-
 
117
            'iconv.internal_encoding'      => true,
-
 
118
            'mbstring.http_input'          => true,
-
 
119
            'mbstring.http_output'         => true,
-
 
120
            'mbstring.internal_encoding'   => true,
-
 
121
            'oci8.old_oci_close_semantics' => true,
-
 
122
        ],
-
 
123
    ];
-
 
124
 
50
    /**
125
    /**
51
     * @throws Exception
126
     * @throws Exception
52
     */
127
     */
53
    public static function getIncludedFilesAsString(): string
128
    public static function getIncludedFilesAsString(): string
54
    {
129
    {
Zeile 104... Zeile 179...
104
    public static function getIniSettingsAsString(): string
179
    public static function getIniSettingsAsString(): string
105
    {
180
    {
106
        $result = '';
181
        $result = '';
Zeile 107... Zeile 182...
107
 
182
 
-
 
183
        foreach (ini_get_all(null, false) as $key => $value) {
-
 
184
            if (self::isIniSettingDeprecated($key)) {
-
 
185
                continue;
-
 
186
            }
108
        foreach (ini_get_all(null, false) as $key => $value) {
187
 
109
            $result .= sprintf(
188
            $result .= sprintf(
110
                '@ini_set(%s, %s);' . "\n",
189
                '@ini_set(%s, %s);' . "\n",
111
                self::exportVariable($key),
190
                self::exportVariable($key),
112
                self::exportVariable((string) $value)
191
                self::exportVariable((string) $value)
Zeile 198... Zeile 277...
198
            }
277
            }
199
        }
278
        }
Zeile 200... Zeile 279...
200
 
279
 
201
        return $result;
280
        return $result;
-
 
281
    }
-
 
282
 
-
 
283
    private static function isIniSettingDeprecated(string $iniSetting): bool
-
 
284
    {
-
 
285
        return isset(self::DEPRECATED_INI_SETTINGS[PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION][$iniSetting]);
202
    }
286
    }