ExtPascal安装手册简介 安装手册简介
简介 · ExtPascal是ExtJS的包装/绑定。 ExtPascal让您通过服务器使用ExtJS,使用面向对象Pascal语法命令。这为Web浏览器编程语言带来了结构性以及严格的Pascal语法。 · 其主要优点是: · 使用您喜欢的语言(Object Pascal)的,您有较高的生产力,而不是使用JavaScript和PHP,HTML和/或CSS。 · 使用一个强类型语言的本土和编译的代码。也就是说,许多错误是由编译器直接任命,不用浪费时间在浏览器中测试。 · 使用代码完成(智能感知),现在很多IDE都有这个功能(Delphi/lazarus)用来提供更多的生产力。 · 在服务器上集中编程,JavaScript和HTML是动态语言编程,使开发更轻松,更分散。 · 业务规则可以使用Object Pascal封装在服务器中,而不是在JavaScript中可见。 · 易于在Delphi /lazarus/MSEide / FPIDE调试。 先决条件 · 可选Windows,Linux,MacOS X或FreeBSD的机器。采用英特尔/ AMD的32位和PowerPC已经测试通过,这些处理器同样也支持FreePascal。 · 可选的网页浏览器:IE 6 +,Firefox 1.5+,Chrome 2 +,Safari 3 +,Opera9 +或其他兼容的浏览器。 JavaScript和Cookies应该设置为启用。 · 下载并安装Apache 2.2或更高版本,但是Apache 1.3和IIS在ExtPascal工程中使用CGIGateway,见下文。 · 对于本机的FastCGI运行下载和安装的Apache 2.2的FastCGI。见下面详细说明。对于通过CGIGateway设置在Apache或IIS FastCGI的见下面详细说明了。 · 下载ExtJS的3.2.0。 · 在安装Apache的文档根目录下面安装ExtJS(通常在htdocs中)在文件夹ext,如果您的Apache在D盘,应该是如下设置: · D:\Apache Software Foundation\Apache2.2\htdocs\ext · · 在Windows下安装Delphi(7..2010)或FreePascal与lazarus0.9.28 +或者MSEide 2.0 + 2.4.0。我曾用过Turbo Delphi,FreePascal 2.2.4和MSEide 2.0。 · 对于POSIX系统(Linux,MacOS下,BSD系统,Solaris等)安装lazarus0.9.28 +或MSEide 2.0 + FreePascal 2.4.0。我使用FreePascal 2.2.4和MSEide 2.0。 · 使用SVN下载ExtPascal(见说明)工作目录,例如:C:\ ExtPascal。 · 在ExtPascal包中,复制codepress文件夹,到/htdocs/ext文件夹中。 第一步 01. 使用您喜爱的ObjectPascal IDE打开ExtPascalSamples目录里面的ExtPascalSamples工程文件。 02. 在 Delphi 设置 Syntax 选项 (菜单 \Project\Options\Compiler): OFF Strict var-strings OFF Complete boolean eval ON Extended syntax OFF Typed @ operator ON Open parameters ON Huge strings/Long strings by default ON Assignable typed constants 03. 在 Lazarus 设置Parsing options (菜单 \Project\Compiler Options\Parsing): Syntax mode: 'Delphi' ON C++ Styled INLINE ON C Style macros OFF Constructor name must be init OFF Static Keyword in Objects ON Use Ansi Strings 04. 在 FreePascal 或者 MSEide 里面,使用 -Smdghie50 -venwhi -l 作为 compiler 选项.加入这些选项 -O2pPENTIUM4 -CXpPENTIUM4 -XXsi -CfSSE 到 release/final 版本。 05. 编译ExtPascalSamples 通过CGI gateway设置FastCGI (任何 Apache 版本以及IIS相似过程) 01. 打开CGIGateway.dpr. 02. 如果有必要修改Port constant, 默认 2014. 03. 编译. 04. 拷贝 CGIGateway.exe 到 cgi-bin 目录. 05. 打开您的 FastCGI 应用程序 (在这里是 CGIGateway.dpr). 06.有必要可以修改端口, 默认 2014. 在代码底部: Application := TFCGIApplication.Create('ExtPascal Samples ' + ExtPascalVersion, TSamples, 2014, 5); 07. 编译. 08. 拷贝您的 FastCGI 应用程序到 cgi-bin 目录. 如果是 Posix (non-Windows) 平台用 .fcgi 扩展名. 09. 把CGIGateway.exe改成 ExtPascalSamples.cgi 或者其他Web Server扩展名作为CGI应用程序。 10. 跑这个例子, 举例, 在cgi-bin(Apache/cgi-bin)目录有下面文件: ExtPascalSamples.exe // The real FastCGI application. The extension is `.fcgi` for Posix platforms. ExtPascalSamples.cgi // The CGI Gateway. 11. 可以不在 Apache or IIS配置第11步, 但是我推荐您使用HTTP压缩来提高性能 (on IIS 也一样). 12.在浏览器中输入如下地址: http://localhost/cgi-bin/ExtPascalSamples.cgi //执行这一步,请先在Apache下设置FastCGI,并启动Apache 13. ExtPascalSamples.cgi (the gateway) 自动找到 ExtPascalSamples.exe (the real FastCGI application). 在Apache 2.2+设置FastCGI 01. 下载CGI模块: http://www./dist/mod_fastcgi-2.4.6-AP22.dll 02. 重命名为 mod_fastcgi.so 03. 拷入到Apache目录 (by example c:\apache\modules) 04. 在 httpd.conf 文件 (Apache's conf folder) in LoadModule session insert the line below: LoadModule fastcgi_module modules/mod_fastcgi.so 05. 声明 FastCGI application 作为内部服务, 在 httpd.conf加入如下: fastcgiexternalserver cgi-bin/ExtPascalSamples –host localhost:2014 –idle-timeout 3 CAUTION: 不要在Google Wiki下粘贴上面的代码(Google wiki uses the char 150 and the true hifen char is 45). 06. cgi-bin/ExtPascalSamples 是URL,您通过浏览器调用 ExtPascal 程序. 拷贝可执行文件到cgi-bin目录下面并不重要。URL是大小写敏感的。 07. –host 参数定义了FastCGI application主机 (by example localhost). 08.默认 TCP/IP 端口是 2014, 你可以在源码中修改,已改变端口. 09. 手工启动 FastCGI 程序,配置好参数后启动Apache. 10. 在你的浏览器下输入如下地址: http://localhost/cgi-bin/ExtPascalSamples 11. 查看FastCGI docs获取更多信息。 12. 我推荐你使用HTTP 压缩来提高性能,查看如下文档 Advanced configuration. --Smartsoft Modify in Guangzhou, 2010-04-13 XAMPP Apache 不兼容mod_fastcgi/ExtPascal?.如果您在第10步遇到 404 error ,请参照 "在Apache 2.2+设置FastCGI", try WampServer? 2 or raw Apache installation. |
|
来自: 双子斋 > 《extpascal》