|
1 | 1 | <?php |
| 2 | + |
| 3 | +// Load the color functions. |
| 4 | +require_once __DIR__ . '/src/utils.php'; |
| 5 | + |
| 6 | +// Detect if uopz extension is intercepting exit() calls, which breaks command execution flow. |
| 7 | +if ( extension_loaded( 'uopz' ) && ! ini_get( 'uopz.exit' ) ) { |
| 8 | + echo \StellarWP\Slic\red( 'Error: The uopz extension is preventing exit() from working.' . PHP_EOL ); |
| 9 | + echo \StellarWP\Slic\red( 'Set uopz.exit=1 in your php.ini or run: php -d uopz.exit=1 slic' . PHP_EOL ); |
| 10 | + echo \StellarWP\Slic\red( 'See: https://www.php.net/manual/en/uopz.configuration.php#ini.uopz.exit' . PHP_EOL ); |
| 11 | + |
| 12 | + // Re-enable exit for this process, then terminate. |
| 13 | + if ( PHP_VERSION_ID < 80400 ) { |
| 14 | + uopz_allow_exit( true ); |
| 15 | + } else { |
| 16 | + uopz_unset_return( 'exit' ); |
| 17 | + uopz_unset_return( 'die' ); |
| 18 | + } |
| 19 | + |
| 20 | + exit( 1 ); |
| 21 | +} |
| 22 | + |
2 | 23 | // Requires the function files we might need. |
3 | 24 | require_once __DIR__ . '/includes/polyfills.php'; |
4 | 25 | require_once __DIR__ . '/src/classes/Cache.php'; |
5 | 26 | require_once __DIR__ . '/src/cache.php'; |
6 | | -require_once __DIR__ . '/src/utils.php'; |
7 | 27 | require_once __DIR__ . '/src/scaffold.php'; |
8 | 28 | require_once __DIR__ . '/src/slic.php'; |
9 | 29 | require_once __DIR__ . '/src/docker.php'; |
|
34 | 54 | ] ); |
35 | 55 |
|
36 | 56 | $cli_name = 'slic'; |
37 | | -const CLI_VERSION = '2.1.5'; |
| 57 | +const CLI_VERSION = '2.1.6'; |
38 | 58 |
|
39 | 59 | // If the run-time option `-q`, for "quiet", is specified, then do not print the header. |
40 | 60 | if ( in_array( '-q', $argv, true ) || ( in_array( 'exec', $argv, true ) && ! in_array( 'help', $argv, true ) ) ) { |
|
0 commit comments