Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not Working with Advanced #27

Open
ak868308 opened this issue Dec 15, 2016 · 5 comments
Open

Not Working with Advanced #27

ak868308 opened this issue Dec 15, 2016 · 5 comments

Comments

@ak868308
Copy link

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
Copy link

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
Copy link
Owner

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

@vovannikov
Copy link

vovannikov commented Feb 16, 2017

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

@nagyt234
Copy link

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

@vovannikov
Copy link

vovannikov commented Mar 10, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants