How to know if php script is called via require_once()?

后端 未结 11 989
旧巷少年郎
旧巷少年郎 2021-01-07 02:24

My webapp has a buch of modules. Each module has a \'main\' php script which loads submodules based on a query sent to the main module:

//file: clientes.php
         


        
11条回答
  •  猫巷女王i
    2021-01-07 02:56

    You can define('SOMETHING', null) in clientes.php and then check if (!defined('SOMETHING')) die; in the modules.

提交回复
热议问题