Version 4.3.6
This commit is contained in:
1 parent
fe1acf984a
commit
1a0c7fd3c2
609 files changed
+14707
-5726
No files matched your search
@@ -206,6 +206,11 @@ class _Output
|
||||
*/
|
||||
public $allowDefaultWidgets = TRUE;
|
||||
|
||||
/**
|
||||
* @brief Allow page caching. This can be set at any point during controller execution to override defaults
|
||||
*/
|
||||
public $pageCaching = TRUE;
|
||||
|
||||
/**
|
||||
* Get a JS bundle
|
||||
*
|
||||
@@ -227,7 +232,7 @@ class _Output
|
||||
|
||||
if ( $location === 'interface' AND mb_substr( $file, -3 ) === '.js' )
|
||||
{
|
||||
return array( rtrim( \IPS\Http\Url::baseUrl( \IPS\Http\Url::PROTOCOL_RELATIVE ), '/' ) . "/applications/{$app}/interface/{$file}?v=" . ( defined( \IPS\CACHEBUST_KEY ) ? \IPS\CACHEBUST_KEY : time() ) );
|
||||
return array( rtrim( \IPS\Http\Url::baseUrl( \IPS\Http\Url::PROTOCOL_RELATIVE ), '/' ) . "/applications/{$app}/interface/{$file}?v=" . ( defined( '\IPS\CACHEBUST_KEY' ) ? \IPS\CACHEBUST_KEY : time() ) );
|
||||
}
|
||||
elseif ( \IPS\IN_DEV )
|
||||
{
|
||||
@@ -711,7 +716,7 @@ class _Output
|
||||
|
||||
/* Full page caching for guests */
|
||||
if (
|
||||
\IPS\CACHE_PAGE_TIMEOUT and // Page caching is enabled
|
||||
\IPS\CACHE_PAGE_TIMEOUT and $this->pageCaching and // Page caching is enabled
|
||||
$cacheThisPage and // Some pages can specify not to be cached (for example, when displaying a cached page, you don't want it recached)
|
||||
!isset( \IPS\Request::i()->cookie['noCache'] ) and // A noCache cookie might get set to not cache a particular guest (for example, if they have added items to their cart in the store)
|
||||
mb_strtolower( $_SERVER['REQUEST_METHOD'] ) == 'get' and // Is a HTTP GET request (don't cache output for POSTs)
|
||||
@@ -720,11 +725,13 @@ class _Output
|
||||
\IPS\Dispatcher::hasInstance() and class_exists( 'IPS\Dispatcher', FALSE ) and \IPS\Dispatcher::i()->controllerLocation === 'front' and // Is a normal, front-end page (necessary to know if user is logged in)
|
||||
!\IPS\Member::loggedIn()->member_id // User is not logged in
|
||||
) {
|
||||
\IPS\Data\Cache::i()->storeWithExpire( 'page_' . md5( (int) \IPS\Request::i()->isSecure() . ( !empty( $_SERVER['HTTP_HOST'] ) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME'] ) . '/' . $_SERVER['REQUEST_URI'] ) . '_' . \IPS\Member::loggedIn()->language()->id . '_' . \IPS\Theme::i()->id, array(
|
||||
$theme = isset( \IPS\Request::i()->cookie['theme'] ) ? \IPS\Request::i()->cookie['theme'] : '';
|
||||
|
||||
\IPS\Data\Cache::i()->storeWithExpire( 'page_' . md5( (int) \IPS\Request::i()->isSecure() . ( !empty( $_SERVER['HTTP_HOST'] ) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME'] ) . '/' . $_SERVER['REQUEST_URI'] ) . '_' . \IPS\Member::loggedIn()->language()->id . '_' . $theme, array(
|
||||
'output' => str_replace( \IPS\Session::i()->csrfKey, '{{csrfKey}}', $output ),
|
||||
'code' => $httpStatusCode,
|
||||
'contentType' => $contentType,
|
||||
'httpHeaders' => $httpHeaders,
|
||||
'httpHeaders' => array_merge( $httpHeaders, array( 'X-IPS-Cached-Response' => \IPS\DateTime::create()->rfc1123() ) ),
|
||||
'lastUpdated' => time()
|
||||
), \IPS\DateTime::create()->add( new\DateInterval( 'PT' . \IPS\CACHE_PAGE_TIMEOUT . 'S' ) ), TRUE );
|
||||
}
|
||||
@@ -934,7 +941,7 @@ class _Output
|
||||
{
|
||||
try
|
||||
{
|
||||
static::$fileObjectClasses[ $data[1] ] = \IPS\File::getClass( $data[1] );
|
||||
static::$fileObjectClasses[ $data[1] ] = \IPS\File::getClass( $data[1], TRUE );
|
||||
}
|
||||
catch ( \RuntimeException $e )
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user