BDB官方给PHP提供的接口的程序员真是不负责
刚写完前面的日志,又发现一个Bug:
根据Oracle官方提供的说明:
http://www.oracle.com/technology/documentation/berkeley-db/db/programmer_reference/ext_php.html
class Db4的声明如下:
class Db4 {
function Db4($dbenv = null) {} // create a new Db4 object using
// the optional DbEnv
function open($txn = null, $file = null, $database = null,
$flags = DB_CREATE, $mode = 0) {}
function close() {}
function del($key, $txn = null) {}
function get($key, $txn = null, $flags = 0) {}
function pget($key, &$pkey, $txn = null, $flags = 0) {}
function get_type() {} // returns the stringified database type name
function stat($txn = null, $flags = 0) {} // returns statistics as
// an as
function join($cursor_list, $flags = 0) {}
function sync() {}
function truncate($txn = null, $flags = 0) {}
function cursor($txn = null, flags = 0) {}
}
想测试一下BTREE和HASH方式的性能区别的时候,却怎么也找不到指定数据表类型的参数。有是看php扩展的源代码,居然发现程序是支持的,open的原型应该如下:
function open($txn = null, $file = null, $database = null, $type = DB_BTREE, $flags = DB_CREATE, $mode = 0)
漏的还不是最后一个参数。真够faint的。另外php源码中也没有为DB_BTREE、DB_HASH等类型定义宏。又要自己动手丰衣足食了。
在db4.cpp中增加了声明:
REGISTER_LONG_CONSTANT("DB_BTREE", DB_BTREE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("DB_HASH", DB_HASH, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("DB_RECNO", DB_RECNO, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("DB_QUEUE", DB_QUEUE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("DB_UNKNOWN", DB_UNKNOWN, CONST_CS | CONST_PERSISTENT);
另外未在代码中找到设置Cache以及PageSize的函数。看来这个是真的不支持了。
相关文档:
步骤一:搭建环境
1,首先查看你的php扩展目录下是否有php_gettext.dll这个
文件,如果没有,这就需要你
下载一个或是从其他地方拷贝一个,然后放到php扩展目录。
2,打开php.ini,查
找”;extension=php_gettext.dll“ ,然后去除注释,重启apache。
步骤二:原理讲解
假如你的没
有国际化的程序里有这样 ......
In the directory where you plan to install Elgg, do the following:
Create the file .htaccess and add these two lines
RewriteEngine on
RewriteRule ^testing.php$ modrewrite.php
This tells the webserver to load modrewrite.php when testing.php is
requested.
In order to get this test to work on ......
环境软件版本介绍:
APACHE 2.0.59
PHP5.2.3
MYSQL5.0.45
GD-2.0.35
Zend Optimizer v3.3.0
  ......
header("Content-Type:text/html;charset=utf8"); 放到PHP开头处
$link=mysql_connect("localhost","root","110110");//链接
mysql_select_db("blog",$link);//选择数据库
mysql_query("SET character_set_results=gbk", $link);//字符编码 ......
PHP Code one: //php获取ip的算法
$iipp=$_SERVER["REMOTE_ADDR"];
echo $iipp; PHP Code two: //php获取ip的算法
$user_IP = ($_SERVER["HTTP_VIA"]) ? $_SERVER["HTTP_X_FORWARDED_FOR"] : $_SERVER["REMOTE_ADDR"];
$user_IP = ($user_IP) ? $user_IP : $_SERVER["REMOTE_ADDR"];
echo $ ......