Skip to content

Commit

Permalink
API Deprecate API which will be removed in CMS 6 (#11526)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli authored Jan 7, 2025
1 parent 2d472f4 commit 06240b6
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/Control/Director.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Core\Kernel;
use SilverStripe\Core\Path;
use SilverStripe\Dev\Deprecation;
use SilverStripe\Versioned\Versioned;
use SilverStripe\View\Requirements;
use SilverStripe\View\Requirements_Backend;
Expand Down Expand Up @@ -1037,9 +1038,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';
}
}
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 @@ -20,9 +21,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 06240b6

Please sign in to comment.