Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Joomla 致命错误:无法在第98行的/home3/trekperu/public_html/libraries/rokcommon/rokcommon/ClassLoader.php中重新声明类JInputCookie_Joomla - Fatal编程技术网

Joomla 致命错误:无法在第98行的/home3/trekperu/public_html/libraries/rokcommon/rokcommon/ClassLoader.php中重新声明类JInputCookie

Joomla 致命错误:无法在第98行的/home3/trekperu/public_html/libraries/rokcommon/rokcommon/ClassLoader.php中重新声明类JInputCookie,joomla,Joomla,代码如下: <?php defined('JPATH_PLATFORM') or die; class JInputCookie extends JInput { public function __construct(array $source = null, array $options = array()) { if (isset($options['filter'])) { $this->filter

代码如下:

<?php
defined('JPATH_PLATFORM') or die;
class JInputCookie extends JInput
{

    public function __construct(array $source = null, array $options = array())
    {
        if (isset($options['filter']))
        {
            $this->filter = $options['filter'];
        }
        else
        {
            $this->filter = JFilterInput::getInstance();
        }

        // Set the data source.
        $this->data = & $_COOKIE;

        // Set the options for the class.
        $this->options = $options;
    }

    public function set($name, $value, $expire = 0, $path = '', $domain = '', $secure = false, $httpOnly = false)
    {
        if (is_array($value))
        {
            foreach ($value as $key => $val)
            {
                setcookie($name . "[$key]", $val, $expire, $path, $domain, $secure, $httpOnly);
            }
        }
        else
        {
            setcookie($name, $value, $expire, $path, $domain, $secure, $httpOnly);
        }
        $this->data[$name] = $value;
    }
}

这是一个懒惰的解决方案,但它可以工作:

if (!class_exists('JInputCookie')) {
    class JInputCookie extends JInput{
        ...
    }
}

本质上,您是在告诉PHP只定义类
JInputCookie
,如果它还没有定义的话。

您能给我们提供更多的上下文吗?代码应该做什么?你有什么线索吗?
if (!class_exists('JInputCookie')) {
    class JInputCookie extends JInput{
        ...
    }
}