Есть ли элегантный способ проверить, был ли файл включен с помощью include
/include_once
/require
/require_once
, или если страница была загружена напрямую? Я пытаюсь настроить файл тестирования внутри файлов класса, пока я их создаю.
Я ищу что-то похожее на технику Python if __name__ == "__main__":
. Без установки глобальных или констант.