大家好,第一次写博文有不好的地方请提出来谢谢
首先phalanger 是一个把 php编译成.net 的中间语言(Microsoft 中间语言 (Microsoft intermediate language, MSIL))自
然效率会有一定程度的提升,这个是一个开源(阿帕奇)项目,有兴趣的可以看看源代
码。Phalanger与PHP 5.0兼容,并且能结合PHP和.NET两者的对象。在新版的
phalanger3.0 中支持了命名空间,所以我们可以直接调用.net的东西了,他们的网站
(http://www.php-compiler.net/) 所使用的Wiki程序 DokuWiki 就是PHP程序通
过Phalanger运行在.NET上,你应该很有兴趣去看看,感受一下.NET下的动态语言。
我猜你们会想到跨平台的问题,不用担心这个phalanger是完全.net(c#)下的产物,我
们可以用mono来运行,有兴趣的朋友可以点入连接看看。
phalanger不仅能编写网页,也可以编写windows的窗体程序如图
这个界面完全可以用代码管理 部分代码如下
$this->button1 = new \System\Windows\Forms\Button();
$this->SuspendLayout();
//
// button1
//
$this->button1->Location = new \System\Drawing\Point(0, 0);
$this->button1->Name = "button1";
$this->button1->Size = new \System\Drawing\Size(75, 23);
$this->button1->TabIndex = 0;
$this->button1->Text = "button1";
$this->button1->UseVisualStyleBackColor = true;
$this->button1->Click->Add(new \System\EventHandler(array($this, "button1_Click")));
//
// Form1
//
$this->AutoScaleDimensions = new \System\Drawing\SizeF(6, 12);
$this->AutoScaleMode = \System\Windows\Forms\AutoScaleMode::Font;
$this->ClientSize = new \System\Drawing\Size(292, 266);
$this->Controls->Add($this->button1);
$this->Name = "Form1";
$this->Text = "Form1";
$this->ResumeLayout(false);
直接用对象的方式管理就可以
相信大家看完会对phalanger有初步的认识,我会在近期进一步介
绍的
打个小广告:我的网店 袋鼠窝