Skip to content

Commit 75469df

Browse files
authored
Make $args available as global
Fix: #80
1 parent dd4d5d3 commit 75469df

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/EvalFile_Command.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,14 @@ public function __invoke( $args, $assoc_args ) {
6363
* Evaluate a provided file.
6464
*
6565
* @param string $file Filepath to execute, or - for STDIN.
66-
* @param mixed $args Array of positional arguments to pass to the file.
66+
* @param mixed $positional_args Array of positional arguments to pass to the file.
6767
* @param bool $use_include Process the provided file via include instead of evaluating its contents.
6868
*/
69-
private static function execute_eval( $file, $args, $use_include ) {
69+
private static function execute_eval( $file, $positional_args, $use_include ) {
70+
global $args;
71+
$args = $positional_args;
72+
unset( $positional_args );
73+
7074
if ( '-' === $file ) {
7175
eval( '?>' . file_get_contents( 'php://stdin' ) );
7276
} elseif ( $use_include ) {

0 commit comments

Comments
 (0)