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

EZP-14306 Refresh eZExpiryHandler instance after change siteaccess. #1240

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions kernel/classes/ezsiteaccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,8 @@ static function change( array $access, eZINI $siteINI = null )
eZUpdateDebugSettings();
eZDebugSetting::writeDebug( 'kernel-siteaccess', "Updated settings to use siteaccess '$name'", __METHOD__ );
}

eZExpiryHandler::refresh();

return $access;
}
Expand Down
9 changes: 9 additions & 0 deletions lib/ezutils/classes/ezexpiryhandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,15 @@ static function instance()

return $GLOBALS['eZExpiryHandlerInstance'];
}

static function refresh()
{
if ( isset( $GLOBALS['eZExpiryHandlerInstance'] ) )
{
unset( $GLOBALS['eZExpiryHandlerInstance'] );
}
return self::instance();
Copy link
Member

Choose a reason for hiding this comment

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

Why does it return an instance ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Isn't usefull?

}

/**
* Checks if a shared instance of eZExpiryHandler exists
Expand Down