Completed
Push — master ( f078eb...6281cb )
by Scott
05:11
created
other/build_phar.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,24 +1,24 @@  discard block
 block discarded – undo
1 1
 <?php
2
-$dist = dirname(__DIR__).'/dist';
2
+$dist = dirname(__DIR__) . '/dist';
3 3
 if (!is_dir($dist)) {
4 4
     mkdir($dist, 0755);
5 5
 }
6
-if (file_exists($dist.'/random_compat.phar')) {
7
-    unlink($dist.'/random_compat.phar');
6
+if (file_exists($dist . '/random_compat.phar')) {
7
+    unlink($dist . '/random_compat.phar');
8 8
 }
9 9
 $phar = new Phar(
10
-    $dist.'/random_compat.phar',
10
+    $dist . '/random_compat.phar',
11 11
     FilesystemIterator::CURRENT_AS_FILEINFO | \FilesystemIterator::KEY_AS_FILENAME,
12 12
     'random_compat.phar'
13 13
 );
14 14
 rename(
15
-    dirname(__DIR__).'/lib/random.php', 
16
-    dirname(__DIR__).'/lib/index.php'
15
+    dirname(__DIR__) . '/lib/random.php', 
16
+    dirname(__DIR__) . '/lib/index.php'
17 17
 );
18
-$phar->buildFromDirectory(dirname(__DIR__).'/lib');
18
+$phar->buildFromDirectory(dirname(__DIR__) . '/lib');
19 19
 rename(
20
-    dirname(__DIR__).'/lib/index.php', 
21
-    dirname(__DIR__).'/lib/random.php'
20
+    dirname(__DIR__) . '/lib/index.php', 
21
+    dirname(__DIR__) . '/lib/random.php'
22 22
 );
23 23
 
24 24
 /**
@@ -43,10 +43,10 @@  discard block
 block discarded – undo
43 43
         /**
44 44
          * Save the corresponding public key to the file
45 45
          */
46
-        if (!@is_readable($dist.'/random_compat.phar.pubkey')) {
46
+        if (!@is_readable($dist . '/random_compat.phar.pubkey')) {
47 47
             $details = openssl_pkey_get_details($private);
48 48
             file_put_contents(
49
-                $dist.'/random_compat.phar.pubkey',
49
+                $dist . '/random_compat.phar.pubkey',
50 50
                 $details['key']
51 51
             );
52 52
         }
Please login to merge, or discard this patch.
lib/random.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -46,9 +46,9 @@  discard block
 block discarded – undo
46 46
 
47 47
     $RandomCompatDIR = dirname(__FILE__);
48 48
 
49
-    require_once $RandomCompatDIR.'/byte_safe_strings.php';
50
-    require_once $RandomCompatDIR.'/cast_to_int.php';
51
-    require_once $RandomCompatDIR.'/error_polyfill.php';
49
+    require_once $RandomCompatDIR . '/byte_safe_strings.php';
50
+    require_once $RandomCompatDIR . '/cast_to_int.php';
51
+    require_once $RandomCompatDIR . '/error_polyfill.php';
52 52
 
53 53
     if (!function_exists('random_bytes')) {
54 54
         /**
@@ -69,9 +69,9 @@  discard block
 block discarded – undo
69 69
         if (extension_loaded('libsodium')) {
70 70
             // See random_bytes_libsodium.php
71 71
             if (PHP_VERSION_ID >= 50300 && function_exists('\\Sodium\\randombytes_buf')) {
72
-                require_once $RandomCompatDIR.'/random_bytes_libsodium.php';
72
+                require_once $RandomCompatDIR . '/random_bytes_libsodium.php';
73 73
             } elseif (method_exists('Sodium', 'randombytes_buf')) {
74
-                require_once $RandomCompatDIR.'/random_bytes_libsodium_legacy.php';
74
+                require_once $RandomCompatDIR . '/random_bytes_libsodium_legacy.php';
75 75
             }
76 76
         }
77 77
 
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
                 // place, that is not helpful to us here.
111 111
 
112 112
                 // See random_bytes_dev_urandom.php
113
-                require_once $RandomCompatDIR.'/random_bytes_dev_urandom.php';
113
+                require_once $RandomCompatDIR . '/random_bytes_dev_urandom.php';
114 114
             }
115 115
             // Unset variables after use
116 116
             $RandomCompat_basedir = null;
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
                 (PHP_VERSION_ID <= 50609 || PHP_VERSION_ID >= 50613)
135 135
             ) {
136 136
                 // See random_bytes_mcrypt.php
137
-                require_once $RandomCompatDIR.'/random_bytes_mcrypt.php';
137
+                require_once $RandomCompatDIR . '/random_bytes_mcrypt.php';
138 138
             }
139 139
         }
140 140
 
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
                     $RandomCompatCOMtest = new COM('CAPICOM.Utilities.1');
156 156
                     if (method_exists($RandomCompatCOMtest, 'GetRandom')) {
157 157
                         // See random_bytes_com_dotnet.php
158
-                        require_once $RandomCompatDIR.'/random_bytes_com_dotnet.php';
158
+                        require_once $RandomCompatDIR . '/random_bytes_com_dotnet.php';
159 159
                     }
160 160
                 } catch (com_exception $e) {
161 161
                     // Don't try to use it.
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
             extension_loaded('openssl')
187 187
         ) {
188 188
             // See random_bytes_openssl.php
189
-            require_once $RandomCompatDIR.'/random_bytes_openssl.php';
189
+            require_once $RandomCompatDIR . '/random_bytes_openssl.php';
190 190
         }
191 191
 
192 192
         /**
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
     }
208 208
 
209 209
     if (!function_exists('random_int')) {
210
-        require_once $RandomCompatDIR.'/random_int.php';
210
+        require_once $RandomCompatDIR . '/random_int.php';
211 211
     }
212 212
 
213 213
     $RandomCompatDIR = null;
Please login to merge, or discard this patch.