The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
trouble accessing datastore
Recently I moved my site to new servers. I have the latest versino of vb 3.6.
In the process, I also upgraded from PHP4 to PHP5, and also upgraded to MySQL 5.0.x. In general, things are going well. However, I cannot access the datastore like I used to. I would set something like this: build_datastore('mystuff', $parsing_cache, 1); I would then access it like this: $myvariable = $vbulletin->datastore->registry->mystuff; However, $vbulletin->datastore->registry->mystuff is empty (and I checked with empty() ). I look inside my db. mystuff is in the datastore table. The info looks correct. What can I look for or tweak to access mystuff? |
#2
|
|||
|
|||
First your need to fetch it from the database, you can do this by creating a new Plugin with Hook Location init_startup.
Then for the PHP code you have: PHP Code:
An alternative method is just to fetch the item when you need it, using this piece of PHP: PHP Code:
I prefer the first method as it means that if I'm fetching more then one thing from the datastore, they are all fetched in a single query as opposed to single queries dotted around the place. |
#3
|
|||
|
|||
Hi Opserty, thanks for the response.
Unfortunately, I still can't access what I'm trying to get (with either method). Somehow it's blank. It's very puzzling. I can see the build_datastore is working, as it's in the db. I'm just not sure why I can't pull it from there. |
#4
|
|||
|
|||
Try running this in a plugin like global_start or forumhome_start:
PHP Code:
|
#5
|
|||
|
|||
Interesting results:
NULL -------------------------------------------------array(3) { ["title"]=> string(15) "mystuff" ["data"]=> string(192718) Then it continues with a good amount of data. |
#6
|
|||
|
|||
Hmm so it is fetching it then, you can remove the code I posted in my previous post. The only place I'm guessing the error could lie is when the data is unserialize()'d. Maybe the data has been somehow changed? Not sure how or why.
$parsing_cache has been serialize()'d hasn't it? Try this: PHP Code:
|
#7
|
|||
|
|||
Ha, that's exactly what I did at first.
It was "BOO!" (I did nuffin/sumpin) It's just odd that I can't access it. Is there any way I can clear all caches safely? --------------- Added [DATE]1201643105[/DATE] at [TIME]1201643105[/TIME] --------------- I tried renaming mystuff to somethingstuff and it had no effect (just seeing if I could clear some cache that way). |
#8
|
|||
|
|||
An update to my situation:
PHP Code:
PHP Code:
PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|