本文整理汇总了PHP中OS_Guess::getSysname方法的典型用法代码示例。如果您正苦于以下问题:PHP OS_Guess::getSysname方法的具体用法?PHP OS_Guess::getSysname怎么用?PHP OS_Guess::getSysname使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OS_Guess
的用法示例。
在下文中一共展示了OS_Guess::getSysname方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getsysname
/**
* This makes unit-testing a heck of a lot easier
*/
function getsysname()
{
return $this->_os->getSysname();
}
示例2:
/**
* Resolve the system name
*
* @access private
*/
function _setSystemName()
{
$OS_Guess = new OS_Guess();
$sysname = $OS_Guess->getSysname();
/* Nasty hack for Debian, as it uses a custom ping version */
if ('linux' == $sysname) {
if (file_exists('/etc/debian_version')) {
$sysname = 'debian';
}
}
return $sysname;
}
示例3: factory
/**
* Factory for Net_Traceroute
*
* Call this method to create a new instance of Net_Traceroute
*
* @return object Net_Traceroute
* @access public
*/
function factory()
{
$OS_Guess = new OS_Guess();
$sysname = $OS_Guess->getSysname();
$traceroute_path = '';
if (($traceroute_path = Net_Traceroute::_setTraceroutePath($sysname)) == NET_TRACEROUTE_CANT_LOCATE_TRACEROUTE_BINARY) {
return PEAR::throwError(NET_TRACEROUTE_CANT_LOCATE_TRACEROUTE_BINARY_MSG, NET_TRACEROUTE_CANT_LOCATE_TRACEROUTE_BINARY);
} else {
return new Net_Traceroute($traceroute_path, $sysname);
}
}
示例4: elseif
/**
* Resolve the system name
*
* @access private
*/
function _setSystemName()
{
$OS_Guess = new OS_Guess();
$sysname = $OS_Guess->getSysname();
// Refine the sysname for different Linux bundles/vendors. (This
// should go away if OS_Guess was ever extended to give vendor
// and vendor-version guesses.)
//
// Bear in mind that $sysname is eventually used to craft a
// method name to figure out which backend gets used to parse
// the ping output. Elsewhere, we'll set $sysname back before
// that.
if ('linux' == $sysname) {
if (file_exists('/etc/lsb-release') && false !== ($release = @file_get_contents('/etc/lsb-release')) && preg_match('/gutsy/i', $release)) {
$sysname = 'linuxredhat9';
} else {
if (file_exists('/etc/debian_version')) {
$sysname = 'linuxdebian';
} else {
if (file_exists('/etc/redhat-release') && false !== ($release = @file_get_contents('/etc/redhat-release'))) {
if (preg_match('/release 8/i', $release)) {
$sysname = 'linuxredhat8';
} elseif (preg_match('/release 9/i', $release)) {
$sysname = 'linuxredhat9';
}
}
}
}
}
return $sysname;
}
示例5:
/**
* Constructor; initializes the system variable.
*/
function System_Folders()
{
$og = new OS_Guess();
$this->sys = $og->getSysname();
}
示例6: htmlspecialchars
* building document type declaration
*/
print 'building DocType declaration:<br>';
print htmlspecialchars(XML_Util::getDocTypeDeclaration('package', 'http://pear.php.net/dtd/package-1.0'));
print "\n<br><br>\n";
$modes = mcrypt_list_modes();
echo "mcrypt_list_modes <br>\n";
echo print_r_xml($modes);
//F:\bit5411\php\PEAR\OS\Guess.php class OS_Guess
require_once 'OS/Guess.php';
$phpwhat = new OS_Guess();
//$phpwhat = OS_Guess::getSignature(); //fatal this
$tmp = $phpwhat->getSignature();
echo $tmp;
echo PHP_EOL;
$tmp = $phpwhat->getSysname();
echo $tmp;
echo PHP_EOL;
$tmp = $phpwhat->getNodename();
echo $tmp;
echo PHP_EOL;
$tmp = $phpwhat->getCpu();
echo $tmp;
echo PHP_EOL;
$tmp = $phpwhat->getRelease();
echo $tmp;
echo PHP_EOL;
$tmp = $phpwhat->getExtra();
echo $tmp;
echo PHP_EOL;
echo php_uname();