Function __global->require_code

Definitions

sources/global.php

  • Require a software PHP file while, where applicable, compiling in overrides from *_custom folders and contentious overrides.You should remember this function and use this opposed to require/include/require_once/include_once for proper modularity (except for bootstrap.php which has to be required directly).
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Return: N/A

Parameters

Name Type Default Set Range Description
$codename string required parameter N/A N/A The codename for the source module to load (or a full relative path, ending with .php; if custom checking is needed, this must be the custom version)
$light_exit boolean False N/A N/A Whether to cleanly fail when a source file is missing
$has_custom ?boolean Null N/A N/A Whether this is going to be from under a custom directory (null: search). This is used for performance to avoid extra searching when we already know where a file is
$force_custom boolean False N/A N/A Whether to forcefully allow custom overrides even if in safe mode (still ignored for files which do not support overrides)

sources/minikernel.php

  • This function is a very important one when coding. It allows you to include a source code file (from root/sources/ or root/sources_custom/) through the proper channels.You should remember this function, and not substitute anything else for it, as that will likely make your code unstable.It is key to source code modularity in Composr.
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Return: N/A

Parameters

Name Type Default Set Range Description
$codename string required parameter N/A N/A The codename for the source module to load