blog.Ring.idv.tw

2007 October

REpresentational State Transfer (REST)

REST(Representational State Transfer)這個名詞是在西元2000年由Roy T. Fielding在他的博士論文「Architectural Styles and the Design of Network-based Software Architectures」所提出來的,你可以從REST wikipedia發現更多的相關資源~

順便透露一下,這裡提供了一本「 OReilly.RESTful.Web.Services.May.2007」電子書供下載~

相關資源

什麼是REST跟RESTful?

REST簡介Building Web Services the REST Way

2007-10-30 17:17:12 | Add Comment

Google AJAX Search API

Google提供了一組Google AJAX Search API,可以將它整合到自己的Blog中~ 提供的功能還包含了Local Search、Multimedia Search,比先前的Google Search API所提供的功能多了不少~

如果你想客製化地整合到Web上~ Miro, Ajaxlets and the Google Custom Search API這篇文章有提供一些實用的範例~

2007-10-16 12:11:35 | Add Comment

Web Service之SOAP與REST

由於有好一陣子沒有在注意Web Service領域的變化~ 剛剛看了一些SOA的相關文章~ 正好看到一篇評論SOAP與REST的文章,有興趣的朋友可以參考「REST 的口水正在洩洪」,如果你對Web Service及REST還沒有任何概念的話~ 也可以參考「網路服務的介紹」或是「SOA Using Java Web Services, Chapter 3」。

BTW, Zend Framework已經提供了一套Zend_Rest的Library可供使用,有機會再來玩玩~

2007-10-15 00:52:39 | Add Comment

PHP連結FoxPro

請先參考「Java連結FoxPro(ODBC)」將你的Foxpro驅動程式裝好並設定ODBC資料來源,由於Zend Framework沒有提供ODBC的library供使用~ 所以下述範例直接用PDO object來達成我要的需求。

Foxpro範例

try
{
	//$db = new PDO("odbc:Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=C:\bnc");
	$db = new PDO("odbc:BNC");
	$sql = "SELECT * FROM test";
	foreach ($db->query($sql) as $row)
	{
		print_r($row);
	}
}catch (Exception $e)
{
	echo $e->getMessage();
}

2007-10-12 16:49:02 | Add Comment

使用Zend_Mail透過Google GMail來寄信

剛試出來的一個小範例,使用Zend Framework所提供的Zend_Mail來寄信~

而所指定的SMTP就是要透過Google的Gmail來寄信~

在使用這個範例之前~ 由於Gmail必須透過加密傳輸~ 所以請確認你已經為PHP安置好OpenSSL

程式範例如下:

require_once 'Zend/Mail.php';
require_once 'Zend/Mail/Transport/Smtp.php';

$config = array(
'auth' => 'login',
'username' => '你的帳號',
'password' => '******',
'ssl' => 'tls',
'port' => '587'
);

$transport = new Zend_Mail_Transport_Smtp('smtp.gmail.com', $config);

$mail = new Zend_Mail('UTF-8');
$mail->setBodyText('This is the text of the mail.');
$mail->setFrom('xxx@gmail.com', 'Some Sender');
$mail->addTo('xxx@gmail.com', 'Shen');
$mail->setSubject('Zend Mail!');
$mail->send($transport);

參考資源:

Zend_Mail - how to use Zend_Mail_Transport_Smtp for googlemail.com

2007-10-12 12:21:26 | Add Comment

Previous Posts
Copyright (C) Ching-Shen Chen. All rights reserved.

::: 切換內文字級 :::

::: 分類 :::

::: 搜尋 :::

Ching-Shen Chen

::: 文件歸檔 :::

::: 最新文章 :::

::: 最新回應 :::

::: 訂閱 :::

Atom feed
Atom Comment

::: 人氣指數 :::

今日人氣:215

累積人氣:898925


::: 線上人數 :::

counter