2amigos / yii2-ckeditor-widget

CKEditor WYSIWYG widget for Yii2.
https://2amigos.us/open-source/ckeditor-widget
Other
172 stars 112 forks source link

__DIR__ concatenation error #104

Closed singleton90 closed 7 years ago

singleton90 commented 7 years ago

/vendor/2amigos/yii2-ckeditor-widget/src/CKEditorWidgetAsset.php on 21 line generates error

syntax error, unexpected '.', expecting ',' or ';'


{
    public $sourcePath = __DIR__ . '/assets';

    public $depends = [
        'dosamigos\ckeditor\CKEditorAsset'
    ];

    public $js = [
        'dosamigos-ckeditor.widget.js'
    ];
}```
tonydspaniard commented 7 years ago

Where is the error?

MysteryDragon commented 7 years ago

It's obviously error with PHP 5.4 / 5.5 'cause constant expressions became available since 5.6. But this code is fixed in actual version, so it seems like updating will help :)

loop69 commented 7 years ago

Hi! I upgraded php to 5.6.30, but the error remained ...

This helped me: public $sourcePath = 'assets';

MysteryDragon commented 7 years ago

@loop69 or you can try update your yii2-ckeditor-widget plugin version. This issue related to old version of this plugin.

loop69 commented 7 years ago

I installed this plugin from github by composer two days ago. So, I think it must be newest...

MysteryDragon commented 7 years ago

@loop69 the thing is that there are not such code in actual version: https://github.com/2amigos/yii2-ckeditor-widget/blob/60e4d2dbb138706c8c2195a1b29c420bda044b19/src/CKEditorWidgetAsset.php#L21 Maybe there was old version in some instructions, or old version stored in your composer.lock... Strange :)