Skip to content

Commit

Permalink
Merge branch '5' into 6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Jan 7, 2025
2 parents 0edb872 + 06240b6 commit e6206bf
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 7 deletions.
8 changes: 5 additions & 3 deletions _config/logging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@ SilverStripe\Core\Injector\Injector:
pushDefaultLogger: [ pushLogger, [ '%$Psr\Log\LoggerInterface' ] ]
pushErrorHandler: [ pushLogger, [ '%$Psr\Log\LoggerInterface.errorhandler' ] ]

# Default implementation for use as a standard logger. Up to developers to attach their own
# handlers
# Default implementation for use as a standard logger. Used for logging custom messages.
# Projects should attach log handlers to this logging service.
Psr\Log\LoggerInterface:
type: singleton
class: Monolog\Logger
constructor:
- "error-log"
# Core error handling
# Core error handling - only uncaught exceptions and PHP errors should be caught by this handler.
# This handler displays those errors in the browser and CLI.
# Projects should not attach log handlers to this error handler service.
Psr\Log\LoggerInterface.errorhandler:
type: singleton
class: Monolog\Logger
Expand Down
3 changes: 3 additions & 0 deletions src/Control/Director.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use SilverStripe\Core\Kernel;
use SilverStripe\Core\Path;
use SilverStripe\PolyExecution\PolyCommand;
use SilverStripe\Dev\Deprecation;
use SilverStripe\Versioned\Versioned;
use SilverStripe\View\Requirements;
use SilverStripe\View\Requirements_Backend;
Expand Down Expand Up @@ -1062,9 +1063,11 @@ public static function get_environment_type()
* @param HTTPRequest $request
*
* @return string|null null if not overridden, otherwise the actual value
* @deprecated 5.4.0 Use get_environment_type() instead.
*/
public static function get_session_environment_type(?HTTPRequest $request = null)
{
Deprecation::notice('5.4.0', 'Use get_environment_type() instead.');
$request = static::currentRequest($request);

if (!$request) {
Expand Down
5 changes: 4 additions & 1 deletion src/Control/HTTPApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use SilverStripe\Core\Startup\RequestFlushDiscoverer;
use SilverStripe\Core\Startup\ScheduledFlushDiscoverer;
use SilverStripe\Core\Startup\DeployFlushDiscoverer;
use SilverStripe\Dev\Deprecation;

class HTTPApplication implements Application
{
Expand Down Expand Up @@ -165,6 +166,8 @@ public function execute(HTTPRequest $request, callable $callback, $flush = false
*/
private function warnAboutDeprecatedSetups()
{
// noop
if (defined('CUSTOM_INCLUDE_PATH')) {
Deprecation::notice('5.4.0', 'Use of the "CUSTOM_INCLUDE_PATH" constant is deprecated.', Deprecation::SCOPE_GLOBAL);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

/**
* Implements switching user session into Test and Dev environment types
* @deprecated 5.4.0 Will be removed without equivalent functionality to replace it.
*/
trait SessionEnvTypeSwitcher
{
Expand Down
2 changes: 2 additions & 0 deletions src/Core/Manifest/VersionProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,11 @@ protected function getComposerLock($cache = true)

/**
* @return string
* @deprecated 5.4.0 Will be removed without equivalent functionality to replace it.
*/
protected function getComposerLockPath(): string
{
Deprecation::noticeWithNoReplacment('5.4.0');
return BASE_PATH . '/composer.lock';
}
}
2 changes: 1 addition & 1 deletion src/Security/Member.php
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ protected function onBeforeWrite()
$email->send();
} catch (TransportExceptionInterface | RfcComplianceException $e) {
/** @var LoggerInterface $logger */
$logger = Injector::inst()->get(LoggerInterface::class . '.errorhandler');
$logger = Injector::inst()->get(LoggerInterface::class);
$logger->error('Error sending email in ' . __FILE__ . ' line ' . __LINE__ . ": {$e->getMessage()}");
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Security/MemberAuthenticator/LostPasswordHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ protected function sendEmail($member, $token)
return true;
} catch (TransportExceptionInterface | RfcComplianceException $e) {
/** @var LoggerInterface $logger */
$logger = Injector::inst()->get(LoggerInterface::class . '.errorhandler');
$logger = Injector::inst()->get(LoggerInterface::class);
$logger->error('Error sending email in ' . __FILE__ . ' line ' . __LINE__ . ": {$e->getMessage()}");
return false;
}
Expand Down
6 changes: 5 additions & 1 deletion src/i18n/Messages/Symfony/FlushInvalidatedResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace SilverStripe\i18n\Messages\Symfony;

use SilverStripe\Core\Flushable;
use SilverStripe\Dev\Deprecation;
use Symfony\Component\Config\Resource\SelfCheckingResourceInterface;

/**
Expand All @@ -19,9 +20,12 @@ public function __toString()
return md5(__CLASS__);
}

/**
* @deprecated 5.4.0 Will be removed without equivalent functionality to replace it.
*/
public function getResource()
{
// @deprecated at 3.0, do nothing
Deprecation::noticeWithNoReplacment('5.4.0');
return null;
}

Expand Down

0 comments on commit e6206bf

Please sign in to comment.