Version 4.6.0
This commit is contained in:
1 parent
f79dcf067a
commit
517a5e1f70
2036 files changed
+110041
-26162
No files matched your search
@@ -77,24 +77,24 @@ class IPS
|
||||
$outputCacheConfig = NULL;
|
||||
$guestTimeout = 30;
|
||||
|
||||
if ( isset( self::$cicConfig['redis-guest-cache'] ) and self::$cicConfig['redis-guest-cache'] == 'on' )
|
||||
if ( isset( self::$cicConfig['guests']['guest_cache_timeout'] ) and self::$cicConfig['guests']['guest_cache_timeout'] and \is_numeric( self::$cicConfig['guests']['guest_cache_timeout'] ) )
|
||||
{
|
||||
$outputCache = 'Redis';
|
||||
$guestTimeout = 900;
|
||||
$guestTimeout = \intval( self::$cicConfig['guests']['guest_cache_timeout'] );
|
||||
}
|
||||
|
||||
if ( isset( self::$cicConfig['guest_cache_timeout'] ) and self::$cicConfig['guest_cache_timeout'] and \is_numeric( self::$cicConfig['guest_cache_timeout'] ) )
|
||||
{
|
||||
$guestTimeout = \intval( self::$cicConfig['guest_cache_timeout'] );
|
||||
}
|
||||
|
||||
if ( isset( self::$cicConfig['redis'] ) and \is_array( self::$cicConfig['redis'] ) )
|
||||
if ( isset( self::$cicConfig['redis'] ) and \is_array( self::$cicConfig['redis'] ) AND self::$cicConfig['redis']['enabled'] == TRUE )
|
||||
{
|
||||
if ( isset( self::$cicConfig['redis']['guest_cache'] ) and self::$cicConfig['redis']['guest_cache'] == TRUE )
|
||||
{
|
||||
$outputCache = 'Redis';
|
||||
$guestTimeout = self::$cicConfig['redis']['guest_cache_timeout'];
|
||||
}
|
||||
|
||||
$storeMethod = 'Redis';
|
||||
$cacheMethod = 'Redis';
|
||||
$redisEnabled = TRUE;
|
||||
|
||||
$redisConfig = json_encode( self::compileCicRedisConfig() );
|
||||
$redisConfig = self::compileCicRedisConfig();
|
||||
}
|
||||
else if ( isset( $_SERVER['IPS_CIC'] ) )
|
||||
{
|
||||
@@ -105,6 +105,13 @@ class IPS
|
||||
$cacheMethod = 'None';
|
||||
$cacheConfig = '{}';
|
||||
}
|
||||
|
||||
/* Completely disable output caching */
|
||||
if( isset( self::$cicConfig['guests']['disable_output_caching'] ) AND self::$cicConfig['guests']['disable_output_caching'] === TRUE )
|
||||
{
|
||||
$outputCache = 'None';
|
||||
}
|
||||
|
||||
$sitePath = __DIR__;
|
||||
if ( isset( $_SERVER['IPS_CIC'] ) )
|
||||
{
|
||||
@@ -115,7 +122,7 @@ class IPS
|
||||
}
|
||||
else
|
||||
{
|
||||
$uniqueKey = preg_match( '/^\/var\/www\/html\/(.+?)$/i', __DIR__, $matches ) ? str_replace( '/', '', $matches[1] ) : mb_substr( md5( 'abf7b' . '$Rev: 3023$'), 10, 10 );
|
||||
$uniqueKey = preg_match( '/^\/var\/www\/html\/(.+?)$/i', __DIR__, $matches ) ? str_replace( '/', '', $matches[1] ) : mb_substr( md5( '13_mafia' . '$Rev: 3023$'), 10, 10 );
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -176,10 +183,6 @@ class IPS
|
||||
// won't be able to be read. So if you *do* change those, you can set this constant
|
||||
// to md5( old_database_pass + old_database_name ) to fix that.
|
||||
'TEXT_ENCRYPTION_KEY' => NULL,
|
||||
|
||||
// Encrypt data stored in Redis?
|
||||
// Needed in any environment where the Redis server is shared for security reasons
|
||||
'REDIS_ENCRYPT' => TRUE,
|
||||
|
||||
// Data storage / caching settings
|
||||
// To change any of the below, go to [AdminCP > System > Advanced Configuration >
|
||||
@@ -187,13 +190,13 @@ class IPS
|
||||
// file to use without messing with anything else you've changed.
|
||||
'STORE_METHOD' => $storeMethod, // Data storage method (Database, Redis or FileSystem)
|
||||
'STORE_CONFIG' => $storeConfig, // JSON-encoded settings specific to the Data storage method
|
||||
'CACHE_METHOD' => $cacheMethod, // Caching Method (Redis, Memcache, etc. "None" to disable)
|
||||
'CACHE_METHOD' => $cacheMethod, // Caching Method (Redis or "None" to disable)
|
||||
'CACHE_CONFIG' => $cacheConfig, // JSON-encoded settings specific to the caching storage method
|
||||
'CACHE_PAGE_TIMEOUT' => $guestTimeout, // Guest page caching timeout in seconds
|
||||
'CACHE_PAGE_TIMEOUT' => $guestTimeout, // Guest caching timeout in seconds
|
||||
'REDIS_ENABLED' => $redisEnabled, // Use Redis for sessions and to topic view counters in addition to normal caching?
|
||||
'REDIS_CONFIG' => $redisConfig, // JSON-encoded settings specific to Redis
|
||||
// These ones can't be changed in the AdminCP, but it's the same idea - allows Redis to be used for caching *except* guest page caching:
|
||||
'OUTPUT_CACHE_METHOD' => $outputCache, // Caching Method for guest page caching (Redis or Database)
|
||||
'OUTPUT_CACHE_METHOD' => $outputCache, // Caching Method for guest page caching (Redis, Database or None)
|
||||
'OUTPUT_CACHE_METHOD_CONFIG' => $outputCacheConfig , // JSON-encoded settings specific to the guest page caching method
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
@@ -204,6 +207,9 @@ class IPS
|
||||
// Disable IP address checking when validating the AdminCP sessions?
|
||||
// See https://remoteservices.invisionpower.com/docs/disable_ip_check
|
||||
'BYPASS_ACP_IP_CHECK' => FALSE,
|
||||
|
||||
// Number of seconds to consider AdminCP sessions valid for
|
||||
'ACP_SESSION_TIMEOUT' => 3600,
|
||||
|
||||
// File permissions
|
||||
// For example: when making folders for files to be uploaded to, what permissions
|
||||
@@ -251,6 +257,7 @@ class IPS
|
||||
'NOTIFICATIONS_PER_BATCH' => 30,
|
||||
|
||||
// Maximum number of things to rebuild per cycle for background tasks
|
||||
'REBUILD_INTENSE' => 1, // For extremely intensive routines, such as rebuilding images
|
||||
'REBUILD_SLOW' => 50, // For routines that take a while
|
||||
'REBUILD_NORMAL' => 250, // For most routines
|
||||
'REBUILD_QUICK' => 500, // For routines that are fast
|
||||
@@ -289,6 +296,9 @@ class IPS
|
||||
// How long a task is late running before the admin gets a notification
|
||||
// CiC is longer as CiC is more closely monitored and delayed tasks are not a symptom of a hosting issue
|
||||
'TASK_OVERDUE_HOURS' => 36,
|
||||
|
||||
// Allow ServiceWorker cachebusting
|
||||
'SW_CACHE_BUST' => TRUE,
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// DEPRECATED OPTIONS: CHANGE AT YOUR OWN RISK
|
||||
@@ -326,6 +336,12 @@ class IPS
|
||||
// developers may want to disable it.
|
||||
// Has no effect if IN_DEV is FALSE
|
||||
'IN_DEV_STRICT_MODE' => TRUE,
|
||||
|
||||
// Disable ACP session timeout?
|
||||
// Disables the ACP session timeout check. Useful for developing where you may
|
||||
// get logged out of the ACP in between requests while working.
|
||||
// Has no effect if IN_DEV is FALSE
|
||||
'DEV_DISABLE_ACP_SESSION_TIMEOUT' => FALSE,
|
||||
|
||||
// Hide developer mode tools?
|
||||
// Makes Developer Mode not look like Developer Mode so that IPS developers can take
|
||||
@@ -455,7 +471,7 @@ class IPS
|
||||
'SITE_FILES_PATH' => $sitePath,
|
||||
|
||||
// Root path to community
|
||||
'ROOT_PATH' => __DIR__,
|
||||
'ROOT_PATH' => __DIR__, // Please use \IPS\Application::getRootPath() instead of the constant in 3rd party code
|
||||
|
||||
// Random strings that change every time Invision Community is built
|
||||
// Used as a prefix in some data storage and cache engines to prevent conflicts, cache
|
||||
@@ -488,7 +504,7 @@ class IPS
|
||||
'APP_MULTICOMMUNITY_ITUNES_URL' => 'https://testflight.apple.com/join/bzsWOXFO',
|
||||
'APP_MULTICOMMUNITY_PLAY_ID' => 'com.invisioncommunity.communities',
|
||||
'APP_MULTICOMMUNITY_PLAY_URL' => 'https://play.google.com/apps/testing/com.invisioncommunity.communities',
|
||||
'APP_MULTICOMMUNITY_SCHEMA' => 'invision-communities',
|
||||
'APP_MULTICOMMUNITY_SCHEMA' => 'invisioncommunities',
|
||||
'DEBUG_OAUTH_REDIRECTS' => [],
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
@@ -913,7 +929,7 @@ class IPS
|
||||
* @param string $path The file path.
|
||||
* @return bool
|
||||
*/
|
||||
protected static function isThirdParty( string $path ): bool
|
||||
public static function isThirdParty( string $path ): bool
|
||||
{
|
||||
$bits = explode( '/', $path );
|
||||
|
||||
@@ -1103,9 +1119,10 @@ class IPS
|
||||
}
|
||||
|
||||
/* Don't allow error pages to be cached */
|
||||
header( "Cache-Control: no-cache, no-store, must-revalidate" );
|
||||
header( "Pragma: no-cache" );
|
||||
header( "Expires: 0" );
|
||||
foreach( \IPS\Output::getNoCacheHeaders() as $headerKey => $headerValue )
|
||||
{
|
||||
header( "{$headerKey}: {$headerValue}" );
|
||||
}
|
||||
|
||||
require \IPS\ROOT_PATH . '/' . \IPS\ERROR_PAGE;
|
||||
exit;
|
||||
@@ -1235,7 +1252,7 @@ class IPS
|
||||
{
|
||||
foreach ( $matches[1] as $appKey )
|
||||
{
|
||||
if ( !\in_array( $appKey, \IPS\Application::$ipsApps ) )
|
||||
if ( !\in_array( $appKey, \IPS\IPS::$ipsApps ) )
|
||||
{
|
||||
return $appKey;
|
||||
}
|
||||
@@ -1251,7 +1268,7 @@ class IPS
|
||||
{
|
||||
if ( preg_match( '/' . preg_quote( DIRECTORY_SEPARATOR, '/' ) . 'applications' . preg_quote( DIRECTORY_SEPARATOR, '/' ) . '([a-zA-Z]+)/', str_replace( \IPS\ROOT_PATH, '', $line ), $matches ) )
|
||||
{
|
||||
if ( !\in_array( $matches[1], \IPS\Application::$ipsApps ) )
|
||||
if ( !\in_array( $matches[1], \IPS\IPS::$ipsApps ) )
|
||||
{
|
||||
return $matches[1];
|
||||
}
|
||||
@@ -1342,6 +1359,21 @@ class IPS
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Can Manage Resources?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function canManageResources(): bool
|
||||
{
|
||||
if ( \function_exists( 'IPS\Cicloud\canManageResources' ) )
|
||||
{
|
||||
return \IPS\Cicloud\canManageResources();
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/* Init */
|
||||
|
||||
Reference in new issue
Block a user