Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions system/Exceptions/DownloadException.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,6 @@ public static function forNotFoundDownloadSource()
return new static(lang('HTTP.notFoundDownloadSource'));
}

/**
* @deprecated Since v4.5.6
*
* @return static
*/
public static function forCannotSetCache()
{
return new static(lang('HTTP.cannotSetCache'));
}

/**
* @return static
*/
Expand Down
21 changes: 0 additions & 21 deletions system/Exceptions/FrameworkException.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,27 +55,6 @@ public static function forCopyError(string $path)
return new static(lang('Core.copyError', [$path]));
}

/**
* @return static
*
* @deprecated 4.5.0 No longer used.
*/
public static function forMissingExtension(string $extension)
{
if (str_contains($extension, 'intl')) {
// @codeCoverageIgnoreStart
$message = sprintf(
'The framework needs the following extension(s) installed and loaded: %s.',
$extension,
);
// @codeCoverageIgnoreEnd
} else {
$message = lang('Core.missingExtension', [$extension]);
}

return new static($message);
}

/**
* @return static
*/
Expand Down
14 changes: 0 additions & 14 deletions system/HTTP/Exceptions/HTTPException.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,20 +217,6 @@ public static function forMoveFailed(string $source, string $target, string $err
return new static(lang('HTTP.moveFailed', [$source, $target, $error]));
}

/**
* For Invalid SameSite attribute setting
*
* @return HTTPException
*
* @deprecated Use `CookieException::forInvalidSameSite()` instead.
*
* @codeCoverageIgnore
*/
public static function forInvalidSameSiteSetting(string $samesite)
{
return new static(lang('Security.invalidSameSiteSetting', [$samesite]));
}

/**
* Thrown when the JSON format is not supported.
* This is specifically for cases where data validation is expected to work with key-value structures.
Expand Down
12 changes: 0 additions & 12 deletions system/Honeypot/Exceptions/HoneypotException.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,6 @@ public static function forNoNameField()
return new static(lang('Honeypot.noNameField'));
}

/**
* Thrown when the hidden value of config is false.
*
* @return static
*
* @deprecated 4.6.4 Never used.
*/
public static function forNoHiddenValue()
{
return new static(lang('Honeypot.noHiddenValue'));
}

/**
* Thrown when there are no data in the request of honeypot field.
*
Expand Down
6 changes: 5 additions & 1 deletion system/Images/Handlers/ImageMagickHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use ImagickException;
use ImagickPixel;
use ImagickPixelException;
use RuntimeException;

/**
* Image handler for Imagick extension.
Expand All @@ -46,7 +47,10 @@ public function __construct($config = null)
parent::__construct($config);

if (! extension_loaded('imagick')) {
throw ImageException::forMissingExtension('IMAGICK'); // @codeCoverageIgnore
throw new RuntimeException(sprintf(
'The "%s" handler requires the "imagick" PHP extension.',
static::class,
));
}
}

Expand Down
1 change: 0 additions & 1 deletion system/Language/en/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@
'invalidFile' => 'Invalid file: "{0}"',
'invalidDirectory' => 'Directory does not exist: "{0}"',
'invalidPhpVersion' => 'Your PHP version must be {0} or higher to run CodeIgniter. Current version: {1}',
'missingExtension' => 'The framework needs the following extension(s) installed and loaded: "{0}".',
'noHandlers' => '"{0}" must provide at least one Handler.',
];
5 changes: 0 additions & 5 deletions system/Language/en/HTTP.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
'cannotSetBinary' => 'When setting filepath cannot set binary.',
'cannotSetFilepath' => 'When setting binary cannot set filepath: "{0}"',
'notFoundDownloadSource' => 'Not found download body source.',
'cannotSetCache' => 'It does not support caching for downloading.',
'cannotSetStatusCode' => 'It does not support change status code for downloading. code: {0}, reason: {1}',

// Response
Expand Down Expand Up @@ -76,8 +75,4 @@
'uploadErrNoTmpDir' => 'File could not be uploaded: missing temporary directory.',
'uploadErrExtension' => 'File upload was stopped by a PHP extension.',
'uploadErrUnknown' => 'The file "%s" was not uploaded due to an unknown error.',

// SameSite setting
// @deprecated
'invalidSameSiteSetting' => 'The SameSite setting must be None, Lax, Strict, or a blank string. Given: {0}',
];
3 changes: 0 additions & 3 deletions system/Language/en/Security.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,4 @@
return [
'disallowedAction' => 'The action you requested is not allowed.',
'insecureCookie' => 'Attempted to send a secure cookie over a non-secure connection.',

// @deprecated
'invalidSameSite' => 'The SameSite value must be None, Lax, Strict, or a blank string. Given: "{0}"',
];
3 changes: 0 additions & 3 deletions system/Language/en/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,4 @@
'writeProtectedSavePath' => 'Session: Configured save path "{0}" is not writable by the PHP process.',
'emptySavePath' => 'Session: No save path configured.',
'invalidSavePathFormat' => 'Session: Invalid Redis save path format: "{0}"',

// @deprecated
'invalidSameSiteSetting' => 'Session: The SameSite setting must be None, Lax, Strict, or a blank string. Given: "{0}"',
];
12 changes: 0 additions & 12 deletions system/Security/Exceptions/SecurityException.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,4 @@ public static function forInvalidControlChars(string $source, string $string)
400,
);
}

/**
* @deprecated Use `CookieException::forInvalidSameSite()` instead.
*
* @codeCoverageIgnore
*
* @return static
*/
public static function forInvalidSameSite(string $samesite)
{
return new static(lang('Security.invalidSameSite', [$samesite]));
}
}
12 changes: 0 additions & 12 deletions system/Session/Exceptions/SessionException.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,4 @@ public static function forInvalidSavePathFormat(string $path)
{
return new static(lang('Session.invalidSavePathFormat', [$path]));
}

/**
* @deprecated
*
* @return static
*
* @codeCoverageIgnore
*/
public static function forInvalidSameSiteSetting(string $samesite)
{
return new static(lang('Session.invalidSameSiteSetting', [$samesite]));
}
}
13 changes: 6 additions & 7 deletions system/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* ---------------------------------------------------------------
*/

use CodeIgniter\Exceptions\FrameworkException;
use Config\Autoload;
use Config\Modules;
use Config\Paths;
Expand Down Expand Up @@ -135,18 +134,18 @@
if (! is_file(COMPOSER_PATH)) {
$missingExtensions = [];

foreach ([
'intl',
'json',
'mbstring',
] as $extension) {
foreach (['intl', 'json', 'mbstring'] as $extension) {
if (! extension_loaded($extension)) {
$missingExtensions[] = $extension;
}
}

if ($missingExtensions !== []) {
throw FrameworkException::forMissingExtension(implode(', ', $missingExtensions));
throw new RuntimeException(sprintf(
'The framework needs the following extension%s installed and loaded: "%s".',
count($missingExtensions) > 1 ? 's' : '',
implode('", "', $missingExtensions),
));
}

unset($missingExtensions);
Expand Down
4 changes: 2 additions & 2 deletions tests/_support/Language/en/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
*/

return [
'missingExtension' => '{0} extension could not be found.',
'bazillion' => 'billions and billions', // adds a new setting
'invalidFile' => 'The file provided is invalid.', // replacement
'bazillion' => 'billions and billions', // new setting
];
15 changes: 10 additions & 5 deletions tests/system/Language/LanguageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,16 @@ public function testGetLocale(): void

public function testPrioritizedLocator(): void
{
// this should load the replacement bundle of messages
$message = lang('Core.missingExtension', [], 'en');
$this->assertSame('The framework needs the following extension(s) installed and loaded: "{0}".', $message);
// and we should have our new message too
$this->assertSame('billions and billions', lang('Core.bazillion', [], 'en'));
$this->assertSame(
'Invalid file: "{0}"',
lang('Core.invalidFile', [], 'en'),
'Failed asserting that the system language file is prioritized over the test support language file.',
);
$this->assertSame(
'billions and billions',
lang('Core.bazillion', [], 'en'),
'Failed asserting that the test support language file is used if key is not found in the system language file.',
);
}

/**
Expand Down
16 changes: 15 additions & 1 deletion user_guide_src/source/changelogs/v4.8.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Removed Deprecated Items
- ``CodeIgniter\CodeIgniter::determinePath()``
- ``CodeIgniter\CodeIgniter::callExit()``
- ``CodeIgniter\Test\MockCodeIgniter::callExit()``
- **Exceptions:** Removed the following properties and methods deprecated since v4.4.0:
- **Debug:** Removed the following properties and methods deprecated since v4.4.0:
- ``CodeIgniter\Debug\Exceptions::$ob_level``
- ``CodeIgniter\Debug\Exceptions::$viewPath``
- ``CodeIgniter\Debug\Exceptions::determineView()``
Expand All @@ -81,6 +81,13 @@ Removed Deprecated Items
- ``CodeIgniter\Debug\Exceptions::cleanPath()``
- ``CodeIgniter\Debug\Exceptions::describeMemory()``
- ``CodeIgniter\Debug\Exceptions::highlightFile()``
- **Exceptions:** Removed the following static constructors of ``FrameworkException`` and its child classes:
- ``CodeIgniter\Exceptions\DownloadException::forCannotSetCache()``
- ``CodeIgniter\Exceptions\FrameworkException::forMissingExtension()``
- ``CodeIgniter\Honeypot\Exceptions\HoneypotException::forNoHiddenValue()``
- ``CodeIgniter\HTTP\Exceptions\HTTPException::forInvalidSameSiteSetting()``
- ``CodeIgniter\Security\Exceptions\SecurityException::forInvalidSameSite()``
- ``CodeIgniter\Session\Exceptions\SessionException::forInvalidSameSiteSetting()``
- **Security:** Removed the following properties and methods deprecated:
- ``CodeIgniter\Security\SecurityInterface::sanitizeFilename()`` (deprecated since v4.6.2)
- ``CodeIgniter\Security\Security::sanitizeFilename()`` (deprecated since v4.6.2)
Expand Down Expand Up @@ -140,6 +147,13 @@ Others
Message Changes
***************

- Removed deprecated language keys tied to removed exception constructors:
- ``Core.missingExtension`` (``FrameworkException::forMissingExtension()``)
- ``HTTP.cannotSetCache`` (``DownloadException::forCannotSetCache()``)
- ``HTTP.invalidSameSiteSetting`` (``HTTPException::forInvalidSameSiteSetting()``)
- ``Security.invalidSameSite`` (``SecurityException::forInvalidSameSite()``)
- ``Session.invalidSameSiteSetting`` (``SessionException::forInvalidSameSiteSetting()``)

*******
Changes
*******
Expand Down
Loading