File tree Expand file tree Collapse file tree 5 files changed +28
-11
lines changed
Expand file tree Collapse file tree 5 files changed +28
-11
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+ // Exit if this file is directly accessed
3+ if ( ! defined ( 'ABSPATH ' ) ) { exit ; }
4+
5+ /**
6+ * Loads the plugin files.
7+ */
8+ function wpephpcompat_load_files () {
9+ require_once dirname ( __FILE__ ) . '/src/wpephpcompat.php ' ;
10+
11+ if ( version_compare ( phpversion (), '5.3 ' , '< ' ) ) {
12+ $ autoload_file = dirname ( __FILE__ ) . '/php52/vendor/autoload.php ' ;
13+ } else {
14+ $ autoload_file = dirname ( __FILE__ ) . '/vendor/autoload.php ' ;
15+ }
16+
17+ require_once $ autoload_file ;
18+
19+ if ( defined ( 'WP_CLI ' ) && WP_CLI ) {
20+ require_once dirname ( __FILE__ ) . '/src/wpcli.php ' ;
21+ }
22+ }
23+
24+ wpephpcompat_load_files ();
Original file line number Diff line number Diff line change 11<?php
2- require_once dirname ( dirname ( __FILE__ ) ) . '/src/wpephpcompat.php ' ;
3- require_once dirname ( dirname ( __FILE__ ) ) . '/vendor/autoload.php ' ;
2+ require_once dirname ( dirname ( __FILE__ ) ) . '/load-files.php ' ;
43
54/**
65 * PHPCompat WP-CLI command.
Original file line number Diff line number Diff line change 22// Exit if this file is directly accessed
33if ( ! defined ( 'ABSPATH ' ) ) { exit ; }
44
5- require_once dirname ( dirname ( __FILE__ ) ) . '/vendor/autoload .php ' ;
5+ require_once dirname ( dirname ( __FILE__ ) ) . '/load-files .php ' ;
66
77/**
88 * Summary.
Original file line number Diff line number Diff line change 55 die;
66}
77
8- require_once dirname ( __FILE__ ) . '/src/wpephpcompat .php ' ;
8+ require_once dirname ( __FILE__ ) . '/load-files .php ' ;
99
1010$ wpephpc = new WPEPHPCompat ( dirname ( __FILE__ ) );
1111$ wpephpc ->clean_after_scan ();
Original file line number Diff line number Diff line change 1212// Exit if this file is directly accessed
1313if ( ! defined ( 'ABSPATH ' ) ) { exit ; }
1414
15- require_once dirname ( __FILE__ ) . '/src/wpephpcompat.php ' ;
16- require_once dirname ( __FILE__ ) . '/vendor/autoload.php ' ;
17-
18- // Add the phpcompat WP-CLI command.
19- if ( defined ( 'WP_CLI ' ) && WP_CLI ) {
20- require_once dirname ( __FILE__ ) . '/src/wpcli.php ' ;
21- }
15+ require_once dirname ( __FILE__ ) . '/load-files.php ' ;
2216
2317/**
2418 * This handles hooking into WordPress.
You can’t perform that action at this time.
0 commit comments