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 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
7 changes: 7 additions & 0 deletions kernel/classes/ezsiteaccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,13 @@ static function change( array $access, eZINI $siteINI = null )
eZDebugSetting::writeDebug( 'kernel-siteaccess', "Updated settings to use siteaccess '$name'", __METHOD__ );
}

$ini = eZINI::instance();
if ( $ini->hasVariable( 'ExpiryHandler', 'ExpiryFilePerSiteAccess' )
&& $ini->variable( 'ExpiryHandler', 'ExpiryFilePerSiteAccess' ) == 'enabled' )
{
eZExpiryHandler::refresh();
}

return $access;
}

Expand Down
8 changes: 8 additions & 0 deletions lib/ezutils/classes/ezexpiryhandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,14 @@ static function instance()

return $GLOBALS['eZExpiryHandlerInstance'];
}

static function refresh()
{
if ( isset( $GLOBALS['eZExpiryHandlerInstance'] ) )
{
unset( $GLOBALS['eZExpiryHandlerInstance'] );
}
}

/**
* Checks if a shared instance of eZExpiryHandler exists
Expand Down
2 changes: 2 additions & 0 deletions settings/site.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
# in non-virtualhost modes (the .php file may already be present
# and can be used for this purpose).

[ExpiryHandler]
ExpiryFilePerSiteAccess=disabled

[Cache]
# Array with cache items to extend ezcache
Expand Down