is this only for the install/update?
than add a: 
if (defined('IN_INSTALL'))