Skip to content

Commit

Permalink
Release v4.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Sep 5, 2023
1 parent 30008a0 commit 844616e
Show file tree
Hide file tree
Showing 42 changed files with 156 additions and 105 deletions.
2 changes: 2 additions & 0 deletions app/Config/Autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
*
* NOTE: This class is required prior to Autoloader instantiation,
* and does not extend BaseConfig.
*
* @immutable
*/
class Autoload extends AutoloadConfig
{
Expand Down
3 changes: 3 additions & 0 deletions app/Config/DocTypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

namespace Config;

/**
* @immutable
*/
class DocTypes
{
/**
Expand Down
6 changes: 5 additions & 1 deletion app/Config/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ class Email extends BaseConfig
public bool $SMTPKeepAlive = false;

/**
* SMTP Encryption. Either tls or ssl
* SMTP Encryption.
*
* @var string '', 'tls' or 'ssl'. 'tls' will issue a STARTTLS command
* to the server. 'ssl' means implicit SSL. Connection on port
* 465 should set this to ''.
*/
public string $SMTPCrypto = 'tls';

Expand Down
3 changes: 3 additions & 0 deletions app/Config/ForeignCharacters.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

use CodeIgniter\Config\ForeignCharacters as BaseForeignCharacters;

/**
* @immutable
*/
class ForeignCharacters extends BaseForeignCharacters
{
}
2 changes: 2 additions & 0 deletions app/Config/Mimes.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*
* When working with mime types, please make sure you have the ´fileinfo´
* extension enabled to reliably detect the media types.
*
* @immutable
*/
class Mimes
{
Expand Down
2 changes: 2 additions & 0 deletions app/Config/Modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
*
* NOTE: This class is required prior to Autoloader instantiation,
* and does not extend BaseConfig.
*
* @immutable
*/
class Modules extends BaseModules
{
Expand Down
2 changes: 1 addition & 1 deletion system/CLI/CLI.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public static function init()
* Named options must be in the following formats:
* php index.php user -v --v -name=John --name=John
*
* @param string $prefix
* @param string $prefix You may specify a string with which to prompt the user.
*/
public static function input(?string $prefix = null): string
{
Expand Down
3 changes: 3 additions & 0 deletions system/Cache/Handlers/BaseHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public static function validateKey($key, $prefix = ''): string
* @param string $key Cache item name
* @param int $ttl Time to live
* @param Closure $callback Callback return value
* @phpstan-param Closure(): mixed $callback
*
* @return array|bool|float|int|object|string|null
*/
Expand All @@ -98,6 +99,8 @@ public function remember(string $key, int $ttl, Closure $callback)
*
* @param string $pattern Cache items glob-style pattern
*
* @return int|never
*
* @throws Exception
*/
public function deleteMatching(string $pattern)
Expand Down
2 changes: 2 additions & 0 deletions system/Cache/Handlers/DummyHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ public function delete(string $key)

/**
* {@inheritDoc}
*
* @return int
*/
public function deleteMatching(string $pattern)
{
Expand Down
2 changes: 2 additions & 0 deletions system/Cache/Handlers/FileHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ public function delete(string $key)

/**
* {@inheritDoc}
*
* @return int
*/
public function deleteMatching(string $pattern)
{
Expand Down
2 changes: 2 additions & 0 deletions system/Cache/Handlers/MemcachedHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ public function delete(string $key)

/**
* {@inheritDoc}
*
* @return never
*/
public function deleteMatching(string $pattern)
{
Expand Down
2 changes: 2 additions & 0 deletions system/Cache/Handlers/PredisHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ public function delete(string $key)

/**
* {@inheritDoc}
*
* @return int
*/
public function deleteMatching(string $pattern)
{
Expand Down
2 changes: 2 additions & 0 deletions system/Cache/Handlers/RedisHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ public function delete(string $key)

/**
* {@inheritDoc}
*
* @return int
*/
public function deleteMatching(string $pattern)
{
Expand Down
2 changes: 2 additions & 0 deletions system/Cache/Handlers/WincacheHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ public function delete(string $key)

/**
* {@inheritDoc}
*
* @return never
*/
public function deleteMatching(string $pattern)
{
Expand Down
6 changes: 5 additions & 1 deletion system/CodeIgniter.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class CodeIgniter
/**
* The current version of CodeIgniter Framework
*/
public const CI_VERSION = '4.4.0';
public const CI_VERSION = '4.4.1';

/**
* App startup time.
Expand Down Expand Up @@ -468,6 +468,8 @@ protected function handleRequest(?RouteCollectionInterface $routes, Cache $cache

// If a ResponseInterface instance is returned then send it back to the client and stop
if ($possibleResponse instanceof ResponseInterface) {
$this->outputBufferingEnd();

return $possibleResponse;
}

Expand Down Expand Up @@ -701,6 +703,8 @@ public function displayCache(Cache $config)
* Tells the app that the final output should be cached.
*
* @deprecated 4.4.0 Moved to ResponseCache::setTtl(). to No longer used.
*
* @return void
*/
public static function cache(int $time)
{
Expand Down
14 changes: 12 additions & 2 deletions system/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -886,11 +886,21 @@ function redirect(?string $route = null): RedirectResponse
/**
* Generates the solidus character (`/`) depending on the HTML5 compatibility flag in `Config\DocTypes`
*
* @param DocTypes|null $docTypesConfig New config. For testing purpose only.
*
* @internal
*/
function _solidus(): string
function _solidus(?DocTypes $docTypesConfig = null): string
{
if (config(DocTypes::class)->html5 ?? false) {
static $docTypes = null;

if ($docTypesConfig !== null) {
$docTypes = $docTypesConfig;
}

$docTypes ??= new DocTypes();

if ($docTypes->html5 ?? false) {
return '';
}

Expand Down
50 changes: 41 additions & 9 deletions system/Config/Factories.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ public static function define(string $component, string $alias, string $classnam
self::getOptions($component);

self::$aliases[$component][$alias] = $classname;
self::$updated[$component] = true;
}

/**
Expand All @@ -142,6 +143,7 @@ public static function __callStatic(string $component, array $arguments)
return new $class(...$arguments);
}

// Try to locate the class
if ($class = self::locateClass($options, $alias)) {
return new $class(...$arguments);
}
Expand All @@ -160,14 +162,8 @@ public static function __callStatic(string $component, array $arguments)
return null;
}

self::$instances[$options['component']][$class] = new $class(...$arguments);
self::$aliases[$options['component']][$alias] = $class;
self::$updated[$options['component']] = true;

// If a short classname is specified, also register FQCN to share the instance.
if (! isset(self::$aliases[$options['component']][$class])) {
self::$aliases[$options['component']][$class] = $class;
}
self::createInstance($options['component'], $class, $arguments);
self::setAlias($options['component'], $alias, $class);

return self::$instances[$options['component']][$class];
}
Expand All @@ -179,6 +175,7 @@ public static function __callStatic(string $component, array $arguments)
*/
private static function getDefinedInstance(array $options, string $alias, array $arguments)
{
// The alias is already defined.
if (isset(self::$aliases[$options['component']][$alias])) {
$class = self::$aliases[$options['component']][$alias];

Expand All @@ -189,15 +186,50 @@ private static function getDefinedInstance(array $options, string $alias, array
return self::$instances[$options['component']][$class];
}

self::$instances[$options['component']][$class] = new $class(...$arguments);
self::createInstance($options['component'], $class, $arguments);

return self::$instances[$options['component']][$class];
}
}

// Try to locate the class
if (! $class = self::locateClass($options, $alias)) {
return null;
}

// Check for an existing instance for the class
if (isset(self::$instances[$options['component']][$class])) {
self::setAlias($options['component'], $alias, $class);

return self::$instances[$options['component']][$class];
}

return null;
}

/**
* Creates the shared instance.
*/
private static function createInstance(string $component, string $class, array $arguments): void
{
self::$instances[$component][$class] = new $class(...$arguments);
self::$updated[$component] = true;
}

/**
* Sets alias
*/
private static function setAlias(string $component, string $alias, string $class): void
{
self::$aliases[$component][$alias] = $class;
self::$updated[$component] = true;

// If a short classname is specified, also register FQCN to share the instance.
if (! isset(self::$aliases[$component][$class]) && ! self::isNamespaced($alias)) {
self::$aliases[$component][$class] = $class;
}
}

/**
* Is the component Config?
*
Expand Down
2 changes: 1 addition & 1 deletion system/Config/Services.php
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ public static function toolbar(?ToolbarConfig $config = null, bool $getShared =
/**
* The URI class provides a way to model and manipulate URIs.
*
* @param string $uri
* @param string|null $uri The URI string
*
* @return URI The current URI if $uri is null.
*/
Expand Down
1 change: 0 additions & 1 deletion system/Database/BaseBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,6 @@ public function where($key, $value = null, ?bool $escape = null)
*
* @param array|RawSql|string $key
* @param mixed $value
* @param bool $escape
*
* @return $this
*/
Expand Down
4 changes: 0 additions & 4 deletions system/Database/Migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ abstract class Migration

/**
* Constructor.
*
* @param Forge $forge
*/
public function __construct(?Forge $forge = null)
{
Expand All @@ -53,8 +51,6 @@ public function __construct(?Forge $forge = null)

/**
* Returns the database group name this migration uses.
*
* @return string
*/
public function getDBGroup(): ?string
{
Expand Down
2 changes: 0 additions & 2 deletions system/Database/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,6 @@ public function getQuery(): string
* for it's start and end values. If no end value is present, will
* use the current time to determine total duration.
*
* @param float $end
*
* @return $this
*/
public function setDuration(float $start, ?float $end = null)
Expand Down
3 changes: 0 additions & 3 deletions system/Debug/Toolbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,6 @@ protected function roundTo(float $number, int $increments = 5): float
/**
* Prepare for debugging..
*
* @param RequestInterface $request
* @param ResponseInterface $response
*
* @return void
*/
public function prepare(?RequestInterface $request = null, ?ResponseInterface $response = null)
Expand Down
19 changes: 8 additions & 11 deletions system/Debug/Toolbar/Views/toolbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,14 @@
white-space: nowrap;
z-index: 10000;
}
#debug-bar .toolbar .rotate {
animation: toolbar-rotate 9s linear infinite;
}
@keyframes toolbar-rotate {
to {
transform: rotate(360deg);
}
}
#debug-bar.fixed-top {
bottom: auto;
top: 0;
Expand Down Expand Up @@ -796,14 +804,3 @@
.debug-bar-noverflow {
overflow: hidden;
}

/* ENDLESS ROTATE */
.rotate {
animation: rotate 9s linear infinite;
}

@keyframes rotate {
to {
transform: rotate(360deg);
}
}
10 changes: 8 additions & 2 deletions system/Email/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ class Email
/**
* SMTP Encryption
*
* @var string Empty, 'tls' or 'ssl'
* @var string '', 'tls' or 'ssl'. 'tls' will issue a STARTTLS command
* to the server. 'ssl' means implicit SSL. Connection on port
* 465 should set this to ''.
*/
public $SMTPCrypto = '';

Expand Down Expand Up @@ -1868,9 +1870,13 @@ protected function SMTPConnect()

$ssl = '';

// Connection to port 465 should use implicit TLS (without STARTTLS)
// as per RFC 8314.
if ($this->SMTPPort === 465) {
$ssl = 'tls://';
} elseif ($this->SMTPCrypto === 'ssl') {
}
// But if $SMTPCrypto is set to `ssl`, SSL can be used.
if ($this->SMTPCrypto === 'ssl') {
$ssl = 'ssl://';
}

Expand Down
Loading

0 comments on commit 844616e

Please sign in to comment.