aik27 / inwidget

inWidget - free Instagram widget for your website. Allows you to show photos from an Instagram account, by hashtags and more.
http://inwidget.ru
Other
131 stars 53 forks source link

Lang file not found (1.2.2) #12

Closed stacmv closed 6 years ago

stacmv commented 6 years ago

After update to 1.2.2 I've encountered an error (require: file not found) in inWidget\Core class, line 284.

I had no time to discover, just commented lines 224-225: $this->langPath = DIR.'/'.$this->langPath; // PHP < 5.6 fix $this->cachePath = DIR.'/'.$this->cachePath; // PHP < 5.6 fix

In my case (PHP 5.5 оn linux and PHP 7.2 on windows) line 224 made langPath point to nonexistent directory (relative to index.php) 'classes/InWidget/langs/' instead of existing 'langs/'.

aik27 commented 6 years ago

"langPath" and "cachePath" must be set manually in config.php or through the class constructor. Otherwise, widget will use default pattern: DIR.'/'.$this->langPath. So when you call the code from different directory or nesting level, this will cause an error.