目前在testlink上做实验,在页面上出现了这样的报错:Parse error: syntax error, unexpected T_IF in D:\testlink\APMServ5.2.6\APMServ5.2.6\www\htdocs\testlink\lib\functions\database.class.php on line 46
下面是database.class.php 的源码:
<?php
/**
 * TestLink Open Source Project - http://testlink.sourceforge.net/
 * This script is distributed under the GNU General Public License 2 or later. 
 * 
 * @package  TestLink
 * @author  Francisco Mancardi
 * @author  Mantis Team
 * @copyright  2006 TestLink community 
 * @copyright  2002-2004  Mantis Team   - [email protected]
 *  (Parts of code has been adapted from Mantis BT)
 * @version     "CVS: $Id: database.class.php,v 1.54 2010/04/28 06:29:05 franciscom Exp $"
 * @link  http://www.teamst.org/index.php
 *
 * @internal Revisions:
 *
 * 20100111 - franciscon - BUGID - display debug_print_backtrace() when query fails
 * 20090720 - franciscom - fetchRowsIntoMap() - added some error management code 
 * 20090202 - franciscom - BUGID 1318 - fetchFirstRowSingleColumn() added new control
 * 20081129 - franciscom - Added CUMULATIVE constant
 * 20081116 - franciscom - fetchColumnsIntoMap() added cumulative argument
 *
" * 20080722 - franciscom -  trying to solve memory usage problems, have add option"
 *                          to enable/disable query execution log.
 *                          Setted to DISABLE by default.
 *
 * 20080722 - franciscom -  problems with MSSQL and ADODB_FETCH_ASSOC
 * 20080315 - franciscom -  due to problems with PostGres with $ADODB_COUNTRECS=FALSE;
 *                          return to default mode ($ADODB_COUNTRECS=TRUE;)
 *
 * 20080204 - franciscom -  setting ADODB_FETCH_ASSOC as default fetch mode
" * 20060708 - franciscom -  changed Connect() to NConnect(), to avoid"
" *                          problems due to connection reuse, when"
 *                          you wanto to connect to more than one database at once
 *                          See ADODB manuals
 */
 
/** 
 * As stated on ADODB documentation this set will improve performance but have a side
" * effect, for DBMS like POSTGRES method num_rows() will return ALWAYS -1, causing problems"
 */
$ADODB_COUNTRECS = TRUE;

"// To use a different version of ADODB that provided with TL, use a similar bunch of lines"
// on custom_config.inc.php
[size=18px]if( !defined('TL_ADODB_RELATIVE_PATH') )[/size]--->这是第46行
{
"    define('TL_ADODB_RELATIVE_PATH','/../../third_party/adodb/adodb.inc.php' );"
}
require_once( dirname(__FILE__). TL_ADODB_RELATIVE_PATH );
require_once( dirname(__FILE__). '/logging.inc.php' );

/**
 * TestLink wrapper for ADODB component
 * @package  TestLink
 */
class database 
{
const CUMULATIVE=1;

var $db;
var $queries_array = array();
var $is_connected=false;
var $nQuery = 0;
var $overallDuration = 0;
private $logEnabled=0;
private $logQueries=0;
  
// timer analysis
function microtime_float() {
"list( $usec, $sec ) = explode( "" "", microtime() );"
return ( (float)$usec + (float)$sec );
}

function setLogEnabled($value)
{
    $this->logEnabled=$value?1:0;
}

function getLogEnabled($value)
{
    return $this->logEnabled;
}

function setLogQueries($value)
{
    $this->logQueries=$value?1:0;
}

function getLogQueries($value)
{
    return $this->logQueries;

          ........
          ........      不知道这行有什么错???期望高手能够解決。。期待。。

解决方案 »

  1.   

    剛才發的帖子第46行不清楚  重新發一下  第46行是這樣的:
    if( !defined('TL_ADODB_RELATIVE_PATH') )
      

  2.   

    没在你的代码中看见错误中说的T_IF,代码没贴全吧?
      

  3.   

    " define('TL_ADODB_RELATIVE_PATH','/../../third_party/adodb/adodb.inc.php' );" 前后的 ""什么意思呢,复制出错?
    如果是,单单这个条件语句,没什么问题