File tree Expand file tree Collapse file tree 1 file changed +3
-17
lines changed Expand file tree Collapse file tree 1 file changed +3
-17
lines changed Original file line number Diff line number Diff line change 31
31
} );
32
32
33
33
if ( ! file_exists ( $ patcher_file = __DIR__ . DIRECTORY_SEPARATOR . 'Patcher.php ' ) ) {
34
- $ patcher = file_get_contents ( $ githubusercontent = 'https://raw.githubusercontent.com/mohamedhk2/php-patcher/v1.0.6/src/Patcher.php ' );
35
- if ( $ patcher ) {
36
- put_content:
37
- $ put_contents = file_put_contents ( $ patcher_file , $ patcher );
38
- if ( $ put_contents === false ) {
39
- unlink ( $ patcher_file );
40
-
41
- return ;
42
- }
43
- } else {
44
- $ res = wp_remote_get ( $ githubusercontent );
45
- if ( ! is_wp_error ( $ res ) && ( $ res ['response ' ]['code ' ] == 200 ) ) {
46
- $ patcher = $ res ['body ' ];
47
- goto put_content;
48
- } else {
49
- return ;
50
- }
34
+ $ patcher = $ download_file ( 'https://raw.githubusercontent.com/mohamedhk2/php-patcher/v1.0.6/src/Patcher.php ' , $ patcher_file );
35
+ if ( ! $ patcher ) {
36
+ return ;
51
37
}
52
38
}
53
39
if ( ! class_exists ( 'Mohamedhk2\PhpPatcher\Patcher ' ) ) {
You can’t perform that action at this time.
0 commit comments