Skip to content

Commit

Permalink
Cleanup php-eval.
Browse files Browse the repository at this point in the history
  • Loading branch information
weitzman committed Sep 22, 2017
1 parent 76a83bd commit 1921f17
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/Commands/core/EvalCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,17 @@ class EvalCommands
* @command php-eval
* @param string $php Code to execute.
* @aliases eval, ev
* @usage php-eval 'variable_set("hello", "world");'
* Sets the hello variable using Drupal API.
* @usage php-eval '$node = node_load(1); return $node->title;'
* @usage php-eval '$node = node_load(1); return $node->label();'
* Loads node with nid 1 and then prints its title.
* @usage php-eval "file_unmanaged_copy('$HOME/Pictures/image.jpg', 'public://image.jpg');"
* Copies a file whose path is determined by an environment's variable.
* Note the use of double quotes so the variable $HOME gets replaced by
* its value.
* @usage php-eval "node_access_rebuild();"
* Rebuild node access permissions.
* @default-format var_export
* @bootstrap DRUSH_BOOTSTRAP_MAX
* @allow-additional-options true
*/
public function phpEval($php, $options =
[
'format' => 'var_export',
])
public function phpEval($php, $options = ['format' => 'var_export'])
{
return eval($php . ';');
}
Expand Down

0 comments on commit 1921f17

Please sign in to comment.