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{
...
}
}