Skip to content

srhaber/drush_php_cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Drush PHP-CLI

This Drush command opens an interactive PHP shell for a Drupal site. It uses the Readline library if available.

This command is useful for quickly testing code snippets, making DB queries, and so forth. For more robust scripts, use the php-script or write a custom drush command.

Example usage:

> drush php-cli

>> $u = user_load(1);
(stores user object into variable $u)

>> print_r($u);
(prints user object)

>> $count = db_result(db_query("SELECT COUNT(*) FROM users"));
(stores value into variable $count)

The PHP_Shell library is available here: http://jan.kneschke.de/projects/php-shell

About

Provide a PHP command-line interface for Drush

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages