Version 4.6.0
This commit is contained in:
1 parent
f79dcf067a
commit
517a5e1f70
2036 files changed
+110041
-26162
No files matched your search
@@ -141,11 +141,12 @@ class _advanced extends \IPS\Dispatcher\Controller
|
||||
$toggles = array();
|
||||
$disabled = array();
|
||||
$storeConfigurationFields = array();
|
||||
$options = array(
|
||||
'FileSystem' => 'datastore_method_FileSystem',
|
||||
'Database' => 'datastore_method_Database',
|
||||
'Redis' => 'datastore_method_Redis',
|
||||
);
|
||||
$options = [];
|
||||
foreach( \IPS\Data\Store::availableMethods() AS $key => $class )
|
||||
{
|
||||
$options[ $key ] = 'datastore_method_' . $key;
|
||||
}
|
||||
|
||||
$existingConfiguration = json_decode( \IPS\STORE_CONFIG, TRUE );
|
||||
foreach ( $options as $k => $v )
|
||||
{
|
||||
@@ -190,17 +191,10 @@ class _advanced extends \IPS\Dispatcher\Controller
|
||||
$toggles = array( 'Redis' => array( 'redis_enabled' ) );
|
||||
$disabled = array();
|
||||
$cacheConfigurationFields = array();
|
||||
$options = array(
|
||||
'None' => 'datastore_method_None',
|
||||
'Apc' => 'datastore_method_Apc',
|
||||
'Memcache' => 'datastore_method_Memcache',
|
||||
'Redis' => 'datastore_method_Redis',
|
||||
'Wincache' => 'datastore_method_Wincache',
|
||||
'Xcache' => 'datastore_method_Xcache',
|
||||
);
|
||||
if ( \IPS\TEST_CACHING )
|
||||
$options = [];
|
||||
foreach( \IPS\Data\Cache::availableMethods() AS $key => $class )
|
||||
{
|
||||
$options['Test'] = 'datastore_method_Test';
|
||||
$options[ $key ] = 'datastore_method_' . $key;
|
||||
}
|
||||
|
||||
$cacheConfig = \IPS\CACHE_CONFIG;
|
||||
@@ -211,20 +205,10 @@ class _advanced extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
|
||||
$existingConfiguration = json_decode( $cacheConfig, TRUE );
|
||||
|
||||
/* Remove deprecated options if they're not in use @todo 4.6 */
|
||||
$deprecatedCacheMethods = array( 'Apc', 'Memcache', 'Wincache', 'Xcache' );
|
||||
foreach( $deprecatedCacheMethods as $cache )
|
||||
{
|
||||
if( $cache !== \IPS\CACHE_METHOD )
|
||||
{
|
||||
unset( $options[ $cache ] );
|
||||
}
|
||||
}
|
||||
|
||||
foreach ( $options as $k => $v )
|
||||
{
|
||||
$class = 'IPS\Data\Cache\\' . $k;
|
||||
$class = \IPS\Data\Cache::availableMethods()[ $k ];
|
||||
if ( !$class::supported() )
|
||||
{
|
||||
$disabled[] = $k;
|
||||
@@ -243,12 +227,6 @@ class _advanced extends \IPS\Dispatcher\Controller
|
||||
$toggles[ $k ][] = $input->htmlId;
|
||||
$cacheConfigurationFields[ $k ][ $inputKey ] = $input->name;
|
||||
}
|
||||
|
||||
/* Deprecated Warnings */
|
||||
if( \in_array( $k, $deprecatedCacheMethods ) )
|
||||
{
|
||||
\IPS\Member::loggedIn()->language()->words["datastore_method_{$k}_desc"] = \IPS\Member::loggedIn()->language()->addToStack( 'datastore_method_deprecated', FALSE, array( 'sprintf' => array( $k ) ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
$form->add( new \IPS\Helpers\Form\Radio( 'cache_method', \IPS\CACHE_METHOD, TRUE, array(
|
||||
@@ -497,6 +475,14 @@ class _advanced extends \IPS\Dispatcher\Controller
|
||||
)
|
||||
) ) );
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'csp_header', \IPS\Settings::i()->csp_header, FALSE, array( 'placeholder' => "default-src *; frame-ancestors 'self' *.example.com" ), NULL, NULL, NULL, 'csp_header' ) );
|
||||
$form->add( new \IPS\Helpers\Form\Radio( 'referrer_policy_header', \IPS\Settings::i()->referrer_policy_header, FALSE, array(
|
||||
'options' => array(
|
||||
'0' => 'referrerpolicy_disabled',
|
||||
'1' => 'referrerpolicy_acp_only',
|
||||
'2' => 'referrerpolicy_enabled',
|
||||
)
|
||||
) ) );
|
||||
|
||||
$form->addHeader('performance_settings');
|
||||
$form->add( new \IPS\Helpers\Form\Interval( 'widget_cache_ttl', ( isset( \IPS\Settings::i()->widget_cache_ttl ) ) ? \IPS\Settings::i()->widget_cache_ttl : 60, FALSE, array( 'valueAs' => \IPS\Helpers\Form\Interval::SECONDS, 'min' => 60 ), NULL, \IPS\Member::loggedIn()->language()->addToStack('for'), NULL ) );
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'lazy_load_enabled', \IPS\Settings::i()->lazy_load_enabled, FALSE ) );
|
||||
@@ -761,11 +747,13 @@ class _advanced extends \IPS\Dispatcher\Controller
|
||||
$output = \IPS\Member::loggedIn()->language()->addToStack( $output, FALSE );
|
||||
}
|
||||
|
||||
\IPS\Output::i()->bypassCsrfKeyCheck = true;
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'advancedsettings' )->taskResult( TRUE, $output, $task->id );
|
||||
}
|
||||
}
|
||||
catch ( \IPS\Task\Exception $e )
|
||||
{
|
||||
\IPS\Output::i()->bypassCsrfKeyCheck = true;
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'advancedsettings' )->taskResult( FALSE, \IPS\Member::loggedIn()->language()->addToStack( $e->getMessage(), FALSE ), $task->id );
|
||||
}
|
||||
catch ( \RuntimeException $e )
|
||||
|
||||
Reference in new issue
Block a user