Function __global->compile_included_code

Definitions

sources/global.php

  • Compile some code into the _compiled directory if we need to for later inclusion by call_compiled_code.Do not use this function directly; use require_code instead.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: bool

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$orig_path string No No required parameter N/A N/A Path to the original or custom file (not _compiled one)
$codename string No No required parameter N/A N/A The codename for the source module to load
$light_exit boolean No No required parameter N/A N/A Whether to cleanly fail when an error occurs
&$code ?string Yes No Null N/A N/A Custom file contents, passed by reference (null: use contents from $orig_path and avoid making a _compiled file if we do not need one)

Returns

  • Whether we should delete any existing _compiled files for this, through call_compiled_code (null: special case; we are ignoring _compiled files and evaluating $code instead)
  • Type: ?boolean
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Compile some code into the _compiled directory if we need to for later inclusion by call_compiled_code.Do not use this function directly; use require_code instead.
 *
 * @param  string $orig_path Path to the original or custom file (not _compiled one)
 * @param  string $codename The codename for the source module to load
 * @param  boolean $light_exit Whether to cleanly fail when an error occurs
 * @param  ?string $code Custom file contents, passed by reference (null: use contents from $orig_path and avoid making a _compiled file if we do not need one)
 * @return ?boolean Whether we should delete any existing _compiled files for this, through call_compiled_code (null: special case; we are ignoring _compiled files and evaluating $code instead)
 */

function compile_included_code(string $orig_path, string $codename, bool $light_exit, ?string &$code = null) : ?bool