Joomla |解析错误:语法错误,第17行的/../behavior.php中出现意外的T_类

Joomla |解析错误:语法错误,第17行的/../behavior.php中出现意外的T_类,php,joomla,Php,Joomla,在此脚本中: Parse error: syntax error, unexpected T_CLASS in /homepages/1/d160385903/htdocs/etri/libraries/joomla/html/html/behavior.php on line 17 一旦我关闭了方法和类语句,我就不会收到PHP5.3.3的任何解析错误。您使用的是哪个版本的PHP?Joomla安装的版本是什么?方法链接在PHP4中不可用 它在PHP5.x中提供 这就是为什么$debug=JFa

在此脚本中:

Parse error: syntax error, unexpected T_CLASS in /homepages/1/d160385903/htdocs/etri/libraries/joomla/html/html/behavior.php on line 17

一旦我关闭了方法和类语句,我就不会收到PHP5.3.3的任何解析错误。您使用的是哪个版本的PHP?Joomla安装的版本是什么?

方法链接在PHP4中不可用

它在PHP5.x中提供

这就是为什么
$debug=JFactory::getConfig()->getValue('config.debug')
在PHP5.x中工作,但在PHP4.x中不工作


可能会帮助您。

Joomla 1.5.22和PHP 4。我认为mysql数据库可能会移交一些“错误”的数据,从而导致该错误。如果我将PHP解释器更改为PHP4.3,我会在这一行得到一个解析错误:
$debug=JFactory::getConfig()->getValue('config.debug')。我改回PHP5.2或5.3,错误消失了。在PHP4.x中,不能让方法返回对象,因此那里的链接会产生解析错误。
<?php
/**
* @version      $Id: behavior.php 18130 2010-07-14 11:21:35Z louis $
* @package      Joomla.Framework
* @subpackage   HTML
* @copyright    Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
* @license      GNU/GPL, see LICENSE.php
*
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/

defined('JPATH_BASE') or die();

/**
 * JHTML helper class for loading JavaScript behaviors into the document head.  This version is
 * designed to load MooTools version 1.2 plus the 1.1 compatibility layer.
 *
 * @package     Joomla.Framework
 * @subpackage  HTML
 *
 * @since       1.5.19
 * @static
 */
class JHTMLBehavior
{
/**
 * Method to load the mootools framework and compatibility layer into the document head.  If the
 * optional debug flag is set then a uncompressed version of the files will be loaded.
 *
 * @param   boolean  $debug  True to enable debugging mode.  If no value is set the value  will
 *                           be taken from the application configuration settings.
 *
 * @return  void
 *
 * @since   1.5.19
 * @static
 */
function mootools($debug = null)
{
    // Check to see if it has already been loaded.
    static $loaded;
    if (!empty($loaded)) {
        return;
    }

    // If no debugging value is set, use the setting from  the application configuration.
    if ($debug === null) {
        $debug = JFactory::getConfig()->getValue('config.debug');
    }

    /*
     * Note: Konqueror browser check.
     *  - If they fix thier issue with compressed javascript we can remove this.
     */
    $kcheck = isset($_SERVER['HTTP_USER_AGENT']) ? strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'konqueror') : null;

    // If the debugging flag is set or the browser is Konqueror use the uncompressed file.
    if ($debug || $kcheck) {
        JHTML::script('mootools-uncompressed.js', 'plugins/system/mtupgrade/', false);
    }
    else {
        JHTML::script('mootools.js', 'plugins/system/mtupgrade/', false);
    }