本文整理汇总了PHP中check_command函数的典型用法代码示例。如果您正苦于以下问题:PHP check_command函数的具体用法?PHP check_command怎么用?PHP check_command使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了check_command函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sleep
{
if (!is_numeric($check_str)) {
return SYMBOL_ERROR;
}
if ($check_str < 0) {
return SYMBOL_ERROR;
}
return $check_str;
}
//get data from client
$cmd;
$TrainingId;
//query
$link;
//1.get information from client
if (($cmd = check_command($_GET["cmd"])) == SYMBOL_ERROR) {
sleep(DELAY_SEC);
echo SYMBOL_ERROR_CMD;
return;
}
if (($TrainingId = check_number($_GET["TrainingId"])) == SYMBOL_ERROR) {
sleep(DELAY_SEC);
echo SYMBOL_ERROR;
return;
}
if (($UserId = check_number($_GET["UserId"])) == SYMBOL_ERROR) {
sleep(DELAY_SEC);
echo SYMBOL_ERROR;
return;
}
if (($Status = check_number($_GET["Status"])) == SYMBOL_ERROR) {
示例2: check_dir
can checkout the ICU data directory via SVN:
\$ svn co http://source.icu-project.org/repos/icu/icu/trunk/source/data icu-data
MESSAGE
);
}
// Verify that all required directories exist
$source = $GLOBALS['argv'][1];
check_dir($source);
$source = realpath($source);
check_dir($source . DIRECTORY_SEPARATOR . 'curr');
check_dir($source . DIRECTORY_SEPARATOR . 'lang');
check_dir($source . DIRECTORY_SEPARATOR . 'locales');
check_dir($source . DIRECTORY_SEPARATOR . 'region');
check_command('genrb');
// Convert the *.txt resource bundles to *.res files
$target = __DIR__;
$currDir = $target . DIRECTORY_SEPARATOR . 'curr';
$langDir = $target . DIRECTORY_SEPARATOR . 'lang';
$localesDir = $target . DIRECTORY_SEPARATOR . 'locales';
$namesDir = $target . DIRECTORY_SEPARATOR . 'names';
$namesGeneratedDir = $namesDir . DIRECTORY_SEPARATOR . 'generated';
$regionDir = $target . DIRECTORY_SEPARATOR . 'region';
make_directory($currDir);
clear_directory($currDir);
genrb_file($currDir, $source . DIRECTORY_SEPARATOR . 'curr', 'en');
genrb_file($currDir, $source . DIRECTORY_SEPARATOR . 'curr', 'supplementalData');
// It seems \ResourceBundle does not like locale names with uppercase chars then we rename the binary file
// See: http://bugs.php.net/bug.php?id=54025
$filename_from = $currDir . DIRECTORY_SEPARATOR . 'supplementalData.res';
示例3: check_command
version to build the data files.
Read the UPDATE.txt file for more info.
MESSAGE
);
}
check_command('svn');
// Script options
$version = isset($GLOBALS['argv'][1]) ? $GLOBALS['argv'][1] : icu_version();
$icuBinPath = isset($GLOBALS['argv'][2]) ? $GLOBALS['argv'][2] : '';
// Slash the path
if ('' != $icuBinPath && strrpos($icuBinPath, DIRECTORY_SEPARATOR) + 1 != strlen($icuBinPath)) {
$icuBinPath .= DIRECTORY_SEPARATOR;
}
check_command($icuBinPath . 'genrb');
$version = normalize_icu_version($version);
$source = download_icu_data($version);
// Verify that all required directories exist
check_dir($source);
check_dir($source . DIRECTORY_SEPARATOR . '.svn');
$source = realpath($source);
// Currency, language and region data are bundled in the locales directory in ICU <= 4.2
if (!is_icu_version_42_or_earlier($version)) {
check_dir($source . DIRECTORY_SEPARATOR . 'curr');
check_dir($source . DIRECTORY_SEPARATOR . 'lang');
check_dir($source . DIRECTORY_SEPARATOR . 'region');
}
check_dir($source . DIRECTORY_SEPARATOR . 'locales');
// Convert the *.txt resource bundles to *.res files
$target = $version;
示例4: check_command
function check_command($command, $depth, $function_guard = '', $nogo_parameters = NULL)
{
if (is_null($nogo_parameters)) {
$nogo_parameters = array();
}
global $LOCAL_VARIABLES, $CURRENT_CLASS, $FUNCTION_SIGNATURES;
foreach ($command as $i => $c) {
if ($c == array()) {
continue;
}
if (is_integer($c[count($c) - 1])) {
$c_pos = $c[count($c) - 1];
$or = false;
} else {
$c_pos = $c[count($c) - 2];
$or = true;
}
switch ($c[0]) {
case 'CALL_METHOD':
check_method($c, $c_pos, $function_guard);
break;
case 'CALL_INDIRECT':
add_variable_reference($c[1][1], $c_pos);
break;
case 'VARIABLE':
check_variable($c);
break;
case 'CALL_DIRECT':
if (isset($GLOBALS['PEDANTIC'])) {
if (isset($GLOBALS['NULL_ERROR_FUNCS'][$c[1]]) || isset($GLOBALS['FALSE_ERROR_FUNCS'][$c[1]])) {
log_warning('Crucial return value was not handled', $c_pos);
}
}
check_call($c, $c_pos, NULL, $function_guard);
break;
case 'GLOBAL':
foreach ($c[1] as $v) {
if (isset($LOCAL_VARIABLES[$v[1]]) && !$LOCAL_VARIABLES[$v[1]]['is_global']) {
log_warning($v[1] . ' was referenced before this globalisation.', $c_pos);
}
add_variable_reference($v[1], $c_pos, false);
$LOCAL_VARIABLES[$v[1]]['is_global'] = true;
$LOCAL_VARIABLES[$v[1]]['unused_value'] = true;
}
break;
case 'RETURN':
$ret_type = check_expression($c[1], false, false, $function_guard);
add_variable_reference('__return', $c_pos);
set_ocportal_type('__return', $ret_type);
if (!isset($LOCAL_VARIABLES['__return']['mentions'])) {
$LOCAL_VARIABLES['__return']['mentions'] = array();
}
$LOCAL_VARIABLES['__return']['mentions'][] = $c_pos;
if (count($command) - 1 > $i) {
log_warning('There is unreachable code', $c_pos);
}
break;
case 'SWITCH':
$switch_type = check_expression($c[1], false, false, $function_guard);
foreach ($c[2] as $case) {
if (!is_null($case[0])) {
$passes = ensure_type(array($switch_type), check_expression($case[0], false, false, $function_guard), $c_pos, 'Switch type inconsistency');
if ($passes) {
infer_expression_type_to_variable_type($switch_type, $case[0]);
}
}
check_command($case[1], $depth + 1, $function_guard, $nogo_parameters);
}
break;
case 'ASSIGNMENT':
check_assignment($c, $c_pos, $function_guard);
break;
case 'IF':
$t = check_expression($c[1], false, false, $function_guard);
$passes = ensure_type(array('boolean'), $t, $c_pos, 'Conditionals must be boolean (if) [is ' . $t . ']', true);
if ($passes) {
infer_expression_type_to_variable_type('boolean', $c[1]);
}
if ($c[1][0] == 'BOOLEAN_NOT' && $c[1][1][0] == 'CALL_DIRECT' && strpos($c[1][1][1], '_exists') !== false && $c[1][1][2][0][0] == 'LITERAL' && $c[1][1][2][0][1][0] == 'STRING' && ($c[2][0][0] == 'BREAK' || $c[2][0][0] == 'CONTINUE' || $c[2][0][0] == 'RETURN' || $c[2][0][0] == 'CALL_DIRECT' && $c[2][0][1] == 'critical_error')) {
$function_guard .= ',' . $c[1][1][2][0][1][1] . ',';
}
$temp_function_guard = $function_guard;
if ($c[1][0] == 'CALL_DIRECT' && strpos($c[1][1], '_exists') !== false && $c[1][2][0][0] == 'LITERAL' && $c[1][2][0][1][0] == 'STRING') {
$temp_function_guard .= ',' . $c[1][2][0][1][1] . ',';
}
if ($c[1][0] == 'BOOLEAN_AND' && $c[1][1][0] == 'BRACKETED' && $c[1][1][1][0] == 'CALL_DIRECT' && strpos($c[1][1][1][1], '_exists') !== false && $c[1][1][1][2][0][0] == 'LITERAL' && $c[1][1][1][2][0][1][0] == 'STRING') {
$temp_function_guard .= ',' . $c[1][1][1][2][0][1][1] . ',';
}
if ($c[1][0] == 'BOOLEAN_AND' && $c[1][2][0] == 'BOOLEAN_AND' && $c[1][2][1][0] == 'BRACKETED' && $c[1][2][1][1][0] == 'CALL_DIRECT' && strpos($c[1][2][1][1][1], '_exists') !== false && $c[1][2][1][1][2][0][0] == 'LITERAL' && $c[1][2][1][1][2][0][1][0] == 'STRING') {
$temp_function_guard .= ',' . $c[1][2][1][1][2][0][1][1] . ',';
}
check_command($c[2], $depth, $temp_function_guard, $nogo_parameters);
break;
case 'IF_ELSE':
$passes = ensure_type(array('boolean'), check_expression($c[1], false, false, $function_guard), $c_pos, 'Conditionals must be boolean (if-else)', true);
if ($passes) {
infer_expression_type_to_variable_type('boolean', $c[1]);
}
$temp_function_guard = $function_guard;
if ($c[1][0] == 'CALL_DIRECT' && strpos($c[1][1], '_exists') !== false && $c[1][2][0][0] == 'LITERAL' && $c[1][2][0][1][0] == 'STRING') {
//.........这里部分代码省略.........