阅读拉里乌尔曼的PHP 5,我被告知安装梨Auth包和梨数据库。梨认证包
据Pear网站介绍,DB软件包已被弃用,以支持MDB2。所以我安装了后者(MDB2)包。
我在运行程序时收到此警告。
Fatal error: Class 'DB' not found in /Users/michaelmitchell/pear/share/pear/Auth/Container/DB.php on line 150
我不知道如果我做错了(如果是的话,是什么?),或者如果验证包以某种方式指的是过时的DB类,或者其他什么东西?
if (!DB::isConnection($this->db)
下面的第三行是DB.php的第150行。谁能帮忙?
function _prepare()
{
if (!DB::isConnection($this->db)) {
$res = $this->_connect($this->options['dsn']);
if (DB::isError($res) || PEAR::isError($res)) {
return $res;
}
}
if ($this->options['auto_quote'] && $this->db->dsn['phptype'] != 'sqlite') {
if (strpos('.', $this->options['table']) === false) {
$this->options['final_table'] = $this->db->quoteIdentifier($this->options['table']);
} else {
$t = explode('.', $this->options['table']);
for ($i = 0, $count = count($t); $i < $count; $i++)
$t[$i] = $this->db->quoteIdentifier($t[$i]);
$this->options['final_table'] = implode('.', $t);
}
$this->options['final_usernamecol'] = $this->db->quoteIdentifier($this->options['usernamecol']);
$this->options['final_passwordcol'] = $this->db->quoteIdentifier($this->options['passwordcol']);
} else {
$this->options['final_table'] = $this->options['table'];
$this->options['final_usernamecol'] = $this->options['usernamecol'];
$this->options['final_passwordcol'] = $this->options['passwordcol'];
}
return true;
}
谢谢,我想我可以在任何包上使用该命令我有一个问题,只是用Auth代替包的名称? – Leahcim 2011-04-29 12:27:05
@Michael是的。请参阅http://pear.php.net/manual/en/和/或在命令提示符下输入“pear --help”以获取其他命令 – Gordon 2011-04-29 12:28:21