Stud.IP  4.2 Revision
tic_5671_scan.php File Reference

Variables

 $opts = getopt('fhnosv', array('filenames', 'help', 'non-recursive', 'occurences', 'matches', 'verbose'))
 
if(isset($opts['h'])||isset($opts['help'])) $args = $_SERVER['argv']
 
 $arg_stop = array_search('--', $args)
 
if($arg_stop !==false) elseif(count($opts)) else
 
 $verbose = isset($opts['v']) || isset($opts['verbose'])
 
 $only_filenames = isset($opts['f']) || isset($opts['filenames'])
 
 $show_occurences = $verbose || isset($opts['o']) || isset($opts['occurences'])
 
 $show_matches = $show_occurences || isset($opts['m']) || isset($opts['matches'])
 
 $recursive = !(isset($opts['n']) || isset($opts['recursive']))
 
 $folders = $args ?: array($GLOBALS['STUDIP_BASE_PATH'])
 
 $log
 
 $log_if
 
 $highlight
 
 $config = Config::get()->getFields('global')
 
 $quoted = array_map(function ($item) { return preg_quote($item, '/'); }, $config)
 
 $regexp = '/\$(?:GLOBALS\[["\']?)?(' . implode('|', $quoted) . ')\b/S'
 

Variable Documentation

◆ $arg_stop

$arg_stop = array_search('--', $args)

◆ $args

if (isset( $opts[ 'h'])||isset( $opts[ 'help'])) $args = $_SERVER['argv']

◆ $config

$config = Config::get()->getFields('global')

◆ $folders

foreach ( $folders as $index=> $folder) $folders = $args ?: array($GLOBALS['STUDIP_BASE_PATH'])

◆ $highlight

$highlight
Initial value:
= function ($content, $variable) {
$lines = explode("\n", $content);
foreach ($lines as $index => $line) {
if (mb_strpos($line, $variable) === false) {
continue;
}
$result[$index + 1] = $line;
}
if (!$result) {
return '';
}
$max = max(array_map('mb_strlen', array_keys($result)));
foreach ($result as $index => $line) {
$result[$index] = sprintf('#{yellow:%0' . $max . 'u}: %s', $index, str_replace($variable, "#{yellow_bg,black:$variable}", $line));
}
return implode("\n", $result);
}
$content
Definition: _cancel_form.php:3
$max
Definition: index.php:8
$result
Definition: fix_collate.php:19

◆ $log

$log

◆ $log_if

$log_if
Initial value:
= function ($condition, $message) use ($log) {
if ($condition) {
call_user_func_array($log, array_slice(func_get_args(), 1));
}
}
$log
Definition: tic_5671_scan.php:46
$condition
Definition: info.php:20

◆ $only_filenames

$only_filenames = isset($opts['f']) || isset($opts['filenames'])

◆ $opts

$opts = getopt('fhnosv', array('filenames', 'help', 'non-recursive', 'occurences', 'matches', 'verbose'))

◆ $quoted

$quoted = array_map(function ($item) { return preg_quote($item, '/'); }, $config)

◆ $recursive

$recursive = !(isset($opts['n']) || isset($opts['recursive']))

◆ $regexp

$regexp = '/\$(?:GLOBALS\[["\']?)?(' . implode('|', $quoted) . ')\b/S'

◆ $show_matches

$show_matches = $show_occurences || isset($opts['m']) || isset($opts['matches'])

◆ $show_occurences

$show_occurences = $verbose || isset($opts['o']) || isset($opts['occurences'])

◆ $verbose

$verbose = isset($opts['v']) || isset($opts['verbose'])

◆ else

if ( $arg_stop !==false) elseif (count( $opts)) else
Initial value:
{
$args = array_slice($args, 1)
if(isset($opts['h'])||isset($opts['help'])) $args
Definition: tic_5671_scan.php:28