yii2-assets-auto-compress icon indicating copy to clipboard operation
yii2-assets-auto-compress copied to clipboard

Not Working with Advanced

Open ak868308 opened this issue 8 years ago • 5 comments

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

ak868308 avatar Dec 15 '16 16:12 ak868308

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.

vovannikov avatar Jan 12 '17 18:01 vovannikov

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

skeeks-semenov avatar Jan 12 '17 19:01 skeeks-semenov

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

vovannikov avatar Feb 16 '17 08:02 vovannikov

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

nagyt234 avatar Sep 14 '17 16:09 nagyt234

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

vovannikov avatar Mar 10 '18 14:03 vovannikov