Author Topic: minify not working  (Read 7947 times)

o_z

  • Newbie
  • *
  • Posts: 4
    • View Profile
minify not working
« on: December 31, 2008, 06:13:28 am »
Hi,

I just installed opengoo 1.1 final, and wanted to use the minify tool to speed up loading time. However, when I run the tool I get a "This tool is disabled." message.
Is there a way to use the tool or is it just not ready yet?

Thanks,
o

ignacio

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
Re: minify not working
« Reply #1 on: January 04, 2009, 03:54:59 pm »
You enable tools by adding them to the 'public/tools/access.php' file with a text editor.

Most are disabled by default because they are publicly accessible and are resource intensive, so you wouldn't want anyone accessing it at will.

We will implement some login system for this tools soon. The access.php file was just a temporary quick solution.

o_z

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: minify not working
« Reply #2 on: January 05, 2009, 10:39:37 am »
Thanks for the reply, Ignacio.

That's the exactly the answer I was looking for, as I was wondering if it would be safe to add it to the access.php file. Perhaps this should be mentioned somewhere (like in the download notes).

BTW, when I ran the minify script I got this error:
Concatenating javascripts ... Done!
Minifying javascript ... Done!
Writing to file 'ogmin.js' ... Done!

Concatenating CSS ...
Warning: file_get_contents(../assets/themes/default/stylesheets/custom.css) [function.file-get-contents]: failed to open stream: No such file or directory in /home/oferz2/public_html/opengoo/public/tools/minify.php on line 44
Done!
Minifying CSS ... Done!
Writing to file 'ogmin.css' ... Done!

But it seems to work fine none the less.

Thanks again,
o

ignacio

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
Re: minify not working
« Reply #3 on: January 05, 2009, 03:51:59 pm »
Yes, the missing custom.css file is for adding user defined styles. If it's not there it just isn't added to the minified CSS, no need to worry.

Karl

  • Sr. Member
  • ****
  • Posts: 339
    • ICQ Messenger - 464979879
    • View Profile
Re: minify not working
« Reply #4 on: January 06, 2009, 08:54:10 pm »
Please excuse me: Where do I find more information about using minify with OpenGoo?

ignacio

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
Re: minify not working
« Reply #5 on: January 07, 2009, 07:42:45 pm »
Here:

You can minify javascripts and CSS by running the 'public/tools/minify.php' script. You can access it by going in your browser to '<opengoo>/public/tools' and choosing the tool to minify. It is disabled by default but can be enabled by adding 'minify.php' to the 'public/tools/access.php' file with a text editor. After running the script you'll get a file called ogmin.css and another one called ogmin.js. Now if you set a couple of constants in config.php called COMPRESSED_CSS and COMPRESSED_JS to true OpenGoo will be using those files instead of loading each of the javascripts and CSS individually. This will improve loading times.

This isn't documented anywhere yet because as you can see it is a little too cumbersome to do, and will probably change soon.

ignacio

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
Re: minify not working
« Reply #6 on: January 08, 2009, 09:08:42 am »
I forgot to mention that with each release since version 1.1 the minified javascript and CSS is included, so you only need to add the two constants to the config/config.php file. You only need to run the minify process again if you make any changes to the javascript (excluding language javascripts) or CSS.
« Last Edit: January 29, 2009, 08:51:31 am by ignacio »

Karl

  • Sr. Member
  • ****
  • Posts: 339
    • ICQ Messenger - 464979879
    • View Profile
Re: minify not working
« Reply #7 on: January 08, 2009, 10:28:03 am »
Thank you very much. Now I found how to get it working. I had some issues with file permissions but could figure it out.
 :)

Karl

  • Sr. Member
  • ****
  • Posts: 339
    • ICQ Messenger - 464979879
    • View Profile
Minify is great
« Reply #8 on: January 10, 2009, 03:12:38 pm »
Minify speeds up loading time really very much. I could absolutely recommend it for everybody.

I'm using FF3.

sinbad

  • Freshman
  • *
  • Posts: 31
    • View Profile
Re: minify not working
« Reply #9 on: February 09, 2009, 03:46:24 am »
is it suppose to be added like this:

Code: [Select]
define('COMPRESSED_CSS', true);
  define('COMPRESSED_JS', true);
 

When I try this change in config.php and (after successfuly running minify.php)
open goo just shows the loading image and couple links.

I really would like to optimize opengoo to be a little faster.

ignacio

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
Re: minify not working
« Reply #10 on: February 09, 2009, 08:11:57 am »
Check if you have the following files: 'public/assets/javascript/ogmin.js' and 'public/assets/themes/default/stylesheets/ogmin.css'.