[RC2] phpBB2 Native SQL Caching (1.1.0)

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
tunafish
Registered User
Posts: 152
Joined: Sat Jul 23, 2005 1:29 pm

Post by tunafish » Wed Sep 13, 2006 8:05 am

The other one does not support DBAL.
phpBB Problems? PM ME :)

EzerchE
Registered User
Posts: 102
Joined: Fri Apr 08, 2005 11:22 pm

Post by EzerchE » Fri Sep 15, 2006 8:45 pm

tunafish wrote: The other one does not support DBAL.


whats dbal? :roll:

User avatar
bonelifer
Community Team Member
Community Team Member
Posts: 3480
Joined: Wed Oct 27, 2004 11:35 pm
Name: William
Contact:

Post by bonelifer » Fri Sep 15, 2006 8:51 pm

DBAL= DataBase Abstraction Layer
Knowledge Base | phpBB Board Rules | Search Customisation Database
Image
Please don't contact me via PM or email for phpBB support .

Mr. Spoonman
Registered User
Posts: 15
Joined: Thu Jul 08, 2004 5:57 am

Post by Mr. Spoonman » Thu Nov 16, 2006 8:40 am

Hey there - great mod, but I have two questions...

After installing the mod I get the following error messages when I try to login to my ACP:

Code: Select all

Warning: current() [function.current]: Passed variable is not an array or object in /V2/db/sql_cache.php on line 74

Warning: next() [function.next]: Passed variable is not an array or object in /V2/db/sql_cache.php on line 75
After that I wrote a quick workaround to exclude the admin/index.php from the sql_cache.php-file. Now I can logon to my ACP but if I click on any of my links there, the same error messages come up...okay, I could write this workaround for every file I have in my admin-folder, but I think If the bug lies within this mod maybe you could find it for me? :)

Second thing...I tried two "Page Generation Time"-Mods. Before I installed this mod I got about 60 SQL-Queries shown there - after the Install there are 130-200 SQL-Queries although the board "feels" faster...that is with every version (Smartors PGT, Extended Admin Information) I tried...

Can you help, please?

PHPBB: 2.0.21
MYSQL: V4
PHP: V4
Native SQL Caching: 1.1.0 (w. Configuration Table SQL Caching)
Other Mods: Hundreds (The big ones: Extreme Styles Mod, Attachment Mod, UPI2DB, CrackerTracker 5.0.3, Activity Mod+)

dcz
Registered User
Posts: 787
Joined: Sun Feb 13, 2005 5:37 am
Contact:

Post by dcz » Fri Nov 17, 2006 10:37 pm

Interesting, could you elaborate a bit about the conditions we could set to update cache (ACP visit, specific action time ...).

What's handy with phpBB styles one is that you can create as many type of cache, with different refresh conditions. This is just very handy to add support for module like KB and clear it's cache independently from phpBB's.

Anyway, great job ;)

++

phpBB SEO || phpBB3 SEO Premod || SEO phpBB3
GYM Sitemaps & RSS for phpBB3: GYM Sitemaps & RSS

genial.soul
Registered User
Posts: 25
Joined: Fri Apr 13, 2007 12:03 pm
Contact:

Re: [RC2] phpBB2 Native SQL Caching (1.1.0)

Post by genial.soul » Tue Aug 07, 2007 10:56 am

Hi
i installed this mod
mod works fine but if i use its addon for config table i get the following error when i try to login to ACP

Code: Select all

Warning: current() [function.current]: Passed variable is not an array or object in /db/sql_cache.php on line 74

Warning: next() [function.next]: Passed variable is not an array or object in /db/sql_cache.php on line 75
I have Extreme Mod Installed
Any help or suggestions ?

EfSaNe
Registered User
Posts: 23
Joined: Thu Jul 14, 2005 9:55 pm
Contact:

Re: [RC2] phpBB2 Native SQL Caching (1.1.0)

Post by EfSaNe » Fri Aug 10, 2007 10:56 pm

When i wasn't changing db.php file, it is running right but when i was a changing, the forum is not running.i have Xs mod installed. What is the problem ?
Love Love Love aşk Love PhpBB

vitjok
Registered User
Posts: 2
Joined: Thu Jan 31, 2008 12:37 am

Re: [RC2] phpBB2 Native SQL Caching (1.1.0)

Post by vitjok » Thu Jan 31, 2008 12:55 am

Hi everyone!
It seems that I found the source of this problem:

Code: Select all

Warning: current() [function.current]: Passed variable is not an array or object in /db/sql_cache.php on line 74

Warning: next() [function.next]: Passed variable is not an array or object in /db/sql_cache.php on line 75
If mod is caching some data, and there is a backslash in this data, you are going to get this error.
This is because "some\ text" tuns into "some\\ text" when sql_gen_php() is done, then it turns into
$cache_data = 'some\\ text' in a cache file.
Then when file is included, the data in variable $cache_data is "some\ text", and finally after stripslashes() it is "some text", which is different from the original data. This leads to unserialize() to fail, and then current() and next() don't get an array.

The fix:
change file includes/class_cache.php, function sql_gen_php:

Code: Select all

addslashes ( serialize ( $cache_data )
replace with
addcslashes( addslashes ( serialize ( $cache_data ) ), '\\' )
I may be missing something, a review of this fix would be great.

My comment:
Including the cache file is bad here.
Saving a serialized data in a file, and then getting this data with file_get_contents() and unserializing it back would be better.
Timestamp can be on the first line, and the second line is our cached data.

vitjok
Registered User
Posts: 2
Joined: Thu Jan 31, 2008 12:37 am

Re: [RC2] phpBB2 Native SQL Caching (1.1.0)

Post by vitjok » Fri Feb 01, 2008 8:39 am

Hi again everyone, I found my own bug in a fix: there can be ' symbols in serialized string, so it should be also escaped. So:

Code: Select all

addslashes ( serialize ( $cache_data )
replace with
addcslashes( addslashes ( serialize ( $cache_data ) ), '\\\'' )
There is no need to escape " symbol as string is stored between two '. Even worse - it breaks everything.

Post Reply

Return to “[2.0.x] MODs in Development”