Литий устарел метод __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/librariare/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    }
.

в модели журналистов, у меня простая функция

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'));
        }
    }
}
.

Я использую композитор и в библиотеках Boostrap.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 () в статических объектах, см. Это commits .

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top