Meio上传严格错误

时间:2012-07-26 21:23:08

标签: cakephp meio-upload

Strict (2048): Declaration of MeioUploadBehavior::setup() should be compatible with ModelBehavior::setup(Model $model, $config = Array) [APP/Plugin/MeioUpload/Model/Behavior/MeioUploadBehavior.php, line 26]

Strict (2048): Declaration of MeioUploadBehavior::beforeValidate() should be compatible with ModelBehavior::beforeValidate(Model $model) [APP/Plugin/MeioUpload/Model/Behavior/MeioUploadBehavior.php, line 26]

Strict (2048): Declaration of MeioUploadBehavior::beforeSave() should be compatible with ModelBehavior::beforeSave(Model $model) [APP/Plugin/MeioUpload/Model/Behavior/MeioUploadBehavior.php, line 26]

Strict (2048): Declaration of MeioUploadBehavior::afterSave() should be compatible with ModelBehavior::afterSave(Model $model, $created) [APP/Plugin/MeioUpload/Model/Behavior/MeioUploadBehavior.php, line 26]

Strict (2048): Declaration of MeioUploadBehavior::beforeDelete() should be compatible with ModelBehavior::beforeDelete(Model $model, $cascade = true) [APP/Plugin/MeioUpload/Model/Behavior/MeioUploadBehavior.php, line 26]

Strict (2048): Declaration of MeioUploadBehavior::afterDelete() should be compatible with ModelBehavior::afterDelete(Model $model) [APP/Plugin/MeioUpload/Model/Behavior/MeioUploadBehavior.php, line 26]

2 个答案:

答案 0 :(得分:5)

MeioUploadBehavior的方法签名必须与ModelBehavior类的方法签名相同。

例如,afterDelete方法的方法签名必须从function afterDelete(&$model)更改为function afterDelete(Model $model)

答案 1 :(得分:4)

更改文件MeioUploadBehavior

function beforeValidate(Model $model)
function beforeSave(Model $model)
function afterSave(Model $model, $created)

由:

function beforeValidate(Model $model, $options = array())
function beforeSave(Model $model, $options = array())
function afterSave(Model $model, $created, $options = array())

此更正是由于CakePHP版本所做的更改。

问候语

@jvo_chile