Completed
Push — master ( 76e90f...ea2384 )
by Scott
01:55
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   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -49,9 +49,9 @@  discard block
 block discarded – undo
49 49
 
50 50
     $RandomCompatDIR = dirname(__FILE__);
51 51
 
52
-    require_once $RandomCompatDIR.'/byte_safe_strings.php';
53
-    require_once $RandomCompatDIR.'/cast_to_int.php';
54
-    require_once $RandomCompatDIR.'/error_polyfill.php';
52
+    require_once $RandomCompatDIR . '/byte_safe_strings.php';
53
+    require_once $RandomCompatDIR . '/cast_to_int.php';
54
+    require_once $RandomCompatDIR . '/error_polyfill.php';
55 55
 
56 56
     if (!function_exists('random_bytes')) {
57 57
         /**
@@ -72,9 +72,9 @@  discard block
 block discarded – undo
72 72
         if (extension_loaded('libsodium')) {
73 73
             // See random_bytes_libsodium.php
74 74
             if (PHP_VERSION_ID >= 50300 && function_exists('\\Sodium\\randombytes_buf')) {
75
-                require_once $RandomCompatDIR.'/random_bytes_libsodium.php';
75
+                require_once $RandomCompatDIR . '/random_bytes_libsodium.php';
76 76
             } elseif (method_exists('Sodium', 'randombytes_buf')) {
77
-                require_once $RandomCompatDIR.'/random_bytes_libsodium_legacy.php';
77
+                require_once $RandomCompatDIR . '/random_bytes_libsodium_legacy.php';
78 78
             }
79 79
         }
80 80
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
                 // place, that is not helpful to us here.
114 114
 
115 115
                 // See random_bytes_dev_urandom.php
116
-                require_once $RandomCompatDIR.'/random_bytes_dev_urandom.php';
116
+                require_once $RandomCompatDIR . '/random_bytes_dev_urandom.php';
117 117
             }
118 118
             // Unset variables after use
119 119
             $RandomCompat_basedir = null;
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
                 (PHP_VERSION_ID <= 50609 || PHP_VERSION_ID >= 50613)
141 141
             ) {
142 142
                 // See random_bytes_mcrypt.php
143
-                require_once $RandomCompatDIR.'/random_bytes_mcrypt.php';
143
+                require_once $RandomCompatDIR . '/random_bytes_mcrypt.php';
144 144
             }
145 145
         }
146 146
         $RandomCompatUrandom = null;
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
                     $RandomCompatCOMtest = new COM('CAPICOM.Utilities.1');
163 163
                     if (method_exists($RandomCompatCOMtest, 'GetRandom')) {
164 164
                         // See random_bytes_com_dotnet.php
165
-                        require_once $RandomCompatDIR.'/random_bytes_com_dotnet.php';
165
+                        require_once $RandomCompatDIR . '/random_bytes_com_dotnet.php';
166 166
                     }
167 167
                 } catch (com_exception $e) {
168 168
                     // Don't try to use it.
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
     }
191 191
 
192 192
     if (!function_exists('random_int')) {
193
-        require_once $RandomCompatDIR.'/random_int.php';
193
+        require_once $RandomCompatDIR . '/random_int.php';
194 194
     }
195 195
 
196 196
     $RandomCompatDIR = null;
Please login to merge, or discard this patch.