php代码美化程序PHP_Beautifier试用手记

在pear的rss列表上看到了PHP_Beautifier 0.1.1 beta发布,便下载回来试用:
>>pear install PHP_Beautifier
………………………………………..

顺利完成,看了下帮助,还带有命令行工具,方便:

D:xamppphp>php_beautifier –help

Usage: php_beautifier [options]
and/or can be ‘-‘, which means stdin/stdout.
you can use ? and * for batch processing
can be a dir (ending with ‘/’ or a real dir)
or a file (without ‘/’)
multiple ins and one out = merge all files in one output
Options:
–input or -f input file – default: stdin
–output or -o output dir or file – default: stdout
–indent_tabs or -t indent with tabs
–indent_spaces or -s indent with spaces – default
–filters or -l Add filter(s)
–directory_filters or -d Include dirs for filters
–compress or -c Compress output
–recursive or -r Search in subdir recursively
–help or -? display help/usage (this message)

Filter definition:
–filters "Filter1(setting1=value1,setting2=’value2′) Filter2()"

不过试用下来,处理的不是太完美,比如复杂点php代码美化后不整齐之类的,期待更好的版本出现 [@more@]

好久没玩flash

抓紧时间操练了一把,用下面代码作了一个粉简单的坦克控制:)

[actionscript]
class Move extends MovieClip {

private var speed = 3;
private var xMin = 0;
private var yMin = 0;
private var xMax = 400;
private var yMax = 400;

public function onLoad(){
Key.addListener(this);
this.xMin += this._width/2;
this.xMax -= this._width/2;
this.yMin += this._height/2;
this.yMax -= this._height/2;
}

public function onEnterFrame(){
if( this._x < this.xMin ){ this._x = this.xMin; } if( this._x > this.xMax ){
this._x = this.xMax;
}
if( this._y < this.yMin ){ this._y = this.yMin; } if( this._y > this.yMax ){
this._y = this.yMax;
}
}

public function setSpeed(speed:Number){
this.speed = speed;
}

public function onKeyDown(){
switch(Key.getCode()){
case 83: // s
this._rotation = 180;
this._y += this.speed;
break;

case 65: // a
this._rotation = -90;
this._x -= this.speed;
break;

case 68: // d
this._rotation = 90;
this._x += this.speed;
break;

case 87: // w
this._rotation = 0;
this._y -= this.speed;
}
}

private function onRelease(){
trace(’test’);
}
}

[/actionscript]

PRADO v2.0RC发布

PRADO v2.0RC发布,还不是稳定版本,但是可以尝试一下.更新如下:

[@more@]

– Added I18N, L10N support (with several relevant components)
– Added TDataGrid, TTable, TDataList, TWizard, TRequiredListValidator controls
– Implemented viewstate manager handler
– Implemented enumerable property type
– Changed the way of including a parameter file within another one
– Added EncodeText property to controls with Text property
– The parameter of TComponent::removeChild() is changed to component from ID
– Control state synchronization is done in addBody() now (instead of addChild())
– Control viewstate maintenance is now based on container-containee relationship
– TComponent::addParsedObject() is now invoked when parsing an object
– List control now renders values instead of indexes
– Implemented TCollection class, Bodies property of TControl
is now of type TCollection that allows insertion
– Added Datalist, Datagrid and I18N examples
– Implemented feature 1093392: Better package layout
– Implemented feature 1094956: display spaces
– Implemented feature 1102525: Module spec file
– Fixed bug 1093843: TRepeater::getItemCount() returns wrong value
– Fixed bug 1094219: TDateFormat patterns missing
– Fixed bug 1093018: Translation table cache and php open tag
– Fixed bug 1091966: Error handler doesn’t make allowances for @ operator
– Fixed bug 1100512: Controls losing viewstate
– Fixed bug 1103937: TListControl fatal error within TDataList
– Fixed bug 1099808: TTextBox: Slashes won’t be stripped
– Fixed visibility bug related with selection controls

让editplus的Function list显示php5的函数

如果你开始使用php5了,而且正好又是editplus的忠实用户,一定会为editplus的function列表无法正确显示而烦恼.这时候,我们不能怨社会,php5新增的public,private,proctectd,static关键字才是罪恶的根源,function不再是function,而是public function….

当然,这一切不会难倒我们,editplus具有很好的可定制性,以下步骤可以轻松解决这个问题:

  • 打开tools->perferences->Files->Setting&syntax
  • 选择File types->PHP
  • 修改Function pattern
    ^[ t]*function[ t].*([^;]*$ 变成 ^[ t]*(function |public |protected |private |static).*([^;]*$
  • 点ok保存设置

好了,按下ctrl+F11,看看函数窗口,有没有显示出所有的函数呢?

[@more@]

中文pear

php的pear类库真是包罗万象,我时常想.

用过之后,我发觉自己是越来越懒惰了,没心思去写一些模块和function之类的.为什么不呀,人家pear不有现成的么??

为了强化记忆,与时俱进,加入中文pear部分,收罗中文的关于pear的文章.

rss阅读工具

今天换上了SharpReader作为新闻阅读工具,试用了1小时,好用且免费.

此前用过Thurdbird,但是使用起来总有些bug,例如重复收取同一个新闻,无法自动更新等等,很郁闷.还有一款叫Feeddemon,试用起来也还顺手,但是并非免费软件,很是郁闷.

[@more@]

在apache上给一个虚拟主机同时绑定两个端口

今天给同一虚拟主机添加了两个端口,过程如下:[@more@]

今天给同一虚拟主机添加了两个端口,过程如下:

绑定端口为:80,8080

1.在httpd.conf中添加:

Listen 8080

2.复制原虚拟主机配置

 

以下是代码片段:

<VirtualHost *:80>

…..

</VirtualHost>

添加:

 

以下是代码片段:

<VirtualHost *:8080>

…..

</VirtualHost>

但是实际上有更简化的写法:

以下是代码片段:

<VirtualHost *:80 *:8080>

…..

</VirtualHost>

 

重启apache观察配置是否生效