Version 4.6.0

This commit is contained in:
Neo committed 2025-12-19 05:55:31 -08:00
1 parent f79dcf067a
commit 517a5e1f70
2036 files changed
+110041 -26162

No files matched your search

+15 -1
View File
@@ -549,6 +549,11 @@ abstract class _ActiveRecord
$this->clearCaches( TRUE );
}
/**
* @brief Cache followers count query to prevent running it multiple times
*/
protected static $followerCountCache = array();
/**
* Get follow data
@@ -592,9 +597,18 @@ abstract class _ActiveRecord
}
else
{
$_key = md5( static::$application . $area . $id );
if( isset( static::$followerCountCache[ $_key ] ) )
{
return static::$followerCountCache[ $_key ];
}
try
{
return (int) \IPS\Db::i()->select( 'count', 'core_follow_count_cache', array('class=? and id=?', 'IPS\\' . static::$application . '\\' . ucfirst( $area ), $id) )->first();
static::$followerCountCache[ $_key ] = (int) \IPS\Db::i()->select( 'count', 'core_follow_count_cache', array('class=? and id=?', 'IPS\\' . static::$application . '\\' . ucfirst( $area ), $id ) )->first();
return static::$followerCountCache[ $_key ];
}
catch ( \UnderflowException $e )
{