PHP中,使用ADODB做数据库开发时,adodb.dll的使用方法
1、系统环境
System Windows NT EPEENLRCBBOOUNP 5.1 build 2600
Build Date Sep 5 2005 15:50:13
Configure Command cscript /nologo configure.js "--enable-snapshot-build" "--with-gd=shared"
Server API Apache 2.0 Handler
Virtual Directory Support enabled
Configuration File (php.ini) Path C:\WINDOWS\php.ini
PHP API 20031224
PHP Extension 20041030
Zend Extension 220040412
Debug Build no
Thread Safety enabled
Zend Memory Manager enabled
IPv6 Support enabled
Registered PHP Streams php, file, http, ftp, compress.zlib
Registered Stream Socket Transports tcp, udp
2、下载adodb.dll
http://adodb.sourceforge.net/
Speed Up Your PHP Code with the ADOdb extension
下载Adodb-ext-503.zip provides up to 100% speedup by replacing parts of ADOdb with C code. ADOdb will auto-detect if this extension is installed and use it automatically. This extension is compatible with ADOdb 3.32 or later, and PHP 4.3.*, 4.4.*, 5.0.* and 5.1.*. Source code for all platforms and and binaries for Windows included.
27 July 2005, released 4.4 and 5.1 compatible versions.
29 Nov 2004, released thread-safe PHP4 and PHP5 compatible version, with fewer dll dependancies. PHP 5: tested on RedHat8 on WinXP. PHP 4.3.3: tested on RedHat8, WinXP and Win2000.
也就是说:这只是一个进行加速的扩展,并不是全部,和一般的PHP扩展是不同的(如:php_mysql.dll)。主要功能还是通过PHP代码来实现的。它是用C替换了部分功能,然后ADOdb会自动检测是否安装了这个扩展,并且自动地使用它。
3、加载adodb.dll
拷贝:下载解压后,拷贝D:/adodb-ext-503/adodb-503/php-win-5.0.3-5.0.4/adodb.dll 到 C:/php/ext
配置:extension=adodb.dll
重启:Apache 重启
查看:phpinfo()显示:
ADOdb
Info Extension requires ADOdb classes
Download http://adodb.sourceforge.net/
API Version 5.01
结论:加载成功!
4、查看模块方法
print_r(get_extension_funcs("adodb"));
显示:
Array
(
[0] => adodb_movenext
[1] => adodb_getall
)
该模块只有两个方法。如果没有包含adodb.inc.php就调用ADONewConnection方法,就会有 Call to undefined function: adonewconnection() 的错误报告。
不错!
回复删除