Macrura Posted July 20, 2016 Share Posted July 20, 2016 you'd need to make some function to output the individual assets, for example when an admin is logged in.. (very basic example) if($user->isLoggedin) { listAssets($stylesheets); } else { echo AllInOneMinify::CSS($stylesheets)); } that's how i do it.. 4 Link to comment Share on other sites More sharing options...
Can Posted July 20, 2016 Share Posted July 20, 2016 Uh now I understand the question..development mode is just disabling minification and caching..maybe file "seperation" could be included as separate option, I for myself like files being concatenated while uncompressed for development..and if I really don't now which file a line belongs to I just Sublime search in all files and done.. ;-) Link to comment Share on other sites More sharing options...
horst Posted July 20, 2016 Share Posted July 20, 2016 5 hours ago, Macrura said: if($user->isLoggedin) { listAssets($stylesheets); } else { echo AllInOneMinify::CSS($stylesheets)); } My conditional is: $skipMinify = $config->debug || $user->isSuperuser() ? true : false; 1 Link to comment Share on other sites More sharing options...
tpr Posted July 20, 2016 Share Posted July 20, 2016 @horst How about this? $skipMinify = $config->debug || $user->isSuperuser(); 5 Link to comment Share on other sites More sharing options...
horst Posted July 20, 2016 Share Posted July 20, 2016 OMG. I shouldn't post in the morning before the first cup of coffee. 4 Link to comment Share on other sites More sharing options...
Stefanowitsch Posted July 20, 2016 Share Posted July 20, 2016 3 hours ago, tpr said: @horst How about this? $skipMinify = $config->debug || $user->isSuperuser(); Where does this code snippet go? Right now I am using this code in my header which is not very professional but it works ;-) <? if ($config->debug) { ?> <link rel="stylesheet" type="text/css" href="<?php echo $config->urls->templates?>styles/styles.css" /> <? } else { ?> <link rel="stylesheet" type="text/css" href="<?php echo AIOM::CSS('styles/styles.css'); ?>" /> <? } ?> Link to comment Share on other sites More sharing options...
horst Posted July 20, 2016 Share Posted July 20, 2016 For me, it goes here: // condition <?php if ($config->debug) { ?> // condition as variable <?php $skipMinify = $config->debug || $user->isSuperuser(); if ($skipMinify) { ?> // or, if you have only one occurence in your code where you check this condition, // ommit the temorary variable and write it direct into the condition <?php if ($config->debug || $user->isSuperuser()) { ?> $config->debug is true when developing, and additionally I use superuser condition for later, when in production mode! 2 Link to comment Share on other sites More sharing options...
adrian Posted September 22, 2016 Share Posted September 22, 2016 PHP 7.1 is returning a: A non well formed numeric value encountered on line 713 notice because you are relying on PHP's auto int casting. I didn't do a thorough check to see if this is ok, but so far it's working for me: $_timestamp = ((int)$_timestamp + $file['last_modified']); 2 Link to comment Share on other sites More sharing options...
rst Posted October 3, 2016 Share Posted October 3, 2016 On 11/25/2015 at 5:17 PM, Russ Parker said: Any ideas how to stop it minifying the spaces in CSS calc? having a problem with this as well, any solutions ? Link to comment Share on other sites More sharing options...
Zeka Posted November 18, 2016 Share Posted November 18, 2016 Hi. Is it possible to disable HTML minifing or activate "Developement mode" from config file? Thanks Link to comment Share on other sites More sharing options...
videokid Posted January 19, 2017 Share Posted January 19, 2017 Hi, first I couldn't install the module on a 3.0.47 installation, I've added namespace ProcessWire;, which did the trick, but then I have this: Error: Class 'ProcessWire\RecursiveDirectoryIterator' not found (line 658 of /public_html/site/modules/AllInOneMinify/AllInOneMinify.module) Kind Regards! Link to comment Share on other sites More sharing options...
Stefanowitsch Posted January 19, 2017 Share Posted January 19, 2017 On 18.11.2016 at 4:48 PM, Zeka said: Hi. Is it possible to disable HTML minifing or activate "Developement mode" from config file? Thanks Not directly, but I had the same "problem" and now I do it this way: // when debug mode is ON -> do not compress the styles if ($config->debug) { ?> <link rel="stylesheet" type="text/css" href="/path/to/css/..."/> <? } else { ?> <link rel="stylesheet" type="text/css" href="<?php echo AIOM::CSS(/path/to/css/...); ?>"/> <? } 1 Link to comment Share on other sites More sharing options...
Can Posted January 19, 2017 Share Posted January 19, 2017 13 hours ago, videokid said: Hi, first I couldn't install the module on a 3.0.47 installation, I've added namespace ProcessWire;, which did the trick, but then I have this: Error: Class 'ProcessWire\RecursiveDirectoryIterator' not found (line 658 of /public_html/site/modules/AllInOneMinify/AllInOneMinify.module) Kind Regards! you either leave the namespace or need to prepend all php function like RecursiveDirectoryIterator with an \ backslash like \RecursiveDirectoryIterator so it knows this function is not in the ProcessWire but in the root namespace.. 2 Link to comment Share on other sites More sharing options...
videokid Posted January 19, 2017 Share Posted January 19, 2017 Yes, I left the ' namespace Processwire ' and added the backslash, and that did the trick! Thank you! Link to comment Share on other sites More sharing options...
Zeka Posted February 6, 2017 Share Posted February 6, 2017 On 19.01.2017 at 11:06 AM, Stefanowitsch said: Not directly, but I had the same "problem" and now I do it this way: // when debug mode is ON -> do not compress the styles if ($config->debug) { ?> <link rel="stylesheet" type="text/css" href="/path/to/css/..."/> <? } else { ?> <link rel="stylesheet" type="text/css" href="<?php echo AIOM::CSS(/path/to/css/...); ?>"/> <? } @Stefanowitsch Thanks for tip, but it isn't relative to HTML minifying. Link to comment Share on other sites More sharing options...
Stefanowitsch Posted February 13, 2017 Share Posted February 13, 2017 Yeah, but I don't use HTML minifying at all. So for me it's ok that way. Link to comment Share on other sites More sharing options...
Mackski Posted April 21, 2017 Share Posted April 21, 2017 I just found a collision cache file naming issue if all files have the same modified timestamp regardless of the array contents. Simple fix to ensure the filename itself is included in the MD5($_timestamp) $_timestamp = ($_timestamp + $file['last_modified'] . basename($file['absolute_path'])); https://github.com/FlipZoomMedia/ProcessWire-AIOM-All-In-One-Minify/issues/64 Link to comment Share on other sites More sharing options...
pmichaelis Posted May 5, 2017 Share Posted May 5, 2017 Wanted to let you know, that I had some issues with AOIM running php 7. Error messages were generated because of non well formed numeric values. Maybe the issues are bound to my hosting environment. The following changes resolved them Changend line 775 in /site/modules/AllInOneMinify/lib/cssmin.php to: return intval($size); Changed line 713 in site/modules/AllInOneMinify/AllInOneMinify.module to $_timestamp = intval($_timestamp . $file['last_modified']); 1 Link to comment Share on other sites More sharing options...
theo Posted May 21, 2017 Share Posted May 21, 2017 Just a detail: Why are these br tags visible in the module config? Sth. changed in Processwire? Link to comment Share on other sites More sharing options...
Dennis Spohr Posted July 13, 2017 Share Posted July 13, 2017 Hi all, I'm using the AIOM+ module for speeding up my page. My website is using SSL. In the module there's the option for domain sharding. Without SSL it's working perfectly, but as soon as I access the website via SSL it's not working. Seems like the Option "Domain sharding (SSL)" is beeing totally ignored. Is there anybody with the same problem? Thanks! Dennis Link to comment Share on other sites More sharing options...
Arcturus Posted July 13, 2017 Share Posted July 13, 2017 Just wanted to add another report of non-well formed numeric values occurring with PHP 7 (specifically 7.1.7). Pmichaelis' solution works, but only allowed the caching of a single CSS and JS file for my entire site, while Adrian's (several posts above) works and allows for several of each. That said, AIOM still breaks when a template calls for a file that hasn't been previously generated with either of those solutions and remains so even on a reload when a cached file should be available. To get that original page working, I need to jump to a different page using that template (which renders correctly) and then back to the original page. Edit: ...and by break, I mean it adds a string error message (with some HTML) to the SRC path for each item in your array, so the browser tries to load the CSS or JS file at a URL consisting of multiple error messages followed by the correct path in one epically long string. 1 Link to comment Share on other sites More sharing options...
matjazp Posted July 15, 2017 Share Posted July 15, 2017 On 21. 5. 2017 at 1:21 PM, theo said: Just a detail: Why are these br tags visible in the module config? Sth. changed in Processwire? ... $field->entityEncodeText = false; //add this to allow html markup $field->description.= sprintf(__('Cached files: %s | Used space: %s'), $_cacheInfo['numberOfFiles'], $_cacheInfo['bytesTotal']); ... Link to comment Share on other sites More sharing options...
pmichaelis Posted July 17, 2017 Share Posted July 17, 2017 Some more Infos for the cssmin errors using php7 https://github.com/nystudio107/minify/issues/8 That seems to fix the errors Link to comment Share on other sites More sharing options...
tires Posted July 31, 2017 Share Posted July 31, 2017 Hi! I would like to use "HTML minify" but leave some of the html comments in the code. In my case it is this comment: <!-- HTML5 elements and media queries Support for IE8 : HTML5 shim and Respond.js --> <!--[if lt IE 9]> <script src="js/html5shiv.js"></script> <script src="js/respond.min.js"></script> <![endif]--> Is there a way to exclude some comments from being deleted by the module? Thanks! Link to comment Share on other sites More sharing options...
bernhard Posted July 31, 2017 Share Posted July 31, 2017 hi tires, if you are looking for better performance i would highly recommend you take a look at procache: https://processwire.com/api/modules/procache/#procache-html-minification you have lots of options regarding html minification there that would solve your problem. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now