skeeks-semenov / yii2-assets-auto-compress

Automatic compilation of js + css + html
https://skeeks.com/
BSD 3-Clause "New" or "Revised" License
157 stars 43 forks source link

Not Working with Advanced #27

Open ak868308 opened 7 years ago

ak868308 commented 7 years ago

Hi, When I applied this into advanced template for frontend it is not wokring. Browser loading continuously (like server goes into infinite loop)

Please Help

vovannikov commented 7 years ago

The same issues observed on my project. At least with advanced template the extension hangs up the server, css-compress and js-compress folders remain empty.

skeeks-semenov commented 7 years ago

Your projects are publicly available on the Internet? You can see them on the link?

vovannikov commented 7 years ago

The web page is sms-m.ru. The source code is unavailable, unfortunately.

nagyt234 commented 6 years ago

@vovannikov As I see, sms-m.ru is working with compressed js and css. Did you make any changes on this module?

vovannikov commented 6 years ago

Yea, I actually replace function fileGetContents(). By defalut it uses httpclient to get the source css and js files, so my hosting provider interprets such activity as suspicious and at certain point starts to reset these connections. I simply use file_get_contents() instead.

class AssetsAutoCompressComponent extends \skeeks\yii2\assetsAuto\AssetsAutoCompressComponent
{   
    public function fileGetContents($file)
    {
        $path = str_replace(Url::to('/', true), \Yii::getAlias('@webroot').'/', $file);

        if (file_exists($path)) {
            return file_get_contents($path);
        } else {
            throw new \Exception('File '.$path.' does not exist!');
        }
    }
}