Skip to content

Commit 7d5c7d1

Browse files
committed
revert deprecation on Boot::initializeConsole()
1 parent ac44f57 commit 7d5c7d1

File tree

2 files changed

+4
-18
lines changed

2 files changed

+4
-18
lines changed

system/Boot.php

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public static function bootSpark(Paths $paths): int
162162

163163
static::initializeCodeIgniter();
164164

165-
return static::runCommand(new Console());
165+
return static::runCommand(static::initializeConsole());
166166
}
167167

168168
/**
@@ -421,24 +421,9 @@ protected static function saveConfigCache(FactoriesCache $factoriesCache): void
421421
$factoriesCache->save('config');
422422
}
423423

424-
/**
425-
* @deprecated 4.8.0 No longer used.
426-
*/
427424
protected static function initializeConsole(): Console
428425
{
429-
@trigger_error(sprintf('The static %s() method is deprecated and no longer used.', __METHOD__), E_USER_DEPRECATED);
430-
431-
$console = new Console();
432-
433-
// Show basic information before we do anything else.
434-
if (is_int($suppress = array_search('--no-header', $_SERVER['argv'], true))) {
435-
unset($_SERVER['argv'][$suppress]);
436-
$suppress = true;
437-
}
438-
439-
$console->showHeader($suppress);
440-
441-
return $console;
426+
return new Console();
442427
}
443428

444429
protected static function runCommand(Console $console): int

user_guide_src/source/changelogs/v4.8.0.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ BREAKING
2323
Behavior Changes
2424
================
2525

26+
- The static ``Boot::initializeConsole()`` method no longer handles the display of the console header. This is now handled within ``Console::run()``.
27+
If you have overridden ``Boot::initializeConsole()``, you should remove any code related to displaying the console header, as this is now the responsibility of the ``Console`` class.
2628
- **Commands:** The ``filter:check`` command now requires the HTTP method argument to be uppercase (e.g., ``spark filter:check GET /`` instead of ``spark filter:check get /``).
2729
- **Database:** The Postgre driver's ``$db->error()['code']`` previously always returned ``''``. It now returns the 5-character SQLSTATE string for query and transaction failures (e.g., ``'42P01'``), or ``'08006'`` for connection-level failures. Code that relied on ``$db->error()['code'] === ''`` will need updating.
2830
- **Filters:** HTTP method matching for method-based filters is now case-sensitive. The keys in ``Config\Filters::$methods`` must exactly match the request method
@@ -264,7 +266,6 @@ Changes
264266
Deprecations
265267
************
266268

267-
- The ``Boot::initializeConsole()`` method is now deprecated and will be removed in a future release.
268269
- **CLI:** The ``CLI::parseCommandLine()`` method is now deprecated and will be removed in a future release. The ``CLI`` class now uses the new ``CommandLineParser`` class to handle command-line argument parsing.
269270
- **CLI:** Returning a non-integer exit code from a command is now deprecated and will trigger a deprecation notice. Command methods should return an integer exit code (e.g., ``0`` for success, non-zero for errors) to ensure proper behavior across all platforms.
270271
- **HTTP:** The ``CLIRequest::parseCommand()`` method is now deprecated and will be removed in a future release. The ``CLIRequest`` class now uses the new ``CommandLineParser`` class to handle command-line argument parsing.

0 commit comments

Comments
 (0)