Although you don't have #ifdef like you do in C/C++, you do have the ability to set global variables. For instance,
in file a:
include (b)
-- check for INCLUDED_B to be set to true
-- if not, declare INCLUDED_B as set to true, and include
-- if it was previously set, ignore the file
include (c)
-- same as above, but use INCLUDED_C
in file b:
include (c)
-- same as above for include (c)
This should solve some of your problems.
Another possibility would be to make a standard include or require file that includes/requires all of the files you need -- then all of you files require it ... same checking:
if (isset($X))
Hope that helps.
--anthony