(Broken) Manual Cron Bad Mix With path_to_theme

If you run cron manually and have custom theme code that lives on a database - code that runs a call to 'path_to_theme' - then your cron run probably doesn't finish (start ?).

the theme in use: sites/all/themes/zen/sub-theme
php code run in a block lives here: sites/all/themes/zen/sub-theme/block_code/
Run Cron Manually: /admin/reports/status/run-cron

The scenario: I have PHP code that I need to run in a block. The code needs to be protected from editing AND should be version controlled. For these reasons, I put the code on the filesystem in a theme subdirectory, added it to svn and "required" it from within the Drupal block. I used a path_to_theme() call to trivialize theme changes in the future.

The problem is that I kept, as most Drupal shops would, the administration theme set to Garland. In doing so, the system went looking for these same blocks and attached code when I ran the manual cron script in /admin/reports/status/run-cron -- but in (what Drupal seemed to think was the current theme) -- Garland. The belief at this time is that it happened when cron initiated search indexing. The fact is a few possible mistakes were made here:
1) I called require instead of include - the require causes an exit with fatal error where include would just throw a warning.
2) Search is not checking for the assigned theme before indexing nodes (bug).
3) This code may have been better off placed in a block template rather than include/require code.

Resolution for us was to use include rather than require. You're welcome to try anything else.