리튬이 사용되지 않는 __init () 방법은 수동으로 호출해야합니다.

StackOverflow https://stackoverflow.com//questions/21064764

  •  26-12-2019
  •  | 
  •  

문제

나는 최근 리튬 라이브러리를 업데이트 하고이 문제가 있습니다. 이 오류가 발생했습니다 :

RuntimeException

Deprecated `app\models\StoreCategories::__init()` method, needs to be called it manually.

소스

/works/minhna/public_html/cmp/v0/libraries/lithium/core/libraries.php : 505

500 
 501        if ($path && include $path) { 
 502            static::$_cachedPaths[$class] = $path; 
 503            if (method_exists($class, '__init')) { 
 504                $msg = "Deprecated `{$class}::__init()` method, needs to be called it manually."; 
 505                throw new RuntimeException($msg); 
 506            } 
 507        } elseif ($require) { 
 508            throw new RuntimeException("Failed to load class `{$class}` from path `{$path}`."); 
 509        } 
 510    }
.

StorCategories 모델에서는 간단한 기능이 있습니다

public static function __init(array $options = array()){
    static::config($options);
    static::applyFilter('save', function ($self, $params, $chain) {
        if(!$params['entity']->_id){
            //set created date
            $params['entity']->created = strtotime(gmdate('Y-m-d H:i:s'));
        }
    }
}
.

작곡가와 boohoStrap libraries.php에서, li3_socialauth 라이브러리를로드합니다.

/**
 * load the socialauth library
 */
Libraries::add('li3_socialauth');
// Add the composer autoloader if not already done
require_once(LITHIUM_LIBRARY_PATH . '/autoload.php') ;
.

미리 감사드립니다.

도움이 되었습니까?

해결책

리튬은 정적 객체에서 __init ()을 제거합니다.a>.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top