function _drush_devel_print_function in Devel 8.3
Same name and namespace in other branches
- 8 drush/devel.drush8.inc \_drush_devel_print_function()
- 8.2 drush/devel.drush8.inc \_drush_devel_print_function()
- 6 devel.drush.inc \_drush_devel_print_function()
- 7 devel.drush.inc \_drush_devel_print_function()
Print the specified function.
Print the specified function, including any doxygen-style comments that come before it.
1 call to _drush_devel_print_function()
- drush_devel_fn_view in drush/
devel.drush8.inc - Command handler. Show source code of specified function or method.
File
- drush/
devel.drush8.inc, line 234 - This file is only used by Drush8.
Code
function _drush_devel_print_function($file, $start_line, $end_line) {
$line_num = 0;
$doxygen = NULL;
$fp = fopen($file, 'r');
while (!feof($fp) && $line_num < $start_line - 1) {
$line = fgets($fp);
++$line_num;
if (substr($line, 0, 3) == '/**') {
$doxygen = $line;
}
elseif (isset($doxygen)) {
$doxygen .= $line;
if ($line_num + 1 == $start_line) {
drush_print(rtrim($doxygen));
}
if (strstr($line, '*/') !== FALSE) {
$doxygen = NULL;
}
}
}
while (!feof($fp) && $line_num < $end_line) {
$line = fgets($fp);
++$line_num;
drush_print(rtrim($line));
}
}