미채택 완료

php관련 질문.. FATAL Declaration of .... ::removeAttribute()....

2014-09-25 (목) 21:01:04 5,227

이게 무슨 오류인가요..php구문 전부를 수정해야 하는건가요..?

상상디자인 이라는 업체에서 제작했는데 cafe24로 호스팅을 이전하여 접속하니 이렇게 뜨네요..

접속주소는 http://icell2008.cafe24.com/public_html/ 입니다. 889라인의 오류인듯 한데 이걸 어떻게 변경해야 하나요..

 FATAL [/home/hosting_users/icell2008/www/mojavi/opt/renderers/SmartyRenderer.class.php:232] Declaration of SmartyRenderer::removeAttribute() should be compatible with that of Renderer::removeAttribute()​

오류나는 줄 232번째 줄을 살펴보게 되면 달랑

}

이거 하나 있습니다.. 아래 소스 첨부할게요. 도움좀 주십쇼..

Copy
<?php// +---------------------------------------------------------------------------+// | This file is part of the Mojavi package.                                  |// | Copyright (c) 2003 Sean Kerr.                                             |// |                                                                           |// | For the full copyright and license information, please view the COPYRIGHT |// | file that was distributed with this source code. If the COPYRIGHT file is |// | missing, please visit the Mojavi homepage: http://www.mojavi.org          |// +---------------------------------------------------------------------------+/** * SmartyRenderer renders a template using the Smarty template engine. * * @author  Sean Kerr * @package mojavi * @package renderers * @since   1.0 */error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED); class SmartyRenderer extends Renderer{    /**     * Create a new SmartyRenderer instance.     *     * @access public     * @since  1.0     */    function SmartyRenderer ()    {        parent::Renderer();        $this->engine = new Smarty;    }    /**     * Render the view.     *     * <br/><br/>     *     * <note>     *     This should never be called manually.     * </note>     *     * @param Controller A Controller instance.     * @param Request    A Request instance.     * @param User       A User instance.     *     * @access public     * @since  1.0     */    function execute (&$controller, &$request, &$user)    {        if ($this->template == NULL)        {            $error = 'A Smarty template has not been specified';            trigger_error($error, E_USER_ERROR);            return;        }        // assign smarty variables        $this->setAttributeByRef('controller', $controller);        $this->setAttributeByRef('mojavi',     $controller->getMojavi());        $this->setAttributeByRef('request',    $request);        $this->setAttributeByRef('user',       $user);        if ($this->isPathAbsolute($this->template))        {            $dir            = dirname($this->template) . '/';            $this->template = basename($this->template);        } else        {            $dir = ($this->dir == NULL)                   ? $controller->getModuleDir() . 'templates/'                   : $this->dir;            if (!is_readable($dir . $this->template) &&                 is_readable(TEMPLATE_DIR . $this->template))            {                $dir = TEMPLATE_DIR;            }        }        if (is_readable($dir . $this->template))        {            $this->engine->template_dir = $dir;            if ($this->mode == RENDER_VAR ||                $controller->getRenderMode() == RENDER_VAR)            {                $this->result = $this->engine->fetch($this->template);            } else            {                $this->engine->display($this->template);            }        } else        {            $error = 'Template file ' . $dir . $this->template . ' does ' .                     'not exist or is not readable';            trigger_error($error, E_USER_ERROR);        }    }    /**     * Retrieve an attribute.     *     * @param string An attribute name.     *     * @return mixed An attribute value, if the given attribute exists,     *               otherwise <b>NULL</b>.     *     * @access public     * @since  1.0     */    function & getAttribute ($name)    {        $attribute =& $this->engine->get_template_vars($name);        if ($attribute != NULL)        {            return $attribute;        }	$null = NULL;        return $null;    }    /**     * Remove an attribute.     *     * @param string An attribute name.     *     * @access public     * @since  1.0     */    function removeAttribute ($name)    {        $this->engine->clear_assign($name);    }    /**     * Set multiple attributes by using an associative array.     *     * @param array An associative array of attributes.     *     * @access public     * @since  2.0     */    function setArray ($array)    {        $this->engine->assign($array);    }    /**     * Set multiple attributes by using a reference to an associative array.     *     * @param array An associative array of attributes.     *     * @access public     * @since  2.0     */    function setArrayByRef (&$array)    {        $this->engine->assign_by_ref($array);    }    /**     * Set an attribute.     *     * @param string An attribute name.     * @param mixed  An attribute value.     *     * @access public     * @since  1.0     */    function setAttribute ($name, $value)    {        $this->engine->assign($name, $value);    }    /**     * Set an attribute by reference.     *     * @param string An attribute name.     * @param mixed  An attribute value.     *     * @access public     * @since  1.0     */    function setAttributeByRef ($name, &$value)    {        $this->engine->assign_by_ref($name, $value);    }?>
|

답변 3개

php 버전이 높아서 나는 에러 같습니다. (5.4 이상?)

에러라기 보담 그냥 경고성 문구 정도... ^^

호스팅사에 E_STRICT메시지 출력 안되도록 부탁해 보시구요

만약 안된다 하시면 해당 페이지에 

error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED); 

라고 적어넣어 보세용~~

2014-09-25 (목) 22:09:27

템플릿인가 보네요. 

순수(?) php랑 다르게 전체적으로 봐야 알 수 있습니다.

smarty나 template_를 가져다가 자기네들 방식에 맞게 바꾼 데도 많고 해서요.

제일 좋은 방법은 다른 분이 말씀하신 것처럼 제작한 업체에 물어 보시는 게 좋겠네요.

상상디자인에 이전 설치 해달라고 하면 되는 것 아닐까요?

어떤 점인지 모르겠지만 프레임워크에서 에러 출력 하고 있으니... 지금 보여주신 소스 만으로는 해결이

되지 않습니다.

어디에 문제가 발생했는지. 디버깅 할 수 밖에 없어요.

아니면 이곳에 문의를 해보세요

www.smarty.net 

답변을 작성하려면 로그인이 필요합니다.