最近沒空寫東西了,光文件就快讓我忙不過來了。
再搜集幾個連結,有些是從 Neo 的「用 PHP 實作 ActiveRecord 」那邊看來的:
PHP
-
和我的實作滿像的,不過有用到 Reflection API 。另外看了人家的程式後,我發現我的實作忘了要 return 結果。
-
這個有用到 runkit 。
-
解釋了為什麼 Ruby 適合實作 ActiveRecord ,但是 PHP 則很難實現。不過 PHP 不好做的話也別氣餒, Zend Framework 的 Table Data Gateway 和 Row Data Gateway 就是一種不錯的實作了。
-
PHP != Ruby (and why PHP needs more advanced OO stuff)
從上一篇延伸而來的,作者解釋可以用 runkit 來實現很多 PHP 原來做不到的事情,用排序來做為範例。
-
PHP and ActiveRecord (continued)
PHP and ActiveRecord 的作者又根據上篇文章回應了,他是希望 PHP6 可以加入一些真正有用的功能。可以參考:What PHP6 Actually Needs 。
-
pTest: PHP Unit Tester in 9 Lines Of Code
九行實作一個測試用的 assertTrue 函式。
1 2 3 4 5 6 7 8 9 10 11 12 13
/** * pTest - PHP Unit Tester * @param mixed $test Condition to test, evaluated as boolean * @param string $message Descriptive message to output upon test */ function assertTrue($test, $message) { static $count; if (!isset($count)) $count = array('pass'=>0, 'fail'=>0, 'total'=>0); $mode = $test ? 'pass' : 'fail'; printf("%s: %s (%d of %d tests run so far have %sed)\n", strtoupper($mode), $message, ++$count[$mode], ++$count['total'], $mode); } -
介紹一些 Zend Framework 和 Ajax 的結合,有範例可以下載參考。
-
PHPRPC and PHP frameworks
把 PHPRPC 提交到目前作者認為是 PHP 主流的框架與類庫裡。這個 PHPRPC 好像跟對岸 andot 開發的 PHPRPC 兩者是不一樣的東西?
CSS
-
如何在不使用 first class 或 CSS pseudo selector 的情況下,把第一個元素的背景隱藏起來。
-
如果常常煩惱怎麼讓輸入欄位的寬度自動符合視窗寬度的話,這篇可以參考看看。
Windows
-
Create and delete users using windows scripting host (jscript)
用 Windows Scripting Host (JScript) 來新增、刪除 Windows 使用者。