跳轉到內容

Clipper 教程:開源 Clipper(s)/Web 應用程式指南

來自華夏公益教科書,開放世界開放書籍

什麼是 Web 應用程式?

[編輯 | 編輯原始碼]

Web 應用程式是指在瀏覽器(“客戶端”)中顯示其輸出並與由另一個程式(“Web 伺服器”)管理的資料進行互動的應用程式,該程式通常在另一臺計算機上執行(當我們進行測試時,我們可能會在同一臺機器上同時擁有客戶端和伺服器)。

像 Google、雅虎郵箱、Facebook、Twitter、亞馬遜這樣的網站,以及 CMS 平臺(例如 WordPress、Joomla、Drupal)和線上遊戲(例如“魔法門”、“帝國時代”或“海戰”)都提供了 Web 應用程式。

在它們的最早形式中,Web 應用程式是 CGI 指令碼,Harbour 提供了一個類來使用此協議(參見 https://github.com/harbour/core/blob/master/contrib/hbtip/cgi.prg),以及一個示例,展示瞭如何使用一個類來使用此協議(https://github.com/harbour/core/blob/master/tests/html.prg)。

http://www.harbour-project.com.br/samples/testcgi.html,並檢視 http://gnosis.cx/publish/programming/harbour.html 上的側邊框。

一本描述 CGI 程式設計的書的前六章可以從 http://www.cgi101.com/book/ 下載,一個直接的描述可以從 http://www.whizkidtech.redprince.net/cgi-bin/tutorial 處閱讀。

在 Harbour 中提供 FastCGI 的嘗試,請參見 https://github.com/hernad/harbour-fastcgi

然而,CGI 已經過時,原因在以下文章中解釋:https://www.perl.com/article/perl-and-cgi/#why-not-to-use-cgi。此頁面位於 Perl 網站上,因為 CGI 和 Perl 有著強烈的(即使是不恰當的)關聯。

Web 伺服器 Apache 需要 mod_cgi 或 mod_perl 來執行 CGI 指令碼,同樣我們也可以從 https://github.com/FiveTechSoft/mod_harbour 使用 mod_harbour。

部落格現場演示:https://harbour.fourtech.es/modharbour_samples/blog/index.prg 及其完整原始碼:https://github.com/FiveTechSoft/mod_harbour/tree/master/samples/blog

https://github.com/JoseluisSanchez/MVC_Harbour

使用 Apache 的另一種選擇是從 http://www.dbfree.org/home.msp?XY=11421849 下載 DBFree。

華夏公益教科書