Version 4.7.0
This commit is contained in:
1 parent
517a5e1f70
commit
8ba7d43898
1933 files changed
+65613
-11332
No files matched your search
@@ -19,6 +19,11 @@ class IPS
|
||||
* @brief Classes that have hooks on
|
||||
*/
|
||||
public static $hooks = array();
|
||||
|
||||
/**
|
||||
* @brief Loaded Hooks
|
||||
*/
|
||||
public static $loadedHooks = array();
|
||||
|
||||
/**
|
||||
* @brief Unique key for this suite (used in http requests to defy browser caching)
|
||||
@@ -51,6 +56,7 @@ class IPS
|
||||
public static $ipsApps = array(
|
||||
'blog',
|
||||
'calendar',
|
||||
'cloud',
|
||||
'cms',
|
||||
'core',
|
||||
'downloads',
|
||||
@@ -198,6 +204,10 @@ class IPS
|
||||
// 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, Database or None)
|
||||
'OUTPUT_CACHE_METHOD_CONFIG' => $outputCacheConfig , // JSON-encoded settings specific to the guest page caching method
|
||||
|
||||
// Elastic search HTTP auth
|
||||
'ELASTICSEARCH_USER' => NULL,
|
||||
'ELASTICSEARCH_PASSWORD' => NULL,
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// SERVER ENVIRONMENT OPTIONS: CAN BE CHANGED IF YOU'RE 100% SURE YOU KNOW WHAT YOU'RE DOING
|
||||
@@ -296,9 +306,6 @@ 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
|
||||
@@ -468,6 +475,7 @@ class IPS
|
||||
// Used to hardcode some settings, tweak certain explainations of how to do things, etc.
|
||||
'CIC' => isset( $_SERVER['IPS_CIC'] ),
|
||||
'CIC2' => ( isset( $_SERVER['IPS_CLOUD2'] ) AND isset( $_SERVER['IPS_CLOUD2_ID'] ) ),
|
||||
'CIC_EXPERIMENTAL' => FALSE,
|
||||
'SITE_FILES_PATH' => $sitePath,
|
||||
|
||||
// Root path to community
|
||||
@@ -569,9 +577,14 @@ class IPS
|
||||
}
|
||||
|
||||
/* Load in our CiC functions */
|
||||
if( file_exists( __DIR__ . '/system/Cicloud/Cicloud.php' ) )
|
||||
if ( isset( $_SERVER['IPS_CLOUD2'] ) AND isset( $_SERVER['IPS_CLOUD2_ID'] ) AND file_exists( "/var/www/sitefiles/{$_SERVER['IPS_CLOUD2_ID']}/applications/cloud/sources/functions.php" ) )
|
||||
{
|
||||
@require_once( __DIR__ . '/system/Cicloud/Cicloud.php' );
|
||||
/* If we are uploading the cloud app manually, we need this */
|
||||
@include_once( "/var/www/sitefiles/{$_SERVER['IPS_CLOUD2_ID']}/applications/cloud/sources/functions.php" );
|
||||
}
|
||||
else if( file_exists( __DIR__ . '/applications/cloud/sources/functions.php' ) )
|
||||
{
|
||||
@require_once( __DIR__ . '/applications/cloud/sources/functions.php' );
|
||||
}
|
||||
|
||||
/* Do we have a CiC config */
|
||||
@@ -621,6 +634,13 @@ class IPS
|
||||
}
|
||||
$whoops->pushHandler( $handler );
|
||||
$whoops->register();
|
||||
|
||||
/* Remove some 8.1 deprecated errors for now */
|
||||
$dirSep = preg_quote( DIRECTORY_SEPARATOR );
|
||||
$whoops->silenceErrorsInPaths( [
|
||||
"#applications{$dirSep}(" . implode( '|', static::$ipsApps ) . ')#',
|
||||
"#system#i",
|
||||
], E_DEPRECATED );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -631,7 +651,7 @@ class IPS
|
||||
/* Init hooks */
|
||||
if ( file_exists( \IPS\SITE_FILES_PATH . "/plugins/hooks.php" ) )
|
||||
{
|
||||
if ( !( self::$hooks = require( \IPS\SITE_FILES_PATH . '/plugins/hooks.php' ) ) )
|
||||
if ( \IPS\RECOVERY_MODE or !( self::$hooks = require( \IPS\SITE_FILES_PATH . '/plugins/hooks.php' ) ) )
|
||||
{
|
||||
self::$hooks = array();
|
||||
}
|
||||
@@ -896,6 +916,11 @@ class IPS
|
||||
}
|
||||
if ( file_exists( $path . '/' . $data['file'] ) )
|
||||
{
|
||||
if( static::isThirdParty( $data['file'] ) )
|
||||
{
|
||||
static::$loadedHooks[] = $data['file'];
|
||||
}
|
||||
|
||||
$contents = "namespace {$namespace}; ". str_replace( '_HOOK_CLASS_', $realClass, file_get_contents( $path . '/' . $data['file'] ) );
|
||||
try
|
||||
{
|
||||
@@ -906,8 +931,8 @@ class IPS
|
||||
}
|
||||
catch ( \ParseError $e )
|
||||
{
|
||||
/* Show the error if we have development mode enabled */
|
||||
if( \IPS\IN_DEV )
|
||||
/* Show the error if we have development mode enabled or the error originated in the cloud app */
|
||||
if( \IPS\IN_DEV or strstr( $data['file'], 'applications/cloud/') )
|
||||
{
|
||||
throw $e;
|
||||
}
|
||||
@@ -915,7 +940,7 @@ class IPS
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$reflection = new \ReflectionClass( "{$namespace}\\_{$finalClass}" );
|
||||
if( eval( "namespace {$namespace}; ". $extraCode . ( $reflection->isAbstract() ? 'abstract' : '' )." class {$finalClass} extends {$realClass} {}" ) === FALSE )
|
||||
{
|
||||
@@ -1294,7 +1319,7 @@ class IPS
|
||||
* @param string $reason Reason
|
||||
* @return void
|
||||
*/
|
||||
public static function resyncIPSCloud( $reason = NULL )
|
||||
final public static function resyncIPSCloud( $reason = NULL )
|
||||
{
|
||||
if ( \IPS\CIC AND \function_exists( 'IPS\Cicloud\resyncIPSCloud' ) )
|
||||
{
|
||||
@@ -1309,7 +1334,7 @@ class IPS
|
||||
* @param int $version If we're upgrading, the current version we are running.
|
||||
* @return void
|
||||
*/
|
||||
public static function applyLatestFilesIPSCloud( ?int $version = NULL )
|
||||
final public static function applyLatestFilesIPSCloud( ?int $version = NULL )
|
||||
{
|
||||
if ( \IPS\CIC AND \function_exists( 'IPS\Cicloud\applyLatestFilesIPSCloud' ) )
|
||||
{
|
||||
@@ -1322,7 +1347,7 @@ class IPS
|
||||
*
|
||||
* @return string|NULL
|
||||
*/
|
||||
public static function getCicUsername(): ?string
|
||||
final public static function getCicUsername(): ?string
|
||||
{
|
||||
if ( \IPS\CIC AND \function_exists( 'IPS\Cicloud\getCicUsername' ) )
|
||||
{
|
||||
@@ -1336,7 +1361,7 @@ class IPS
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function unpackCicConfig()
|
||||
final public static function unpackCicConfig()
|
||||
{
|
||||
/* This method is slightly different because it needs to run before anything else to establish our Cicloud configuration */
|
||||
if ( \function_exists( 'IPS\Cicloud\unpackCicConfig' ) )
|
||||
@@ -1350,7 +1375,7 @@ class IPS
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function compileCicRedisConfig()
|
||||
final public static function compileCicRedisConfig()
|
||||
{
|
||||
if ( \function_exists( 'IPS\Cicloud\compileRedisConfig' ) )
|
||||
{
|
||||
@@ -1365,7 +1390,7 @@ class IPS
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function canManageResources(): bool
|
||||
final public static function canManageResources(): bool
|
||||
{
|
||||
if ( \function_exists( 'IPS\Cicloud\canManageResources' ) )
|
||||
{
|
||||
@@ -1374,6 +1399,36 @@ class IPS
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check third party
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
final public static function checkThirdParty( bool $upgrade=FALSE ): bool
|
||||
{
|
||||
if ( \function_exists( 'IPS\Cicloud\checkThirdParty' ) )
|
||||
{
|
||||
return \IPS\Cicloud\checkThirdParty( $upgrade );
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is Managed
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
final public static function isManaged(): bool
|
||||
{
|
||||
if ( \function_exists( 'IPS\Cicloud\isManaged' ) )
|
||||
{
|
||||
return \IPS\Cicloud\isManaged();
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/* Init */
|
||||
|
||||
Reference in new issue
Block a user