| Project: | CSS Gzip |
| Version: | 6.x-1.3 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (won't fix) |
Issue Summary
Having module 'css_gzip' installed and activated the drush commands pm-update (up) and pm-updatecode (upc)
do not work anymore. All other drush commands still work.
Drush hangs in the "Drush bootstrap phase : _drush_bootstrap_drupal_full()".
After disabling module 'css_gzip' it works again without any problem.
Drupal: 6.17
css_zip: 6.x-1.3
System: Mac OS X 10.6.4
Output of: drush -d upc
admin@~/Develop/www/biechele$ drush -d upc
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.06 sec, 2.5 MB] [bootstrap]
Initialized Drupal 6.17 root directory at /Users/admin/Develop/www/biechele [0.07 sec, 3 MB] [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.09 sec, 3.05 MB] [bootstrap]
Initialized Drupal site default at sites/default [0.18 sec, 3.14 MB] [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.19 sec, 3.19 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_database() [0.22 sec, 3.19 MB] [bootstrap]
Successfully connected to the Drupal database. [0.22 sec, 3.19 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_full() [0.24 sec, 3.41 MB] [bootstrap]
I'm not sure whether this ticket should be in the issue queue of module 'css_gzip' or it's ok to put it here.
May be you can give me some hint on how to further investigate this one.
Comments
#1
probably an issue with your file permissions. this is a local problem, and not really appropriate for either issue queue. but lets try css_gzip anyway.
#2
need more info; but this sounds like a permissions issue... every file I write is in the
file_directory_path() . '/css/'directory. what are the permissions of that directory? Does css aggregation work?#3
The permissions of the directory ..sites/default/files/css are: 777
CSS aggregation works.
In the performance settings I switched off one after the other CSS GZIP options and noticed that
the "drush hanging in the bootstrap phase" only occurs when this option is checked:
x GZip CSS: Use hook exit as well
When I uncheck the option "drush upc" works again.
This is independant of using a recolorable theme or not.
#4
thanks for looking into this; here's the code in question:
<?php
/**
* Implementation of hook_init().
*
* Start the output buffer.
*/
function css_gzip_init() {
if ( variable_get('css_gzip', FALSE)
&& variable_get('css_gzip_exit', FALSE)
) {
ob_start();
}
}
/**
* Implementation of hook_exit().
*
* Alt way of getting the css filenames
*/
function css_gzip_exit() {
// Ensure we are not serving a cached page; drupal_set_content is the first
// function in common.inc which is included in the full drupal bootstrap.
if ( variable_get('css_gzip', FALSE)
&& variable_get('css_gzip_exit', FALSE)
&& function_exists('drupal_set_content')
) {
$buffer = ob_get_contents();
// Extract external css files from html document
$css = explode('<link type="text/css" rel="stylesheet" ', $buffer);
array_shift($css);
foreach ($css as $key => $value) {
// Only grab the first one, containing the css filename.
$css[$key] = array_shift(explode(' />', $value));
}
$css = implode('',$css);
$css_files = css_gzip_file_list($css);
// Create the GZip file if it doesn't already exist.
css_gzip_copy_compress($css_files);
}
}
?>
Looks like it might throw a warning on the foreach. Try this patch.
#5
I'm sorry. Same behaviour after applying the patch and cleaning caches before testing with applied pacth.
As long as option "GZip CSS: Use hook exit as well" is not checked "drush pm-update" works.
When I check it, drush hangs in the bootstrap phase as before.
No special entries in the logs.
Is there anything else I can check to figure this one out?
Subscribe
#6
try this patch
#7
@moshe weitzman
If the above patch doesn't work, how do I detect that php was started from drush; cli, user_agent?
#8
The patch from #6 does not work either - same behaviour as before.
@7
I'm using XAMPP 1.0.1 on Mac 10.6.4
In my .profile I have defined this alias, where directory "drush-4.0-dev" contains the
drush All-Versions-HEAD from 2010-Aug-19
alias drush='php /Users/admin/Develop/www/drush/drush-4.0-dev/drush.php'
Used "php":
admin@~/Develop/www/test6$ which php
/Applications/XAMPP/xamppfiles/bin/php
Output of "drush status" from within the "test6" project directory is
admin@~/Develop/www/test6$ drush status
Drupal version : 6.19
Site URI : http://default
Database driver : mysqli
Database hostname : localhost
Database username : drupal_mysql
Database name : drupal_test6
Database : Connected
Drupal bootstrap : Successful
Drupal user : Anónimo
Default theme : garland
Administration theme : garland
PHP configuration : /Applications/XAMPP/etc/php.ini
Drush version : 4.0-dev
Drush configuration :
Drupal root : /Users/admin/Develop/www/test6
Site path : sites/default
File directory path : sites/default/files
File permissions on directory ../test6/sites/default/files/css
drwxrwxrwx 7 admin admin 238 19 Aug 12:11 css
File permissions in ../test6/sites/default/files/css/*
-rw-rw-r-- 1 nobody admin 870 19 Aug 12:10 css_27bf2b59a4b65e1feaeb43135d7e990a.css
-rw-rw-r-- 1 nobody admin 335 19 Aug 12:11 css_27bf2b59a4b65e1feaeb43135d7e990a.css.gz
-rw-rw-r-- 1 nobody admin 38708 19 Aug 12:10 css_556fb6017c2957ff565854c3a871f91a.css
-rw-rw-r-- 1 nobody admin 8537 19 Aug 12:11 css_556fb6017c2957ff565854c3a871f91a.css.gz
Is that of any use?
#9
For what it's worth, i'm having the same problem. The workaround of turning off "use hook exit" does fix the problem.
#10
Switch over to Advanced CSS/JS Aggregation. It's going to replace this module
http://drupal.org/project/advagg
#11
CSS Gzip will no longer be updated/supported. All future development is being done in the Advanced CSS/JS Aggregation module.