Back to vBulletin 3.6 Add-ons

datastore cache to XCache - boost your vBulletin
Mod Version: 0.8.5, by phpxcache

This modification is in the archives.
vB Version: 3.6.5 Rating: (14 votes - 4.57 average) Installs: 142
Released: 03 Mar 2007 Last Update: 04 Mar 2007 Downloads: 999
Not Supported Code Changes Additional Files  

http://forum.vbulletin-china.cn/showthread.php?p=5635

(note: do not apply this patch on vBulletin 3.7 as it's included already)
This patch allow you to use http://xcache.lighttpd.net as a datastore cache in vBulletin. This is definitely your choice if you have installed and enabled XCache on you server already.

Take care that this is a beta version and was not heavily tested. And i'm not familiar with vBulletin source code as i just started reading it today, but i don't have any difficulty reading it thanks to my years of php skill

Take aware that some vB plugin is not compatible with vB_datastore_*, not just vB_datastore_XCache. So, in case you find vB_datastore_XCache won't work, you'd better try datastore to file or memcache. If one of the others works but not vB_datastore_XCache, do report it to me so i can fix it.

Pre-requirement
  • a working http://www.php.net
  • a working http://www.vbulletin.com
  • a working http://trac.lighttpd.net/xcache/wiki/InstallFromBinary
  • set "xcache.var_size = 10M" or so in php ini

Install the modification
for those of you who can't run "patch", u may patch the file manually
  • download (class_datastore_xcache.php)
  • save the file as vBulletin.3.6/upload/includes/class_datastore_xcache.php
  • open vBulletin.3.6/upload/includes/class_datastore.php in your favor editor
  • add a line in class_datastore.php (see below)
  • update upload/includes/config.php to enable it (see below)

example class_datastore.php after modification:
PHP Code:
        }
        return 
true;
    }
}

// add class_datastore_xcache, enable it in config.php
require_once(DIR '/includes/class_datastore_xcache.php');

/*======================================================================*\
|| ####################################################################
|| # Downloaded: 12:33, Fri Mar 2nd 2007
|| # CVS: $RCSfile$ - $Revision: 15474 $
|| ####################################################################
\*======================================================================*/ 
example config.php after modification:
PHP Code:

    
// vB_Datastore_Filecache  - for using a cache file
// $config['Datastore']['class'] = 'vB_Datastore_Filecache';
$config['Datastore']['class'] = 'vB_Datastore_XCache';
    
// vB_Datastore_Memcached - for using a Memcache server
    // It is also necessary to specify the hostname or IP address and the port the server is listening on 
Trouble Shooting
q. i have multiple vBulletin instance installed, the seems to mix data after install this plugin
a. this applies to apc too because, if you wanna fix it, try
open class_core.php, look for:
$this->prefix =& $this->registry->config['Datastore']['prefix'];
and modify to:
$this->prefix = $this->registry->config['Datastore']['prefix'] . $_SERVER['SERVER_NAME']; // or HTTP_HOST

q. Warning: unserialize() expects parameter 1 to be string, array given in $a.php on line $b
a. upgrade your plugin/hack that $a.php belongs to, e.g. vbjournal/vbgallery etc. OR open $a.php and locate at line $b, remove unserialize call, e.g.:
replace $var = unserialize($this->data);
with $var = $this->data;
be careful do not remove the whole line, just the unseralize( and )

Download

This modification is archived, downloads are still allowed.

File Type: %1$s class_datastore_xcache.php (2.7 KB, 979 downloads)

Supporters / CoAuthors

  • phpxcache

Screenshots

Click image for larger version
Name:	vB-xcache-var-cache.png
Views:	3368
Size:	21.8 KB
ID:	61314  


vblts.ru supports vBulletin®, 2022-2024