Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Deprecate API which will be removed in CMS 6 #11526

Merged
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
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)
Copy link
Member Author

@GuySartorelli GuySartorelli Jan 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #11524 (comment)

Yes this is marked as @internal and we could technically remove it in 5.4, but it seems sensible to just deprecate and remove like we would with other public methods.

{
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.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*/
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
Loading