| 제목 | ci2 서버 이전, php7로 했는데 에러가.. | ||
|---|---|---|---|
| 카테고리 | CI 2, 3 | ||
| 글쓴이 | 뫄뫄잉뿌 | 작성시각 | 2021/12/21 11:53:57 | 
|  | |||
| ci2 사용중이었고 기존 php5에서 php7로 설치된 서버로 이전하고 테스트하고 있습니다. 안되고 있는 부분들이 있어 도움을 요청하고자 씁니다. 
 
<?php (defined('BASEPATH')) OR exit('No direct script access allowed');
define('WIDGET', TRUE);
class Widget {
    function __construct() {
        $this->_assign_libraries();
    }
    function run($controller) {
        if (strpos($controller, '.') !== FALSE) {
            list($controller, $method) = explode('.', $controller);
        }
        require_once APPPATH.'controllers/'.$controller.EXT;
        // default method
        if (!isset($method)) $method = 'index';
        // class name
        $class = end(explode('/', $controller));
		if ($class =& new $class()) {
            if (method_exists($class, $method)) {
                $args = func_get_args();
                return call_user_func_array(array($class, $method), array_slice($args, 1));
            }
        }
    }
    function _assign_libraries() {
        $CI =& get_instance();
        foreach (get_object_vars($CI) as $key => $object) {
            $this->$key =& $CI->$key;
        }
    }
}
 
 제가 작업한 페이지가 아니라 코드가 이해하기 힘드네요..ㅠ 
 현재 if ($class =& new $class()) { 이 부분에서 에러가 나는데, 어떻게 수정해야할지 모르겠어서.. 도움요청해봅니다.. | |||
| 다음글 | 이미지 경로나 css가 호출이 안되고 있습니다. (4) | ||
| 이전글 | 모달페이지에서 다른 컨트롤러로 이동할때 js 어떻게 할... (5) | ||
| 
                                변종원(웅파)
                                /
                                2021/12/21 13:10:31 /
                                추천
                                0
                             | 
| 
                                한대승(불의회상)
                                /
                                2021/12/21 13:45:25 /
                                추천
                                0
                             
$class = new $class()
if ($class) {
        if (method_exists($class, $method)) {
            $args = func_get_args();
            return call_user_func_array(array($class, $method), array_slice($args, 1));
        }
}수정후 테스트 해보세요. | 
| 
                                뫄뫄잉뿌
                                /
                                2021/12/21 14:19:33 /
                                추천
                                0
                             네.. 다 뜯어고칠 판입니다..ㅎㅎ...몇시간 작업했지만 안맞는 부분들이 많네요... 감사합니다 ㅜ @한대승님 답변 감사합니다. 해결되었네요. | 
| 
                                뫄뫄잉뿌
                                /
                                2021/12/21 14:28:37 /
                                추천
                                0
                             
                                버전업도 생각하고는 있는데.. 둘다 만만치 않은 작업이되겠네요ㅜㅜ..
                             | 
| 
                                프레드윤
                                /
                                2021/12/22 05:09:41 /
                                추천
                                0
                             
                                저도 ci4를 추천드려요~ kiboard 사용하는거 같은데~ 잔버그 많아요 ㅠㅠ
                             | 
안하시는게 좋을 건데요? 다 뜯어고쳐야할 수도...
차라리 ci3으로 버전업 하시는걸 추천합니다.