1.查看CPU信息命令
cat  /proc/cpuinfo

2.查看内存信息命令
cat  /proc/meminfo

3.查看硬盘信息命令
fdisk -l

dmidecode |more
dmidecode |more
Handle 0x0005
        DMI type 2, 20 bytes.
        Base Board Information
                Manufacturer: Intel Corporation
                Product Name: D945GPM
                Version: AAD25924-102
                Serial Number: AZPM61102417


dmidecode |more

[/usr/local/tads/htdocs/soa/soa1.3]# dmidecode |more
# dmidecode 2.7
SMBIOS 2.5 present.
66 structures occupying 3399 bytes.
Table at 0xCFB9C000.

Handle 0xDA00, DMI type 218, 11 bytes.
OEM-specific Type
        Header and Data:
                DA 0B 00 DA B2 00 17 00 0E 20 00

Handle 0x0000, DMI type 0, 24 bytes.
BIOS Information
        Vendor: Dell Inc.
        Version: 2.2.6
        Release Date: 02/05/2008
        Address: 0xF0000
        Runtime Size: 64 kB
        ROM Size: 1024 kB
        Characteristics:
                ISA is supported
                PCI is supported
                PNP is supported
                BIOS is upgradeable
                BIOS shadowing is allowed
                ESCD support is available
                Boot from CD is supported
                Selectable boot is supported
                EDD is supported
                Japanese floppy for Toshiba 1.2 MB is supported (int 13h)
                5.25"/360 KB floppy services are supported (int 13h)
                5.25"/1.2 MB floppy services are supported (int 13h)
                3.5"/720 KB floppy services are supported (int 13h)
                Print screen service is supported (int 5h)
                8042 keyboard services are supported (int 9h)
                Serial services are supported (int 14h)
                Printer services are supported (int 17h)
                CGA/mono video services are supported (int 10h)
--More--
在使用 Zend Studio for Eclipse 的 “run as PHPUnit test” 功能时,前后遇到了几个错误:

点击 “run as PHPUnit test” 时,Zend Studio for Eclipse 假死,并且没有需要运行的 test 的统计数字。点击停止时,会提示 “No test executed, Either a fatal error occurred, the launch was stopped manually or the script execution was halted with a ‘die’/'exit’ statement.” 。 出现这种情况,是很难知道问题所在的,因为 console 中也没有任何错误提示。我也是因为偶然间在所有 test 之前加了一个空的 test case ,才发现了问题所在 “Call to undefined function curl_init()”,因为程序中调用了 curl。

但是,我的 php 是加载了 curl 的,问题依然没有解决,不过 console 中的一行字显示了问题所在 “AllTest.php [PHPUnit] /usr/local/Zend/ZendStudioForEclipse-6.1.0/plugins/org.zend.php.debug.debugger.linux.x86_5.2.14.v20080602/resources/php5/php-cgi” ,原来,Zend Studio for Eclipse 使用自带的 php 程序来执行调试功能的,所以才会出现 curl 没有加载的问题。

在 window/preferences 中,php 选项中的 PHP Executables 里面,我加入了自己的 php 可执行程序,运行一下,提示没有  ZendDebugger ,一番奋战之后,问题解决。
来源:http://www.codebit.cn/blog/?p=55
一个网站要在一个静态的背景上加一个透明的Flash会显示动态的效果,按照常规方式加了后,在IE中能显示正常:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="760" height="160">    
<param name="movie" value="webjx_com.swf">    
<param name="wmode" value="transparent"> //在IE中实现透明的代码  
<embed src="webjx_com.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="760" height="160"></embed></object>  




但是用Firefox浏览器却发现出现透明的Flash没有出现透明的效果,那究竟应该怎么加呢?
原来在ie中实现flash背景透明,是加这样一个值:


<param name="wmode" value="transparent">


而在Mozilla Firefox浏览器中起作用的是这个标签 <embed></embed> 那这样,在<embed>标签内加入属性 wmode="transparent" 就可以实现flash背景透明,所以将修改代码如下:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="745" height="140">  
<param name="movie" value="webjx_com.swf">  
<param name="wmode" value="transparent">  
<embed src="webjx_com.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="745" height="140" wmode="transparent" ></embed></object>
1、基本上网模式:通过两家公用的路由器上网。2、增加下级路由(无线):因自家添置了笔记本,于是买了一个无线路由器,将公用路由牵出的网线插在无线路由WAN口上。3、下级路由连线方式:台式机用网线与无线路由连接,笔记本用无线连接。4、症状:两台机器均可正常上Internet网,但“网上邻居” 里,两台机器均无法显示和访问对方。5、参考:a.试过笔记本也用网线与无线路由连接,就可以与台式机互访。b.无线路由器型号是TP-LINK WR340G。
请教一下:我怎样才能在笔记本无线连接情况下做到与我的台式机互访?


1.你的笔记本是否正确连接到你自己的路由器上?
2.需要你们2个路由的地址,和是否开启了DHCP,才好判断.我估计是你的笔记本和你的台式电脑处在2个不同的网段了.比如笔记本在192.168.0.X,台式在192.168.1.X.

附上2个路由器的连接方法希望能帮上你
有2种设置方式:
假设网络是由路由器A拉到路由器B,路由器A地址为192.168.1.1,路由器都不需要改动
1. 把路由器A拉过来的线接在路由器wan口上,那么你设置路由器B的lan为192.168.0.1, 还要设置pppoe为静态的地址为192.168.1.X,和路由器A一个网段,这样保存重起路由应该就可以.(提示:访问路由器的话比如路由lan为 192.168.0.1那你的机器的IP要和他一个网段的比如192.168.0.X.)
2.把路由器A过来的线接到路由器B的任意非wan口上,设置B路由器的lan为192.168.0.1,关闭路由器B的dhcp功能,删除静态IP,DNS等,保存重起路由应该就可以. 实际就是把你的无线路由器当交换机用.
http://www.cnblogs.com/webflash/archive/2010/04/22/1717771.html
回忆未来  21:17:29
我想问问:如果我在php端a.php设置cookie,是不是一访问就会通过httpwatcher一看就立马出现cookie,还是需要刷新?这个是如何握手的,膘哥,能告诉我http协议的原理?
回忆未来  21:20:17
膘哥哥。
回忆未来  21:20:28

膘叔  21:20:46
你用httpwatcher监视一下就知道了呀。
膘叔  21:21:33
setcookie其实就是在刷新的时候向浏览器发出
Set-Cookie的头部请求。
膘叔  21:21:42
所以httpwatcher应该是可以监视得到的。
回忆未来  21:22:45
我没有刷新啊,我就在浏览器里面输入a.php,这下就能看到?
膘叔  21:24:23
他已经向header发送请求了。
膘叔  21:24:38
你用firebug看REQUEST
回忆未来  21:24:45
点击在新窗口中浏览此图片
膘叔  21:24:46
再看返回的REsponse
回忆未来  21:24:57
是这样的吧?能看到的是吧
膘叔  21:25:37
你最好做一个空白页面测试一下  
膘叔  21:25:56
我现在也没有办法给你答案。我自己也没有测试过  
回忆未来  21:27:47
经常写,我觉得理论上是这样的。但是httpwacher好像第一次没有出现,刷新到别同域名的页面,于是我就开始怀疑了。情况就这么个情况,哈哈

-----------------------------------------------------------------------
 BoPo<bopo2005@qq.com>  21:30:25
cookie是不是set的那个页面不能访问,其他页面都可以
 BoPo<bopo2005@qq.com>  21:30:36
这是为什么呢

config.t(10202001)  21:32:02
第一次本地是没有cookie,读不到,票数说了 要 $_COOKIE['COO']='xxx' 先赋个值

 BoPo<bopo2005@qq.com>  21:32:39
再跳回来也读取不到吗
config.t(10202001)  21:33:18
可以
回忆未来(372647693)  21:35:14
为什么,当时不可以,然后就可以了呢?给个解释
膘叔(19129540)  21:35:19
你可以尝试一下
<?php
setcookie('name','value',time()+1000,'/');
var_dump($_COOKIE);
膘叔(19129540)  21:35:29
运行后把setcookie注释掉。
膘叔(19129540)  21:35:35
再运行一次就知道了  
申寒光(80748134)  21:36:25
谁管理过win2003的服务器?
申寒光(80748134)  21:36:41
我现在服务器出问题了,急得很!
膘叔(19129540)  21:37:11
03很难管理。
 BoPo<bopo2005@qq.com>  21:37:18
我不用win很多年
回忆未来(372647693)  21:37:27
请用unix
---
cookie是向浏览器发送一个头,然后浏览器给请求的时候带上头返回在请求的时候。

ctrl+k :向下
ctrl+shift+K:向上

editplus是F3。shift+F3

suse 学习笔记

WEB2.0 jackx 2010-6-7 22:55
感觉跟Redhat许多地方还是一样的, 比较一些配置文件的地址, rpm包, 不过有个yast工具,也比较方便阅读全文
这个东东的原理是这样滴,firefox安装一个插件,起作用的就下面几行


var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
file.initWithPath("/tmp/refresh.firefox");
//浏览器开启时启动一个定时器
var timer = setInterval(function()
{
    //每隔0.1秒检测一下这个文件存在否
    if ( file.exists() )
    {
        //如果存在,删除之
        file.remove(true);
        //获取当前标签的文档对象
        var doc = gBrowser.selectedBrowser.contentDocument;
        //是否是在调试的东东
        if ( /(xiaonei\.com|kaixin\.com)/.test( doc.location.href ) )
        {
            //如果是,调用dnsFluher,刷新host,如果没有安装此插件就算了
            dnsFluher.refreshdns();
            //刷新页面
            doc.location.reload();
        }
    }
},100 );
  


所以,只要在/tmp/目录生成一个refresh.firefox的文件,firefox便会刷新了

vim 里添加一行配置文件

"更改host文件时刷新

autocmd BufWritePost,FileWritePost /etc/hosts execute '!echo '' > /tmp/refresh.firefox'

"更改调试文件时刷新

autocmd BufWritePost,FileWritePost */jspro/*.js execute '!echo '' > /tmp/refresh.firefox'



插件附上,根据情况自行修改。。
DownLoad:http://bluehua.org/wp-content/uploads/2009/04/autorefresh.zip

扩展名改成xpi拖到firefox就可以安装了,好像无法兼容,但是思想很好的,呵呵!
写了一个简单的发送HTML邮件的PHP函数。

  函数说明:send_mail("发件人地址", "收件人地址", "邮件主题", "邮件正文");

  示例:send_mail($from, "info@s135.com", "这是邮件的主题", "<html><head></head><body><p><font color=red>这是邮件正文</font></p></body></html>");

  代码如下:

<?php  
function send_mail($from, $to, $subject, $message)  
{  
  if ($from == "")  
    {  
       $from = '回忆未来 <webmaster@s135.com>';//发件人地址  
   }  
   $headers = 'MIME-Version: 1.0' . "\r\n";  
    $headers .= 'Content-type: text/html; charset=gb2312' . "\r\n";  
    $headers .= 'From: ' . $from . "\r\n";  
    mail($to, $subject, $message, $headers);  
}  
?>  


这是要求运行代码的机器装有Mail服务器 ,前提应该是:
在php.ini里设置了smtp服务器,和连接smtp服务器的用户名和密码 .注意:$subject上需要做下编码, 不然容易乱码
来源:http://blog.s135.com/post/312/

马化腾名言

WEB2.0 jackx 2010-6-6 15:25
      技术核心能力非可复制性强,让极致核心能力产生口碑。

  各方面全面发展。有些东西可以等,但要判断优先秩序,这个要经常去调整。不是说定了大方向,就完了。

  往往在顺境,就会觉得要do something,很容易陷入你就是做给别人看的,不一定很合理。我们其实还是倾向于稳妥。

  融资关键是要尽量搞清楚,每个投资者对公司发展是有益的还是阻碍。

  跟李彦宏很早就很熟了。我们两家公司都还很弱小的时候就经常聊天,就像同病相怜,看着那几个大佬在上面,我们几个在下面耕耘自己的那块地。但我们的发展思路有点像,而且双方比较投缘。

  当年一起喝啤酒的时候,我们只是打工仔而已,都还不知道未来。丁磊后来的成功为我带来了启发,只要去做,没有什么事情是不可能的。

  视频这东西太烧钱,等大家都奄奄一息的时候我再进入吧。

  Google也承认它不是第一个做搜索的公司,竞价排名也不是它发明的,Overture早就有了,关键看谁整合得好。这个世界上没有一个公司有任何一个板块是完全独立自己创建的,都是别人或多或少都尝试过的。

  就像日常生活中人们对水和电的依赖一样,我们要做成互联网上的水和电。

  好的,多谢。我也让我们网站部不上了,但我们自卫核武还是要准备好的,希望永远用不上。

  腾讯从来没有预设对手,或者任何的假想敌,腾讯人都认为最大的对手就是腾讯人自己。

  管理方面的书,知道了也就够了。不会因为你知道,企业就能变得怎么样,还是得看你做的事情。

  一开始学习管理。可能觉得有些浪费时间,因为这个不是具体做业务做事情,但到后面你发现不做不行。

  没办法,因为有些专业知识,无论怎么补课,就是到不了那个级别。指望你的提高去迎合公司发展的风险太大,所以一定要请人来替换你的功能。

我将两台电脑共享了,开启了Windows7的Guest和administrator帐户,现在每次开机都要选用户,请问怎样才能不选用户直接登陆我自己的用户名?

在开始——运行中输入lusrmgr.msc,在用户找到Administrator和Guest,右键,属性,勾上“帐户已禁用”,确定后退出。
注销,回到登录界面后就可以了……

全给勾上禁用后的结果是,锁定屏幕后直接回去就提示:你的账户已经禁用,哈哈。于是没办法,只好在网上google了一把,解决方法如下:
我是windows7的系统,不小心禁用了管理员帐号,怎么办?

看看能否在安全模式下启用administrator账户吧,安全模式开机按F8,然后再控制面板里面不要禁用那个管理员即可,哈哈。
第一种方法:采用useradd/adduser与passwd命令添加;
第二种方法:手动添加普通用户,以jiangc用户为例;
1、编辑/etc/passwd文件;
照猫画虎添加一行保存退出;
jiangc:x:501:501::/home/jiangc:/bin/bash
2、编辑/etc/shadow文件;
由于/etc/shadow为只读权限;有两种方法可以解决向文家中写数据;
一种为echo结合“>>”法,即采用追加法;
另一种为采用chmod命令将/etc/shadow权限修改一下即可,修改完以后再将其权限改为只读权限;
同样照猫画虎添加一行;
jiangc:$1$./ye2SA7$GK0BTb9XvOXKfRtkRodaT1:13430:0:99999:7:::
注:其中的第二项密码部分可以用md5sum命令生成后拷贝过来,也可以最后采用passwd自动生成;
3、编辑/etc/group与/etc/gshadow,方法1、2项;
4、建立jiangc用户的工作目录;
mkdir /home/jiangc
5、将/etc/skel/下文件拷贝至/home/jiangc目录下;
cp -r /etc/skel/.??*
/home/jiangc/
6、修改/home/jiangc目录的用户归属;
chown -r jiangc.jiangc
/home/jiangc
7、为jiangc用户添加密码;(注:如在第2步中采用md5sum已经将密码设置完,此步可以不做);
passwd jiangc

OK!到此为止,jiangc用户就添加成功;
版权归属于VincentChiang,转载敬请注明出处及作者名称,谢谢!!
==================================

创建新的帐号有几种方法. 我们将使用最基本的方法; useradd命令. 基本上, 所有您要输入的(记住,作为root!)就是:
阅读全文
漏洞介绍:nginx是一款高性能的web服务器,使用非常广泛,其不仅经常被用作反向代理,也可以非常好的支持PHP的运行。80sec发现其中存在一个较为严重的安全问题,默认情况下可能导致服务器错误的将任何类型的文件以PHP的方式进行解析,这将导致严重的安全问题,使得恶意的攻击者可能攻陷支持php的nginx服务器。阅读全文
PHP中的全局变量$_SERVER['PATH_INFO']是一个很有用的参数,众多的CMS系统在美化自己的URL的时候,都用到了这个参数。

对于下面这个网址:

http://www.test.com/index.php/foo/bar.html?c=index&m=search

我们可以得到 $_SERVER['PATH_INFO'] = ‘/foo/bar.html’,而此时 $_SERVER['QUERY_STRING'] = 'c=index&m=search';

通常,我们最初开始PHP程序编写的时候,都会使用诸如: http://www.test.com/index.php?c=search&m=main 这样的URL,这种URL不仅看起来非常奇怪,而且对于搜索引擎也是非常不友好的。很多搜索引擎收录的时候,都会忽略Query String之后的内容,google虽然不会忽略Query String,但是对于其他不含Query String的页面,会给于比较高的PR值。

下面是一段解析PATH_INFO的非常简单的代码:


<?php

if( !isset( $_SERVER['PATH_INFO'] ) ){
    $pathinfo = 'default';
}else{
    $pathinfo =  explode('/', $_SERVER['PATH_INFO']);
}

if( is_array($pathinfo) AND !empty($pathinfo)  ){
    $page = $pathinfo[1];
}else{
    $page = 'a.php';
}

require "$page.php";

?>





php  b.php    
Array
(
    [dirname] => ali-bj-hd://encodevideo/1df33be864364b04bb7ac3a6e3500c7c
    [basename] => 2019_11_28_2eDBGGJ5sQ_450.mp4
    [extension] => mp4
    [filename] => 2019_11_28_2eDBGGJ5sQ_450
)
•作者: laruence(http://www.laruence.com)
•本文地址: http://www.laruence.com/2010/05/14/1473.html
•转载请注明出处
在读别人代码的时候, 在没有详细文档的时候, 如何快速的看清整个代码的结构(类结构), 就成为了一个现实的问题.

今天我就介绍一种, 自动生成UML图的方法.
下载:http://pear.php.net/package/PHP_UML
假设, 我有一个项目文件夹:laruence, 在这个文件夹上有一个文件Root.php(事实上, 无论多级目录, 多个文件, 都可以).

<?php abstract class Root {
    private $instance;
    abstract public function Hi();
}
interface Intro {
    public function Say();
}
class Sub extends Root implements Intro {
    private $instance;
    public function Say() {
        echo "I am Laruence";
    }
    public function Hi() {
        echo "Hello!";
    }
}
?>




首先, 我们要使用PHP_UML(PHP_UML)根据代码生成XMI.

使用方法比较简单, 在安装PHP_UML以后, 运行:
pear安装PHP_UML命令的方法:/usr/local/php/bin/pear install PHP_UML-1.5.2
http://pear.php.net/package/PHP_UML/download
Linux下试安了下:
[root@test bin]# ./pear install PHP_UML-1.6.1
WARNING: channel "pear.php.net" has updated its protocols, use "pear channel-update pear.php.net" to update
pear/PHP_UML requires PHP extension "XSL"
downloading Console_CommandLine-1.2.0.tgz ...
Starting to download Console_CommandLine-1.2.0.tgz (39,740 bytes)
..........done: 39,740 bytes
install ok: channel://pear.php.net/Console_CommandLine-1.2.0
上面说要更新pearl,于是:
[root@test bin]# pear channel-update pear.php.net
Updating channel "pear.php.net"
Update of Channel "pear.php.net" succeeded
继续:
/usr/local/php/bin/pear
pear/PHP_UML requires PHP extension "XSL"
No valid packages found
install failed
这段话的意思是“pear/PHP_UML需要php的扩展“XSL”,没有找到有效的软件包,安装失败。”
Windows:
extension=php_xsl.dll
Linux:
安装扩展xsl
找到安装包
find -name php-5.2.17*
进入安装包所在目录
如果是压缩的执行下边这条指令,已经解压缩的就跳过进入下一条指令
tar zxvf  php-5.2.17.tar.gz
cd php-5.2.17/ext/xsl
/usr/local/php_fcgi/bin/phpize
./configure --with-php-config=/usr/local/php_fcgi/bin/php-config
make
make install
出现提示
Installing shared extensions:     /usr/local/php_fcgi/lib/php/extensions/no-debug-non-zts-20060613/
然后在php_fcgi目录中的php.ini中增加一个注释extension = xsl.so就可以了,找到当时的源码目录,按上面操作也Ok。
后也就安装Ok了,如下:
[root@test bin]# ./pear install PHP_UML-1.6.1
downloading PHP_UML-1.6.1.tgz ...
Starting to download PHP_UML-1.6.1.tgz (518,959 bytes)
.........................................................................................................done: 518,959 bytes
install ok: channel://pear.php.net/PHP_UML-1.6.1
于是有这个文件了:/usr/local/php/bin/phpuml


phpuml laruence/ -o laruence.xmi -n laruence -f xmi  --pure-object --no-deployment-view  --no-component-view --no-docblocks

/usr/local/php/bin/phpuml  ./ -o myPro.xmi -n myPro -f xmi  --pure-object --no-deployment-view  --no-component-view --no-docblocks
-o directory                             Output directory path, or filename
-n name                                  Name of the generated UML model
-e encoding                              Output character encoding
-f php 输出的是挖空方法名里的代码,保留:变量,函数,注释。
-f format, --format=format               Output format: "xmi" (default),
                                           "html", "htmlnew", "php"
                                           For html/htmlnew/php, if you want to
                                           provide your own XMI file, pass it as
                                           argument to phpuml
-m pattern, --match=pattern              Patterns to match (default is: *.php)
-i pattern, --ignore=pattern             Patterns/pathnames to ignore
phpuml /var/www/test -o /tmp -x 1 -n Foo -m *.php6 -i .svn


实践Ok的注意点,变量注释及函数名注释[2014/2/15]:
加上 -e gbk 生成的xmi文件,其代码里的中文注释才能在Altova UModel生成的Html里以Utf8编码打开方式打开正常:
/usr/local/php/bin/php /usr/local/php/bin/phpuml  /data/htdocs/xiyou_alpha -e gbk -o /data/htdocs/tools.jackxiang.com/xiyou_php_uml/xiYouDomainUml.xmi -n xiYouDomainUml -f xmi  --pure-object --no-deployment-view  --no-component-view --no-docblocks

一、PHP先生成xmi,后经过Altova UModel导入再生成html。
常用。
二、直接用PHPUML生成Html,将生成Html文档(定期在Linux机器上生成):
http://lifei123.blog.51cto.com/2487662/435638
/usr/local/php/bin/php /usr/local/php/bin/phpuml  /data/htdocs/xiyou_alpha -e gbk  -o /data/htdocs/tools.xiyou.cntv.cn/xiyou_php_uml/uml2html -f html --pure-object --no-deployment-view --no-component-view --no-docblocks

三、其它工具:利用Enterprise Architect识别PHP输出UML图:
http://leeon.me/a/How-to-use-Enterprise-Architect-to-output-UML

四、还有一个工具可以生成调用图::Altova MapForce,这个工具可以支持XMI到UML图的转换
http://www.icultivator.com/p/6191.html


五、UML多做一点PHP代码少写一点: http://www.linxun.info/?p=270

我试试:--->下面这个猜想是不对的,这个玩意呀,是一个pear来安装的,于是你的安装pear后,再安装它才行
php phpuml D:\APMServ5.2.6\www\htdocs\soa\soa1.0  soa_uml_jackxiang.xmi -n laruence -f xmi  --pure-object --no-deployment-view  --no-component-view --no-docblocks


Error:
Fatal error: require_once(): Failed opening required 'Console/CommandLine.php' (
include_path='.;C:\php5\pear') in D:\APMServ5.2.6\www\htdocs\UML_TOOLS\PHP_UML-1
.5.2\scripts\phpuml on line 26

我随即下载了一个张宴的apm,经过后面的安装,我们才能得到正确的结果,following me ,ok:

会得到一个laruence.xmi文件, phpuml的具体参数可以通过phpuml –help了解.

有了xmi以后, 如何转成UML图呢?

Visio2007不支持导入XMI, 我找到了另外的一个工具:Altova Umodel(我下载了一个:2010破解版本的,发现用不了,看膘哥一篇文章:http://www.neatstudio.com/show-1280-1.shtml  用的是这个Altova MapForce,下载地址:https://shop.altova.com/pricelist.asp), 这个工具可以支持XMI到UML图的转换, 需要注册, 不过提供了30天的使用许可(大家要是有更好的替换方案, 欢迎补充).
华军软件园也有下载,我南方网通,网通下载较快:http://www.newhua.com/softdown/94173_2.htm

DownLoad: http://soft2.jdxz.net/down/Altova%20UModel%20Enterprise%202010%20v12.0%20%D3%A2%CE%C4%B0%E6.rar?2101486036745x1275809647x2101486777479-7b2c187951d3b18f487f3f72eda0eeeb   2010 破解版本网上都有的:)

使用方法:导入和生成
1.File -》Import From XMI File
2.Project-》Generate Documentation  (可选 :生成HTML和Word的Doc文档)

在Umodel导入laruence.xmi以后 ,生成UML图, 就得到了如下的PNG:
点击在新窗口中浏览此图片


是不是很方便呢?

另外PHP_UML还可以生成html格式, 做为一种doc gen工具也不错. 更可以通过xmi生成PHP文件.


安装pear的可能出现的情况:
-------------------------

进入php目录,直接运行pear.bat,因为目录下有这个文件。但是告诉我不对,所以我准备重装pear,怎么装呢?官方告诉我,下载一个go-pear.php文件,用PHP执行一下就可以了。

下载好go-pear.php文件后,拷到php目录下,运行:php go-pear.php,然后就一步一步的往下安装PEAR了。装的时候请选择system而不是local。安装完毕后生成一个REG文件,这是让你执行一下,把PHP的环境变量加到系统中。


这时候,就可以运行pear install PHP_UML-1.5.2了,第一件郁闷的事情就发生了,系统提示,php_uml需要xsl的支持,因为我用的是绿色版的,所以我修改了一下我的php.ini后,继续执行时,仍然提示需要xsl,不是特别明白的时候,我看了一下我的php.ini,确认是加载了。但再次运行又是提示,最后我运行php --ini,才发现,原来命令行下用的php.ini居然是在c:\windows下面,而不是我绿色版中配置的php.ini文件。我把php.ini拷贝到c:\windows下后,程序可以顺利执行,安装完毕php_uml了。


第二件郁闷的事情接踵而至,按照上文的程序方式,我生成了xmi文件,却发现无法打开,怎么办?按照 文件提示下载了那个Altova MapForce

php -d output_buffering=0 PEAR\go-pear.phar



D:\APMServ5.2.6\PHP>php -d output_buffering=0 PEAR\go-pear.phar

Are you installing a system-wide PEAR or a local copy?
(system|local) [system] : local
Please confirm local copy by typing 'yes' :

Below is a suggested file layout for your new PEAR installation.  To
change individual locations, type the number in front of the
directory.  Type 'all' to change all of them or simply press Enter to
accept these locations.

1. Installation base ($prefix)                   : D:\APMServ5.2.6\PHP
2. Temporary directory for processing            : D:\APMServ5.2.6\PHP\tmp
3. Temporary directory for downloads             : D:\APMServ5.2.6\PHP\tmp
4. Binaries directory                            : D:\APMServ5.2.6\PHP
5. PHP code directory ($php_dir)                 : D:\APMServ5.2.6\PHP\pear
6. Documentation directory                       : D:\APMServ5.2.6\PHP\docs
7. Data directory                                : D:\APMServ5.2.6\PHP\data
8. User-modifiable configuration files directory : D:\APMServ5.2.6\PHP\cfg
9. Public Web Files directory                    : D:\APMServ5.2.6\PHP\www
10. Tests directory                               : D:\APMServ5.2.6\PHP\tests
11. Name of configuration file                    : C:\Windows\pear.ini
12. Path to CLI php.exe                           : D:\APMServ5.2.6\PHP

1-12, 'all' or Enter to continue:
Beginning install...
Configuration written to C:\Windows\pear.ini...
Initialized registry...
Preparing to install...
installing phar://go-pear.phar/PEAR/go-pear-tarballs/Archive_Tar-1.3.2.tar...
installing phar://go-pear.phar/PEAR/go-pear-tarballs/Console_Getopt-1.2.3.tar...
installing phar://go-pear.phar/PEAR/go-pear-tarballs/PEAR-1.7.1.tar...
installing phar://go-pear.phar/PEAR/go-pear-tarballs/Structures_Graph-1.0.2.tar...
pear/PEAR can optionally use package "pear/XML_RPC" (version >= 1.4.0)
install ok: channel://pear.php.net/Archive_Tar-1.3.2
install ok: channel://pear.php.net/Console_Getopt-1.2.3
install ok: channel://pear.php.net/Structures_Graph-1.0.2
install ok: channel://pear.php.net/PEAR-1.7.1
PEAR: Optional feature webinstaller available (PEAR's web-based installer)
PEAR: Optional feature gtkinstaller available (PEAR's PHP-GTK-based installer)
PEAR: Optional feature gtk2installer available (PEAR's PHP-GTK2-based installer)
PEAR: To install optional features use "pear install pear/PEAR#featurename"

******************************************************************************
WARNING!  The include_path defined in the currently used php.ini does not
contain the PEAR PHP directory you just specified:
<D:\APMServ5.2.6\PHP\pear>
If the specified directory is also not in the include_path used by
your scripts, you will have problems getting any PEAR packages working.


Would you like to alter php.ini <D:\APMServ5.2.6\PHP\php.ini>? [Y/n] : y

php.ini <D:\APMServ5.2.6\PHP\php.ini> include_path updated.

Current include path           : .;C:\php5\pear
Configured directory           : D:\APMServ5.2.6\PHP\pear
Currently used php.ini (guess) : D:\APMServ5.2.6\PHP\php.ini
Press Enter to continue:

** WARNING! Old version found at D:\APMServ5.2.6\PHP, please remove it or be sure to use the new d:\apmserv5.2.6\php\pear.bat command

The 'pear' command is now at your service at d:\apmserv5.2.6\php\pear.bat


* WINDOWS ENVIRONMENT VARIABLES *
For convenience, a REG file is available under D:\APMServ5.2.6\PHP\PEAR_ENV.reg .
This file creates ENV variables for the current user.

Double-click this file to add it to the current user registry.


D:\APMServ5.2.6\PHP>pear install PHP_UML-1.5.2

Warning: Invalid argument supplied for foreach() in PEAR\Downloader.php on line 555

Warning: Invalid argument supplied for foreach() in D:\APMServ5.2.6\PHP\PEAR\PEAR\Downloader.php on line 555
downloading PHP_UML-1.5.2.tgz ...
Starting to download PHP_UML-1.5.2.tgz (503,404 bytes)
..................................


在张宴的默认安装目录: D:\APMServ5.2.6\www\htdocs
建立目录:\laruence  ,目录下建立:laruence.php  
cmd下:
cd D:\APMServ5.2.6\www\htdocs
运行命令:

D:\APMServ5.2.6\www\htdocs>phpuml laruence/ -o laruence.xmi -n laruence -f xmi  --pure-object --no-deployment-view  --no-component-view --no-docblocks


运行结束后,在目录:D:\APMServ5.2.6\www\htdocs
下,你可以看到生成了一个:laruence.xmi 文件,大功告成!!!
随后,你可以按照风雪说的,搞个破解版本的Altova Umodel 2010,我google看有并下载了一个,呵呵,感觉不错。


代码审查查,得再用一次:
先下载:http://pear.php.net/package/PHP_UML  后解压,然后运行时提示如下:
PHP Warning:  require_once(PHP/UML.php): failed to open stream: No such file or directory ...
PHP Fatal error:  require_once(): Failed opening required 'PHP/UML.php'
原来是找不到文件:
require_once 'Console/CommandLine.php';
require_once 'PHP/UML.php';
这两行的问题,于是解决方法如下:
1)建立PHP目录,把下载的文件放里面。
2)构造PHP的PATH路径,如下:

如果你换一个位置:define("LIB_PATH","/home/jackxiang/PHPUML/"); 目录得换,或者写成相对的。
然后再次执行:

我执行这个Ok生成:

下载后的验证码URL:http://jackxiang.com/post/4627/
使用方法:导入和生成
1.File -》Import From XMI File
2.Project-》Generate Documentation  (可选 :生成HTML和Word的Doc文档)

这个哥们的博客也写吧,觉得生成html这块还不错,如下:
URL:http://lifei123.blog.51cto.com/2487662/435638
一般的使用方法是:
phpuml 项目目录 -o 项目名.xmi -n 项目名 -f xmi --pure-object --no-deployment-view --no-component-view --no-docblocks
得到的文件是xmi格式的,需要使用软件进行转换,经过尝试,StarUML可以转(需要注意的是StarUML、ArgoUML只支持PHP_UML的XMI格式1.0,而不支持2.0,因此需要在命令行中加入-x 1.0)。 也可以使用
phpuml 项目目录 -o 项目名.xmi -n 项目名 -f html --pure-object --no-deployment-view --no-component-view --no-docblocks
实例:



/root/software/PHP_UML-1.5.5/PHP/UML/Output/ExporterXSL.php

PHP Warning:  chdir(): Not a directory (errno 20) in /root/software/PHP_UML-1.5.5/PHP/UML/Output/ExporterXSL.php on line 129
PHP Fatal error:  Class 'XSLTProcessor' not found in /root/software/PHP_UML-1.5.5/PHP/UML/Output/ExporterXSL.php on line 133

查询Google,有人为此提交了一个Bug,URL:http://pear.php.net/bugs/bug.php?id=16924&edit=3
最后,提示是没有安装扩展,PHP_UML depends on the PHP module "XSL".dl("php_libxslt.so");

Description:
------------
When I run the cli version I´ll get a Fatal error

Using this command
phpuml /var/www/htdocs/project -f html -o /var/www/UML/

Get this respons
Fatal error: Class 'XSLTProcessor' not found in /usr/local/lib/php/PHP/UML/Output/ExporterXSL.php on line 133


-Status:      Open
+Status:      Closed
-Assigned To:
+Assigned To: baptiste
Hello,

PHP_UML depends on the PHP module "XSL".
It seems that this module is not enabled in your configuration.
To enable it, remove the ";" in the line ";extension=php_xsl.dll" in your php.ini

Linux下安装:
php_libxslt - a simple libxslt PHP/XSL extension
Overview ::
php_libxslt is a very simple PHP extension to transform XML documents using the GNOME XSLT C library. It provides an alternative XSLT engine to the current PHP default XSL extension. It currently seems to work fine (and serves this site since more than 2 years), but there's (as always) room for improvements. There's e.g. no serious error handling implemented yet (any volunteers?).
php_libxslt has been tested using PHP4.1.2/libxslt 1.0.16 on Linux/PowerPC (Debian/woody), PHP4.2.3/libxslt 1.0.16 on Linux/i386 (Debian) and PHP4.3.1 on Linux/i386 (RedHat), test reports (success/failure) especially regarding platforms different from Linux are welcome, contact axelm-php(at)nona.net.
Download ::
Note: The file below is rather small (about 15kB), so the download may be finished within just a few seconds. Note well: Retrying doesn't increase the file's size ;).
Source code: php_libxslt-0.3.0.tar.gz Here:  http://nona.net/download/php_libxslt-0.3.0.tar.gz
md5sum: 08e896ccc06c5c79d47e90de646e07c0
Installation ::
Please refer to the file INSTALL in the tarball if you are installing from source, or to the dpkg man page if you are using the Debian packages. For building the Debian packages from the source tarball please refer to INSTALL.Debian.
Usage ::
php_libxslt has a very simple interface (as it provides just one function). A few examples are provided in the "examples" directory of the distribution. Simply transforming XML using an XSL stylesheet is done by calling:
<?
   dl("php_libxslt.so");
   $transformed = libxslt_transform($xmlstring, $xsltstring);
?>

first argument: XML string to be transformed (no file name, the XML document itself)
second argument: XSL stylesheet string (again, no file name, stylesheet itself required)
return value: Transformation output (if transformation did succeed) or XML input document (if transformation did fail).
Adding XSLT parameters ::
If you want to hand over parameters to your stylesheet, call the function with the (optional) third argument containing the XSL parameters in a hash:
<?
   dl("php_libxslt.so");
   $xslparam['ExampleParameter'] = "'Example Value'";
   $xslparam['OtherParameter'] = "'Another Value'";
   $transformed = libxslt_transform($xmlstring,
                       $xsltstring, $xslparam);
?>

(Be careful regarging quoting of the parameter strings, unquoted parameters will be interpreted by libxslt)
Error handling ::
If, for any reason, the XSL transformation does not succeed, the original XML string is returned. Detailed error messages should show up in your web servers error log.
Questions? Feedback? ::
Feel free to contact me at axelm-php(at)nona.net. Feedback, comments, questions and build/bug reports are welcome.

以上来源:http://nona.net/software/phplibxslt/
<?php
//$xml = new DomDocument;
//$xml->load('test.xml');
$xsl = new DomDocument;
//$xsl->load('test.xsl');
$xslt = new Xsltprocessor;
//$xslt->importStylesheet($xsl);
//$transformation = $xslt->transformToXml($xml);
//echo $transformation;
?>

PHP Fatal error:  Class 'Xsltprocessor' not found in /root/software/php_libxslt-0.3.0/test.php on line 8
https://bugs.php.net/bug.php?id=37969&edit=1  
如果你在php5中用xslt_create()这个php4中的方法时,将会得到call    to    undefined    function    xslt_create()这个error。
reason is : 该扩展已经从    PHP    5    中移出,然后移入到    PECL    仓库中。 php5的ext目录下已经没有php_xslt.dll了,取而代之的是php_xsl.dll。
phpinfo();没有找到。
用下面代码探测:
<?php
if(extension_loaded("xsl")) {
    if(class_exists("XSLTProcessor")) {
        trigger_error("XSL loaded and ready", E_USER_NOTICE);
    }  
    else {
        trigger_error("XSL extension loaded but class could not be found", E_USER_ERROR);
    }          
}              
else {          
    trigger_error("XSL extension has not been loaded", E_USER_ERROR);
}                

root@116.255.139.240:/data0/htdocs/blog# php xsl.php
PHP Fatal error:  XSL extension has not been loaded in /data0/htdocs/blog/xsl.php on line 11
果然没有!!!

root@116.255.139.240:~/software/php-5.3.8/ext/xsl# phpize
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626
./
root@116.255.139.240:~/software/php-5.3.8/ext/xsl# ./configure
checking for XSL support... yes, shared
configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution

oot@116.255.139.240:~/software/php-5.3.8/ext/xsl# rpm -qa libxslt
libxslt-1.1.17-2.el5_2.2
whereis xslt-config
然后./configure --help 看看--with-xsl指定他的详细路径。
找到他的位置:
root@116.255.139.240:/# rpm -ql libxslt-1.1.17-2.el5_2.2|grep xslt-config
root@116.255.139.240:/#
在URL:http://www.hackbase.com/tech/2011-09-09/65235.html 找到:
错误二十
  configure:error:xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution
  解决方法:
  #yum install libxslt libxslt-devel
如下:
Running Transaction
  Installing     : libgpg-error-devel                                                                                           1/3
  Installing     : libgcrypt-devel                                                                                              2/3
  Installing     : libxslt-devel                                                                                                3/3

Installed:
  libxslt-devel.i386 0:1.1.17-2.el5_2.2                                                                                            
Dependency Installed:
  libgcrypt-devel.i386 0:1.4.4-5.el5                                 libgpg-error-devel.i386 0:1.4-2                                
Complete!

再编译:
Build complete.
Don't forget to run 'make test'. 通过了,原来就没有安装: libxslt-devel,xslt-config在 libxslt-devel这个包里面,确定如下:
root@116.255.139.240:~/software/php-5.3.8/ext/xsl# rpm -ql libxslt-devel-1.1.17-2.el5_2.2|grep  xslt-config
/usr/bin/xslt-config
root@116.255.139.240:~/software/php-5.3.8/ext/xsl# make install
Installing shared extensions:     /usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20090626/
root@116.255.139.240:~/software/php-5.3.8/ext/xsl# ls  /usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20090626/
eaccelerator.so  imagick.so  memcache.so  pdo_mysql.so  soap.a  soap.so  ssh2.so  syck.so  xdebug.so  xsl.so
xsl.so加入PHP.ini中即可。

最后,生成Html就Ok了:





mkdir /tmp/html
chmod -R 777 /tmp/html
php ./phpuml /home/jackxiang/public_html/adc/web_adc_proj/trunk -o /tmp/html -n adcGenOutHtml -f html  --pure-object --no-deployment-view  --no-component-view --no-docblocks

?root@116.255.139.240:/tmp/html# ls
inherit.gif  style.css

php ./phpuml --help
Options:
  -o directory                             Output directory path, or filename
                                           (if not provided, the XMI code is
                                           printed on screen)
  -f format, --format=format               Output format: "xmi" (default),
                                           "html", "htmlnew", "php"
                                           For html/htmlnew/php, if you want to
                                           provide your own XMI file, pass it as
                                           argument to phpuml
  -x XMI version                           XMI version to generate (1 or 2)
  -n name                                  Name of the generated UML model
生成了xmi1.0的,但是用它来给Altova UModel解析,出现错误:

对比:
强行生成xmi1.0的导入:
... finished XMI import - 7 error(s), 1 warning(s)
默认生成的xmi导入:
... finished XMI import - 0 error(s), 7180 warning(s)




PHP Warning:  DOMDocument::loadXML(): Entity 'bull' not defined in Entity, line: 1665 in /root/software/PHP_UML-1.5.5/PHP/UML/Output/ExporterXSL.php on line 68
PHP Warning:  DOMDocument::loadXML(): Entity 'deg' not defined in Entity, line: 1665 in /root/software/PHP_UML-1.5.5/PHP/UML/Output/ExporterXSL.php on line 68
PHP Warning:  DOMDocument::loadXML(): Entity 'dagger' not defined in Entity, line: 1665 in /root/software/PHP_UML-1.5.5/PHP/UML/Output/ExporterXSL.php on line 68
PHP Warning:  DOMDocument::loadXML(): Entity 'Dagger' not defined in Entity, line: 1665 in /root/software/PHP_UML-1.5.5/PHP/UML/Output/ExporterXSL.php on line 68
PHP Warning:  DOMDocument::loadXML(): Entity 'plusmn' not defined in Entity, line: 1665 in /root/software/PHP_UML-1.5.5/PHP/UML/Output/ExporterXSL.php on line 68
PHP Warning:  DOMDocument::loadXML(): Entity 'permil' not defined in Entity, line: 1665 in /root/software/PHP_UML-1.5.5/PHP/UML/Output/ExporterXSL.php on line 68
PHP Warning:  DOMDocument::loadXML(): Entity 'trade' not defined in Entity, line: 1665 in /root/software/PHP_UML-1.5.5/PHP/UML/Output/ExporterXSL.php on line 68
PHP Warning:  DOMDocument::loadXML(): Entity 'micro' not defined in Entity, line: 1665 in /root/software/PHP_UML-1.5.5/PHP/UML/Output/ExporterXSL.php on line 68



PHP生成html结尾的文件实践Ok及感悟:
Use the option -f to specify which format you want phpuml to generate.
$ phpuml /var/www/foo -f html -o /var/tmp/

This will scan /var/www/foo, and create the API documentation in /var/tmp/.
If you need to provide your own XMI file (instead of parsing existing PHP files), simply pass it as argument.
$ phpuml myFile.xmi -f php -o /var/tmp/
This will read the XMI code contained in myFile.xmi, and generate the PHP code templates in /var/tmp/.
下面我是测试Ok的,一个是由xmi转回为PHP文件,第二个是把PHP文件转为Html的类继承图:


还可以忽略某些目录的扫描,扫描规定某后缀文件名,等等,昨天晚上搞了很晚,最后找到文档
唯有文档,只有文档才是最好的参考,什么书啊,博客啊,都是部分,或者有失真,所以贴上其
PHPUML文档的URL:
http://pear.php.net/manual/en/package.php.php-uml.command-line.php
分页: 179/338 第一页 上页 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 下页 最后页 [ 显示模式: 摘要 | 列表 ]