by Example
Показать выпадающий список
Configuration of php_uname()
Эта страница доступна только на английском языке.
<?php
/**
* PHP By Example
*
* @copyright 2014 Michel Corne
* @license http://www.opensource.org/licenses/gpl-3.0.html GNU GPL v3
*/
require_once 'models/function_core.php';
/**
* Function configuration
*
* @see docs/function-configuration.txt
*/
class php_uname extends function_core
{
public $options_list = ['mode' => ['a', 'm', 'n', 'r', 's', 'v']];
public $synopsis = 'string php_uname ([ string $mode = "a" ] )';
public $test_not_validated = true;
function post_exec_function()
{
if (! $string = $this->result['string']) {
return;
}
$mode = $this->_filter->filter_arg_value('mode');
if (in_array($mode, ['s', 'm'])) {
// the system name and machine type may be disclosed
} else if (in_array($mode, ['n', 'r', 'v'])) {
// the host, version and release names are hashed for security
$string = $this->hash($string);
} else {
// note that invalid modes default to "a"
$string = [
php_uname('s') ,
$this->hash(php_uname('n')) ,
$this->hash(php_uname('r')) ,
$this->hash(php_uname('v')) ,
php_uname('m') ,
];
$string = implode(' ', $string);
}
$this->result['string'] = $string;
}
}
Powered by
PHP 7.1.33 (0.01 s)
2014-2017 Michel Corne