Zend nets $20 million in funding

Posted on 29th August 2006 by Nio in 程序人生

Zend nets $20 million in funding

Zend, which commercializes the widely used open-source PHP software that lets computers create customized Web pages, has received a $20 million boost through a fourth round of funding. Graylock Partners led the round, with contributions from earlier investors such as Azure Capital Partners, Index Ventures, Intel Capital, Platinum Venture Capital, SAP Ventures and Walden Israel Venture Capital, the company plans to announce Monday.

Zend will use the funding to expand internationally and to speed product development, co-founders Andi Gutmans and Zeev Suraski said in a statement. In addition, Greylock partner Moshe Mor has joined the board, the company said.

公司招人中……

Posted on 28th August 2006 by Nio in 工作忙碌, 程序人生

公司正在招聘 PHP WEB 开发人员,决定在自己的 BLOG 也发个看看有没有人来 :)

【发布日期】:2006年8月28日
【截止日期】:找到合适的为止
【公司网站】:http://www.k12.com.cn
【电子邮件】:krazynio@hotmail.com (有意向者可直接通过此 MSN 与我联系)

【招聘职务】:WEB 开发人员一名
【学历要求】:不限
【能力要求】:精通 PHP、MYSQL、HTML、CSS、JavaScript 等 WEB 开发。热爱编程工作,有较强的学习能力、交流能力及团队协作精神。有大型网站程序的开发经验优先。

【薪资待遇】:面谈
【工作地点】:北京朝阳区芍药居现代文学馆内

Declare Variables Inside or Outside a Loop

Posted on 23rd August 2006 by Nio in 程序人生

Declare Variables Inside or Outside a Loop

The question of readability is more religious but does have a little to do with performance. The question about memory and performance goes hand in hand and can be shown definitively. I am going to go through both questions and show the difference from the byte code level using javap. I am not a byte code expert but I will do my best to explain the code properly. If there is an error in my explanation please let me know.

Introduction to PHPUnit

Posted on 22nd August 2006 by Nio in 程序人生

Introduction to PHPUnit

In the last decade, PHP has developed from a niche language for adding dynamic functionality to small websites to a powerful tool making strong inroads into large-scale, business-critical Web systems. Financial institutions such as banks and insurance companies use PHP, for instance, to develop and maintain solutions for Basel II Credit Rating. Critical business logic like this needs to work correctly. But how do you ensure that it does? You test it, of course.

Check your PHP code at every level with unit tests

Posted on 18th August 2006 by Nio in 程序人生

来自 IBM 的文:Check your PHP code at every level with unit tests。此文建议对 PHP 的模块、数据库操作、用户界面等各个层次都进行单元测试,文中使用的当然是 PHPUnit 了,呵呵。

Test-driven development and unit tests are the latest way to make sure your code is behaving as you expect through changes and refactoring. Find out how to unit test your PHP code at the module, database, and user interface (UI) level.

有时候数据库操作的测试并不是那么容易进行,因为至少需要有测试数据库,如果是团队开发的话,还需要保证测试数据不会被多人同时操作,否则测试结果就会多变,最好是能够创建自己独自使用的数据库来进行测试。另外,测试之后必须保证数据恢复原样,或者是在测试之前对数据库进行一定的数据初始化工作,使其趋于稳定,以免同一测试脚本多次测试的结果不一致。

UI 测试是比较头疼的,测试原理是通过访问特定地址,获取页面 HTML 源代码(本文中用 HTTP_Client 获取),然后使用正则表达式来对其进行检查。为了方便测试,通常会对需要测试的目标数据添加规范化的 HTML 标签,以至于正在表达式能够较为容易地将其匹配出来进行检查。使用正则表达式匹配有一个重要的环节就是检测匹配数目是否唯一,比如同一个页面中,不小心对两个或多个测试检测目标使用了完全相同的标签代码,这样匹配出来的结果就会有多个,而我们习惯使用第一个进行检测,而这个未必就是我们想要的那个。所以对于正则表达式的匹配结果,最好进行一下匹配数目的检查,比如此文中的一个例子就疏忽了这一点:


<?php
  function test_add()
  {
    $page TestPage::get_page'http://localhost/unit/add.php?a=10&b=20' );
    $this->assertTruestrlen$page ) > );
    $this->assertTruepreg_match'/<html>/'$page ) == );
    preg_match'/<span id="result">(.*?)</span>/'$page$out );
    $this->assertTrue$out[1]=='30' );
  }
?>

就应该对


<?php preg_match'/<span id="result">(.*?)</span>/'$page$out ); ?>

增加一项匹配数目的测试检查:


<?php $this->assertTruepreg_match'/<span id="result">(.*?)</span>/'$page$out ) == ); ?>