Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 805 Vote(s) - 3.55 Average
  • 1
  • 2
  • 3
  • 4
  • 5
disabling Drupal's CSS/JS aggregation for admins

#1
Drupal 6 has a wonderful CSS and JavaScript aggregator. Unfortunately, it interferes with development as it's only regenerated when you clear the Drupal cache.

I'd like to turn it on for non-admins (to save HTTP requests) but have the individual CSS and JS files served directly to admins for development. Has anyone done this? Is it possible?
Reply

#2
That's an interesting idea. Since the aggregation settings are stored in Drupal variables, and those are read into the global $conf array during bootstrapping, I tried the following in a modules `hook_init()` implementation:

global $user;
if (1 == $user->uid) {
global $conf;
$conf['preprocess_css'] = FALSE;
$conf['preprocess_js'] = FALSE;
}

So far this just works :)

Now I'm suspicious - according to my standard experience over the years, if something is that simple on first sight, it will break down horribly sooner or later ;)

But right now the worst thing I can imagine happening with this is that it just fails in situations where for some reason or the other the $conf array gets repopulated during a page cycle, in which case the admin would just get the cached versions again.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through