OSDN Git Service
(root)
/
wvm
/
wvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cc33b4f
)
avoid leaking private \WP_CLI\Runner properties and methods
author
scribu
<mail@scribu.net>
Thu, 21 Nov 2013 09:12:44 +0000
(11:12 +0200)
committer
scribu
<mail@scribu.net>
Thu, 21 Nov 2013 09:12:44 +0000
(11:12 +0200)
php/WP_CLI/Runner.php
patch
|
blob
|
history
php/utils.php
patch
|
blob
|
history
diff --git
a/php/WP_CLI/Runner.php
b/php/WP_CLI/Runner.php
index
e09a54a
..
1782695
100644
(file)
--- a/
php/WP_CLI/Runner.php
+++ b/
php/WP_CLI/Runner.php
@@
-450,7
+450,7
@@
class Runner {
if ( isset( $this->config['require'] ) ) {
foreach ( $this->config['require'] as $path ) {
-
require $path
;
+
Utils\load_file( $path )
;
}
}
diff --git
a/php/utils.php
b/php/utils.php
index
d1713b5
..
64a165f
100644
(file)
--- a/
php/utils.php
+++ b/
php/utils.php
@@
-36,6
+36,11
@@
function get_vendor_paths() {
);
}
+// Using require() directly inside a class grants access to private methods to the loaded code
+function load_file( $path ) {
+ require $path;
+}
+
function load_command( $name ) {
$path = WP_CLI_ROOT . "/php/commands/$name.php";