你的女参怎么说? [英] What does YOUR uname say?

查看:102
本文介绍了你的女参怎么说?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

短篇小说::我需要编写一个PHP脚本,该脚本从uname中找到正确的操作系统类型(例如:wincewinnt都将返回windows). 请参阅此处以获取更多信息.

这不是社区Wiki吗?

是,但是... 请参阅此处

如何提供帮助::如果您的操作系统未在下面列出,请运行此代码并分享您的发现:

<?php
    echo php_uname();
?>

或者,在Unix shell中,尝试

user@host ~ > php -a

php > echo php_uname();

共享结果列表

  • Darwin ... 10.4.0 Darwin Kernel Version 10.4.0:2010年4月23日星期五太平洋夏令时间18:28:53根目录:xnu-1504.7.4〜1/RELEASE_I386 i386
  • Darwin ... 9.8.0 Darwin Kernel版本9.8.0:2009年7月15日星期三16:55:01 PDT;根目录:xnu-1228.15.4〜1/RELEASE_I386 i386
  • Windows NT ... 6.1内部版本7600
  • Linux ... 2.6.24-24-xen#1 SMP Tue Aug 18 18:15:39 UTC 2009 x86_64
  • Linux ... 2.6.34.7-56.fc13.x86_64#1 SMP 9月15日星期三03:36:55 UTC 2010 x86_64
  • Linux ... 2.6.32-25-generic#44-Ubuntu SMP Fri Sep 17 20:26:08 UTC 2010 i686
  • Windows NT ... 5.1内部版本2600
  • Windows NT ... 6.0内部版本6002(Windows Server 2008 Standard Edition Service Pack 2)i586
  • Windows NT ... 6.1内部版本7600((null))i586

有趣的是,即使某些条件完全匹配,uname仍然会产生不同的结果.

解决方案

似乎这是uname的眉毛. 随时编辑/更新此列表:

  • Ubuntu 10.10 32位(i686)

Linux SYSTEM_NAME 2.6.35-22-generic #34-Ubuntu SMP SYSTEM_DATE i686

  • Ubuntu 10.04 32位,PHP 5.3.2

Linux SYSTEM_NAME 2.6.32-25-generic #44-Ubuntu SMP SySTEM_DATE i686

  • Ubuntu 10.04 x64

Linux SYSTEM_NAME 2.6.32-25-generic #44-Ubuntu SMP SYSTEM_DATE x86_64t

  • Ubuntu 13.04 x86_64

Linux SYSTEM_NAME 3.8.0-29-generic #42-Ubuntu SMP SYSTEM_DATE x86_64 GNU/Linux

  • Debian GNU/Linux 4.0(蚀刻)32位,PHP 5.2.0

Linux SYSTEM_NAME 2.6.18-028stab062.3 #1 SMP SYSTEM_DATE i686

  • Gentoo linux,32位,PHP 5.2:

Linux SYSTEM_NAME 2.6.35-gentoo-r8sh #1 SMP PREEMPT SYSTEM_DATE i686

  • Fedora 13 64位:

Linux SYSTEM_NAME 2.6.34.7-56.fc13.x86_64 #1 SMP SYSTEM_DATE x86_64

  • Centos 5.5 x86:

Linux SYSTEM_NAME 2.6.18-194.17.1.el5 #1 SMP SYSTEM_DATE i686

  • Mac OS Snow Leopard(imac 24英寸)

Darwin SYSTEM_NAME.local 10.4.0 Darwin Kernel Version 10.4.0: SYSTEM_DATE; root:xnu-1504.7.4~1/RELEASE_I386 i386

  • Windows 7 Professional 64位,PHP 5.3 32位:

Windows NT SYSTEM_NAME 6.1 build 7600 ((null)) i586

  • Windows 2008 Server 64位

Windows NT SYSTEM_NAME 6.0 build 6002 (Windows Server 2008 Standard Edition Service Pack 2) i586

  • Windows XP SP3

Windows NT SYSTEM_NAME 5.1 build 2600

Short story: I need to write a PHP script which finds the correct OS type from uname (eg: both wince and winnt would return windows). See here for more info.

Shouldn't this be a community wiki?

Yes but...see here.

How to help: If your OS is not listed below, please run this code and share your findings:

<?php
    echo php_uname();
?>

Or, in a Unix shell, try

user@host ~ > php -a

php > echo php_uname();

List of shared results

  • Darwin ... 10.4.0 Darwin Kernel Version 10.4.0: Fri Apr 23 18:28:53 PDT 2010; root:xnu-1504.7.4~1/RELEASE_I386 i386
  • Darwin ... 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386
  • Windows NT ... 6.1 build 7600
  • Linux ... 2.6.24-24-xen #1 SMP Tue Aug 18 18:15:39 UTC 2009 x86_64
  • Linux ... 2.6.34.7-56.fc13.x86_64 #1 SMP Wed Sep 15 03:36:55 UTC 2010 x86_64
  • Linux ... 2.6.32-25-generic #44-Ubuntu SMP Fri Sep 17 20:26:08 UTC 2010 i686
  • Windows NT ... 5.1 build 2600
  • Windows NT ... 6.0 build 6002 (Windows Server 2008 Standard Edition Service Pack 2) i586
  • Windows NT ... 6.1 build 7600 ((null)) i586

It's interesting to note that even when certain conditions match exactly, uname still produces different results.

解决方案

Seems like this is the browscap for uname. Feel free to edit/update this list:

  • Ubuntu 10.10 32bit (i686)

Linux SYSTEM_NAME 2.6.35-22-generic #34-Ubuntu SMP SYSTEM_DATE i686

  • Ubuntu 10.04 32bit, PHP 5.3.2

Linux SYSTEM_NAME 2.6.32-25-generic #44-Ubuntu SMP SySTEM_DATE i686

  • Ubuntu 10.04 x64

Linux SYSTEM_NAME 2.6.32-25-generic #44-Ubuntu SMP SYSTEM_DATE x86_64t

  • Ubuntu 13.04 x86_64

Linux SYSTEM_NAME 3.8.0-29-generic #42-Ubuntu SMP SYSTEM_DATE x86_64 GNU/Linux

  • Debian GNU/Linux 4.0 (etch) 32bit, PHP 5.2.0

Linux SYSTEM_NAME 2.6.18-028stab062.3 #1 SMP SYSTEM_DATE i686

  • Gentoo linux, 32bit, PHP 5.2:

Linux SYSTEM_NAME 2.6.35-gentoo-r8sh #1 SMP PREEMPT SYSTEM_DATE i686

  • Fedora 13 64 bits:

Linux SYSTEM_NAME 2.6.34.7-56.fc13.x86_64 #1 SMP SYSTEM_DATE x86_64

  • Centos 5.5 x86:

Linux SYSTEM_NAME 2.6.18-194.17.1.el5 #1 SMP SYSTEM_DATE i686

  • Mac OS Snow Leopard (imac 24")

Darwin SYSTEM_NAME.local 10.4.0 Darwin Kernel Version 10.4.0: SYSTEM_DATE; root:xnu-1504.7.4~1/RELEASE_I386 i386

  • Windows 7 Professional 64-bit, PHP 5.3 32-Bit:

Windows NT SYSTEM_NAME 6.1 build 7600 ((null)) i586

  • Windows 2008 Server 64-Bit

Windows NT SYSTEM_NAME 6.0 build 6002 (Windows Server 2008 Standard Edition Service Pack 2) i586

  • Windows XP SP3

Windows NT SYSTEM_NAME 5.1 build 2600

这篇关于你的女参怎么说?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆