Error using module_invoke_all('requirements', 'runtime') in my custom module
My guess would be that you have that line of code outside a function in your module. That doesn't work.

I have no idea what you are trying to do but you should at least move it into a hook, like hook_init() so that it's only executed when Drupal is fully bootstrapped.