PHP分類文章 顯示方式:簡文 | 列表

2007年03月20日

PHP 實踐 mix-in 概念 part 2 - MixableClass

php mix-in delegate ruby

第一部份《PHP 實踐 mix-in 概念之可行性》一文中解釋了 PHP 的個體如何加入新的方法。但那僅針對個體而非類別,那些混成內容無法繼承再用。而 Ruby 的混成(mix-in)概念是針對類別,其混成結果是一個類別,這些混成內容可經繼承機制再用。所以我接下來就要為 PHP 實踐一個可以混成的類別 - MixableClass

我的設計目標有二。第一、個體可以動態增刪方法,且不影嚮其他個體。第二、以抽象化方法混成新的類別。

...繼續閱讀

Posted by shirock at 樂多Roodo!14:48回應(9)引用(1)

2007年03月19日

Read an uploaded spreadsheet document by php-SpreadsheetReader

php library

In PHP, the global array $_FILES will contain all the uploaded file information. However, the temporary filename of the file in which the uploaded file was stored on the server is not the same as source filename. If you pass the temporary filename to SpreadsheetReaderFactory, it could not detect which reader to suit.

...繼續閱讀

Posted by shirock at 樂多Roodo!11:32回應(0)引用(0)

2007年03月17日

php-SpreadsheetReader

php library 自由軟體
Update: 2007/07/02

A PHP library for read spreadsheet files

PHP library for read data of spreadsheet files. It supports OpenDocument Spreadsheet (.ods), Microsoft Excel 97/2000 (.xls), CSV (.csv), and Text with tab-separated or patterns (.txt).

Use this command to anonymously check out the latest project source code:

 svn checkout http://php-spreadsheetreader.googlecode.com/svn/ php-spreadsheetreader

Current download link: SpreadsheetReader_rev-25.zip

This proejct is hosted in php-spreadsheetreader - Google Code. It is issued on under the GNU Lesser General Public License. For further information click here.

...繼續閱讀

Posted by shirock at 樂多Roodo!10:41回應(4)引用(3)

2007年03月8日

以 PHP 實踐 HEMiDEMi JSONP - 誰收藏/迴響討論本文

php json ajax

不久前,我寫了《網路服務與純 JavaScript 應用之 JSON 資料包裹解決方案:基礎概念Google的方式》,其中就以HEMiDEMi 書籤服務為主要案例討論如何可以增加查詢服務之使用彈性。我前兩篇談的 JSON 資料包裹,又稱 JSON with Padding (JSONP)

...繼續閱讀

Posted by shirock at 樂多Roodo!10:09回應(0)引用(0)

2007年03月7日

PHP 實踐 mix-in 概念之可行性

動態語言 php ruby

最近在學習 Ruby 的過程中,接觸到'Mix-in' (混成) 這個新名詞。雖然是個新名詞,但其概念嚴格說來並非 Ruby 所獨有。

Mix-in (混成) 之基本概念在令行為抽象化,使其與特定類別或實例無關。我們再將這些抽象行為組成新的類別或個體。早期的模組化編程概念,其實就已經建立了這種概念, Ruby 則是聰明而有效結合模組與類別,增加許多設計彈性。

...繼續閱讀

Posted by shirock at 樂多Roodo!22:56回應(0)引用(5)

2007年03月6日

PHP 臭蟲月開跑,快去查看自己的 PHP 程式是否有漏洞

Tags: php 資訊安全

由 PHP 資安團隊 Hardened-PHP Project 支持的 month of PHP Bugs 開始了,不到一週已經公布了十筆以上的 PHP 安全漏洞。 PHP 的使用者快去查看自己的 PHP 程式是有否漏洞。

我大略看了一下,去掉那些罕用功能之漏洞,到目前為止有不少一般性的安全漏洞集中在 PHP4 。想想目前多數虛擬主機供應商仍只提供 PHP4 服務,真要為其中運作的 PHP 網站系統之安全性捏一把冷汗。

有兩個結構性的 crash bug: PHP Executor Deep Recursion Stack OverflowPHP Variable Destructor Deep Recursion Stack Overflow。前者是遞迴深度、後者是巢狀陣列深度,這兩個安全漏洞與函數調用層數過深導致堆疊溢位有關。這是 PHP 解譯器的結構性問題 (其實每種程式語言都會有這類問題與相應限制) ,照 month of PHP Bugs 中透露的消息來看,短時間內 PHP 開發團隊還不會做出相關修正。


Posted by shirock at 樂多Roodo!10:20回應(0)引用(0)

2007年02月27日

CDD 式的 Framework - Andromeda

TWPUG.net (以定義為基礎的程式架構 - Andromeda) 提到一個 Configuration Driven Development 的 Framework: Andromeda。 Andromeda 開發流程像是在塑模,然後自動產生應用程式。讓我覺得像在 Eclipse 上用 UML 塑模然後產生程式碼一樣。所以我覺得它像是 application platform ,而不像是 framework 。而它在處理 Object/Relationship Mapping 時用自創的語法,不是中介資料格式、不是 UML 、不是 SQL 也不是 PHP 。這麼做有沒有好處呢?目前我還看不出來。


Posted by shirock at 樂多Roodo!11:19回應(0)引用(0)

2007年02月14日

To Ruby From PHP, 中譯

php ruby

PHP 普遍應用於 web 應用軟體環境中,但若你想用 Ruby on Rails 或只是想找一個更適於處理廣泛用途的語言, Ruby 值得看看。

...繼續閱讀

Posted by shirock at 樂多Roodo!21:01回應(3)引用(1)

2007年02月9日

Development within Eclipse PHP IDE (PDT)

php eclipse pdt ide debugger

今天在 IBM developerWorks 的 Open Source 專區中看到《PHP development within Eclipse》這一篇文章。看了一下,原來在介紹 Eclipse 中的 PHP IDE project 。文章中使用的版本和我現在用的版本一樣 (去年12月釋出) 。我使用 PHP IDE project 後,覺得跟 Java/CDT 比起來功能還是很陽春,編輯功能也不算順手。所以目前我仍然使用 PSPad 作為程式編輯器。

順道看了一下 PHP IDE project 的網站,發現計劃名稱改為 PDT (PHP Development Tool) 了。以下就用 PDT 稱呼 PHP IDE 。
...繼續閱讀

Posted by shirock at 樂多Roodo!9:46回應(4)引用(1)

2007年01月30日

活用 PHP5 的 magic methods - __set(), __get() and __call()

php5 refactoring overloading magic_method

PHP5 在動態性及個體導向兩方面都做了大幅度的加強。其中 Magic methods 概念的引用,更為 PHP5 帶來許多靈活性。

本文說明如何活用 Magic methods 重整 (refactoring) 程式碼。讓 PHP 的程式碼更易於使用。主要重點在 __set(), __get() ,同時也示範了 __toString(), __isset(), __call() 的用途。

...繼續閱讀

Posted by shirock at 樂多Roodo!23:20回應(0)引用(1)
 [第一頁]  [1]  [2]  [3]  [4]  [5]  [6]  [7]  [8]  [最終頁]