@@ -1,30 +1,30 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Random_* Compatibility Library |
|
4 | - * for using the new PHP 7 random_* API in PHP 5 projects |
|
5 | - * |
|
6 | - * The MIT License (MIT) |
|
7 | - * |
|
8 | - * Copyright (c) 2015 Paragon Initiative Enterprises |
|
9 | - * |
|
10 | - * Permission is hereby granted, free of charge, to any person obtaining a copy |
|
11 | - * of this software and associated documentation files (the "Software"), to deal |
|
12 | - * in the Software without restriction, including without limitation the rights |
|
13 | - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
14 | - * copies of the Software, and to permit persons to whom the Software is |
|
15 | - * furnished to do so, subject to the following conditions: |
|
16 | - * |
|
17 | - * The above copyright notice and this permission notice shall be included in |
|
18 | - * all copies or substantial portions of the Software. |
|
19 | - * |
|
20 | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
21 | - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
22 | - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|
23 | - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
24 | - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|
25 | - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
|
26 | - * SOFTWARE. |
|
27 | - */ |
|
3 | + * Random_* Compatibility Library |
|
4 | + * for using the new PHP 7 random_* API in PHP 5 projects |
|
5 | + * |
|
6 | + * The MIT License (MIT) |
|
7 | + * |
|
8 | + * Copyright (c) 2015 Paragon Initiative Enterprises |
|
9 | + * |
|
10 | + * Permission is hereby granted, free of charge, to any person obtaining a copy |
|
11 | + * of this software and associated documentation files (the "Software"), to deal |
|
12 | + * in the Software without restriction, including without limitation the rights |
|
13 | + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
14 | + * copies of the Software, and to permit persons to whom the Software is |
|
15 | + * furnished to do so, subject to the following conditions: |
|
16 | + * |
|
17 | + * The above copyright notice and this permission notice shall be included in |
|
18 | + * all copies or substantial portions of the Software. |
|
19 | + * |
|
20 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
21 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
22 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|
23 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
24 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|
25 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
|
26 | + * SOFTWARE. |
|
27 | + */ |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * Since openssl_random_pseudo_bytes() uses openssl's |
@@ -37,9 +37,9 @@ discard block |
||
37 | 37 | define('RANDOM_COMPAT_READ_BUFFER', 8); |
38 | 38 | } |
39 | 39 | $RandomCompatDIR = dirname(__FILE__); |
40 | - require_once $RandomCompatDIR.'/byte_safe_strings.php'; |
|
41 | - require_once $RandomCompatDIR.'/cast_to_int.php'; |
|
42 | - require_once $RandomCompatDIR.'/error_polyfill.php'; |
|
40 | + require_once $RandomCompatDIR . '/byte_safe_strings.php'; |
|
41 | + require_once $RandomCompatDIR . '/cast_to_int.php'; |
|
42 | + require_once $RandomCompatDIR . '/error_polyfill.php'; |
|
43 | 43 | if (!function_exists('random_bytes')) { |
44 | 44 | /** |
45 | 45 | * PHP 5.2.0 - 5.6.x way to implement random_bytes() |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | */ |
59 | 59 | if (extension_loaded('libsodium')) { |
60 | 60 | // See random_bytes_libsodium.php |
61 | - require_once $RandomCompatDIR.'/random_bytes_libsodium.php'; |
|
61 | + require_once $RandomCompatDIR . '/random_bytes_libsodium.php'; |
|
62 | 62 | } |
63 | 63 | if ( |
64 | 64 | !function_exists('random_bytes') && |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | // that is not helpful to us here. |
76 | 76 | |
77 | 77 | // See random_bytes_dev_urandom.php |
78 | - require_once $RandomCompatDIR.'/random_bytes_dev_urandom.php'; |
|
78 | + require_once $RandomCompatDIR . '/random_bytes_dev_urandom.php'; |
|
79 | 79 | } |
80 | 80 | if ( |
81 | 81 | !function_exists('random_bytes') && |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | extension_loaded('mcrypt') |
84 | 84 | ) { |
85 | 85 | // See random_bytes_mcrypt.php |
86 | - require_once $RandomCompatDIR.'/random_bytes_mcrypt.php'; |
|
86 | + require_once $RandomCompatDIR . '/random_bytes_mcrypt.php'; |
|
87 | 87 | } |
88 | 88 | if ( |
89 | 89 | !function_exists('random_bytes') && |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | $RandomCompatCOMtest = new COM('CAPICOM.Utilities.1'); |
101 | 101 | if (method_exists($RandomCompatCOMtest, 'GetRandom')) { |
102 | 102 | // See random_bytes_com_dotnet.php |
103 | - require_once $RandomCompatDIR.'/random_bytes_com_dotnet.php'; |
|
103 | + require_once $RandomCompatDIR . '/random_bytes_com_dotnet.php'; |
|
104 | 104 | } |
105 | 105 | } catch (com_exception $e) { |
106 | 106 | // Don't try to use it. |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | ) |
124 | 124 | ) { |
125 | 125 | // See random_bytes_openssl.php |
126 | - require_once $RandomCompatDIR.'/random_bytes_openssl.php'; |
|
126 | + require_once $RandomCompatDIR . '/random_bytes_openssl.php'; |
|
127 | 127 | } |
128 | 128 | if (!function_exists('random_bytes')) { |
129 | 129 | /** |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | } |
140 | 140 | } |
141 | 141 | if (!function_exists('random_int')) { |
142 | - require_once $RandomCompatDIR.'/random_int.php'; |
|
142 | + require_once $RandomCompatDIR . '/random_int.php'; |
|
143 | 143 | } |
144 | 144 | $RandomCompatDIR = null; |
145 | 145 | } |