Version 4.1.2

This commit is contained in:
Neo committed 2025-12-19 05:32:19 -08:00
1 parent 3ba79295ee
commit 28bd025b35
1131 files changed
+63658 -20579

No files matched your search

+15 -6
View File
@@ -55,16 +55,25 @@ class _Database extends \IPS\Data\Store
* @return void
*/
public function __construct()
{
if ( \IPS\Session\Front::loggedIn() )
{
/* When caching is enabled, we only need cacheKeys, the rest will come from the cache */
if ( \IPS\CACHE_METHOD !== 'None' )
{
$this->initLoad[] = 'administrators';
$this->initLoad[] = 'moderators';
$this->initLoad[] = 'emoticons';
$this->initLoad = array( 'cacheKeys' );
}
/* Otherwise, we also need a few more things depending on whether the user is logged in or not */
else
{
$this->initLoad[] = 'loginHandlers';
if ( \IPS\Session\Front::loggedIn() )
{
$this->initLoad[] = 'administrators';
$this->initLoad[] = 'moderators';
$this->initLoad[] = 'emoticons';
}
else
{
$this->initLoad[] = 'loginHandlers';
}
}
}
+9 -1
View File
@@ -95,7 +95,7 @@ class _FileSystem extends \IPS\Data\Store
{
/* It is remotely possible that the file was removed in between an exists check and a get call on a busy site,
so we need to make sure the file still exists in order to prevent a php warning */
clearstatcache( FALSE, $this->_path . '/' . $key . '.' . \IPS\SUITE_UNIQUE_KEY . '.php' );
clearstatcache();
if ( file_exists( $this->_path . '/' . $key . '.' . \IPS\SUITE_UNIQUE_KEY . '.php' ) )
{
@@ -126,6 +126,14 @@ CONTENTS;
$result = (bool) @\file_put_contents( $this->_path . '/' . $key . '.' . \IPS\SUITE_UNIQUE_KEY . '.php', $contents, LOCK_EX );
/* Sometimes LOCK_EX is unavailable and throws file_put_contents(): Exclusive locks are not supported for this stream.
While we would prefer an exclusive lock, it would be better to write the file if possible. */
if( !$result )
{
@unlink( $this->_path . '/' . $key . '.' . \IPS\SUITE_UNIQUE_KEY . '.php' );
$result = (bool) @\file_put_contents( $this->_path . '/' . $key . '.' . \IPS\SUITE_UNIQUE_KEY . '.php', $contents );
}
@chmod( $this->_path . '/' . $key . '.' . \IPS\SUITE_UNIQUE_KEY . '.php', \IPS\IPS_FILE_PERMISSION );
static::$cache[ $key ] = $value;