If you have a MAIN php script which you don't want to be included by other scripts, you could use this function. For example:
main.php:
<?php
function blockit()
{
$buf = get_included_files();
return $buf[0] != __FILE__;
}
blockit() and exit("You can not include a MAIN file as a part of your script.");
print "OK";
?>
So other script couldn't include main.php to modify its internal global vars.