I get this error :
cache_bootstrap(hook_info) was not cleared. APC cli uses a different memory storage then the webserver. For more info see: http://drupal.org/node/1278232 [warning]
WD php: Warning: Invalid argument supplied for foreach() in DrupalAPCCache->getMultiple() (line 175 of ***/sites/all/modules/contrib/apc/drupal_apc_cache.inc). [warning]
Warning : Invalid argument supplied for foreach() dans DrupalAPCCache->getMultiple() (ligne 175 dans ***/sites/all/modules/contrib/apc/drupal_apc_cache.inc). [error]
Command core-cron needs a higher bootstrap level to run - you will need invoke drush from a more functional Drupal environment to run this command.
=> just add a if($fetch) before the foreach in case of dummy apc_fetch
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | apc-bug-1834228-4.patch | 582 bytes | rudetrue |
Comments
Comment #1
mrharolda commentedCan you give me some steps to reproduce this?
Comment #2
quazardous commentedit's just a clue : create a drush command that have to get items from cache...
since there is a dummy apc_fetch() in cli mode that returns FALSE (and apc_fetch() can return FALSE too) sometimes the foreach yields an error ...
I hope that helps :/
Comment #3
Jorrit commentedSame problem here,
getMultiple()should check the return value ofapc_fetch().I changed the code to:
Comment #4
rudetrue commentedTo reproduce set "apc.enable_cli=0" in your php.ini/apc.ini and attempt to use drush. The command "drush status" will cause the warning to appear.
I created a patch file using the code from #2 and #3. This causes the warning to no longer appear.
Comment #5
Jorrit commentedThe patch works fine, but you are using four spaces to indent instead of two.
Comment #6
R.Muilwijk commentedWhat would the return value be of apc_fetch. The current check is !empty(). Shouldn't it be is_array()?
Comment #7
Jorrit commentedI guess that would also work. It either returns false or an array. Empty also checks for empty arrays and it is a fast function, so it will save you entering the foreach loop even when the result is an empty array.
Comment #8
R.Muilwijk commentedOk. Committed to dev.