Windows Process Execution on PHP with Double Quotes
Posted on 2009-01-19 • (0)
I had a so-called “poll” on Win32 PHP (chinese only), which actually was simply a nag of problems writing code on PHP with cross-platform support (Windows and Linux are in my mind), especially when dealing with file system and command execution — without telling in detail. The complaint had been well hidden in another blog post, but since I don’t want to dive into unconstructive criticism, I just refrain from posting the whole thing here without digging into detail. Until now. That’s lucky, as some more information is revealed, and the situation is not as crappy as I expected. Here goes the first one.
Problem executing commands with more than 2 double quotes
The most frequently used command execution functions in PHP include exec(), system() and so on. They have a common problem: no more than 2 double quotes allowed. For example:
<?php system('"C:\Program Files\ImageMagick\display.exe" "C:\Document and Settings\user\Great Pic.jpg"'); ?>
Such commands are actually pretty common, with space in program path as well as arguments that followed. Regardless of program execution privilege or whatever, the system() itself already fails.
People used to know this for 2 years or more, yet no cure exists. Funny schemes were invented to circumvent such problem, there are at least 2 on PHP website comments:
[......]
WordPress plugin: 密碼提示
Posted on 2008-08-11 • (0)
反正是睡不着,所以快手地寫了個甚為簡單的 WordPress plugin,是在有密碼保護的文章中加上密碼提示的。之前嘗試貼出有密碼保護的文章時,要在另一個 post 給予提示,頗為不方便。這個 plugin 已經想做很久了,但一直沒有下定決心,趁這點點空閒寫了出來,(Continue reading…)
Showing WordPress private posts in calendar and archive
Posted on 2008-06-21 • (1)
Most WordPress users might have written something they don’t want to share at all, that is called private post. However that feature poses some [......]
超嚴重 memory leak
Posted on 2007-11-13 • (4)
怎麼想也想不通,為甚麼用 GTK+ 的程式會變得那麼恐佈。兩三天前試寫一個空白的 GTK+ window,然後用 valgrind 檢查一下(萬分感謝 valgrind),肯定的 memory leak 是 0 byte,但只要隨便加一個 widget 上去,情況就失控了:
沒有 widget
[......]
初步解碼成功!
Posted on 2007-10-25 • (0)
終於成功突破第一個難關。現在不需要依賴 sniffer,可以直接接駁伺服器傳送資料了。
0035577
0035578
0034
4980
0024,GDCTRpCcNW.mFY5A55u1DbA-,HUMAN,0,0,http://hk.yimg.com/i/ga/img_no_profil[......]
被 Google Code 和 Ubuntu 擺了一道
Posted on 2007-10-15 • (2)
搞 software project,其中一種最怕的情況就是 toolchain 出問題。例如 compiler 有 bug, libtool/automake/autoconf 亂來等等都是很難追查的。今天遇到的,雖然不是棘手得很過份,但也算是 toolchain 的一部份吧。
第一個是 subv[......]
GNOME panel analog clock
Posted on 2007-10-12 • (4)

I’ve been using for vertical panel for quite a while, and keep wondering why those GNOME people removed analog clock entirely and don’t e[......]