[TYPO3-core] RFC #11076: [side-effect:] activating MemCache

Xavier Perseguers typo3 at perseguers.ch
Tue May 19 16:38:23 CEST 2009


Hi,

Reading the ADOdb documentation, I just realized that in fact this patch 
has a very interesting side-effect:

---------------------
+
+Usage:
+
+$db = NewADOConnection($driver);
+$db->memCache = true; /// should we use memCache instead of caching in 
files
+$db->memCacheHost = array($ip1, $ip2, $ip3);
+$db->memCachePort = 11211; /// this is default memCache port
+$db->memCacheCompress = false; /// Use 'true' to store the item 
compressed (uses zlib)
+
+$db->Connect(...);
+$db->CacheExecute($sql);

+  Note the memcache class is shared by all connections, is created 
during the first call to Connect/PConnect.
---------------------

Meaning that this patch allows MemCache to be used like this:

$TYPO3_CONF_VARS['EXTCONF']['dbal']['handlerCfg'] = array(
     '_DEFAULT' => array(
         'type' => 'adodb',
         'config' => array(
             'driver' => 'mysql',
             'driverOptions' => array(
                 'memCache' => true,
                 'memCacheHost' => array($ip1, $ip2, $ip3),
                 'memCachePort' => 11211,
                 'memCacheCompress' => false,
             ),
         ),
     ),
);

I did not test though. If someone is interested, this might be another 
way (ie w/o Oracle) of giving a +1 to this patch ;-)

Cheers
Xavier

Xavier Perseguers wrote:
> Hi,
> 
> This is a SVN patch request.
> 
> Type: Bugfix
> 
> Branches: trunk
> 
> BT reference:
> http://bugs.typo3.org/view.php?id=11076
> 
> Problem:
> According to DBAL documentation, when connecting to Oracle, $typo_db may 
> contain either a ServiceName or a SID.
> 
> But trying to connect using a SID does not work.
> 
> According to ADOdb documentation, connection is supported as this:
> 
> Server + service name:
> $conn->Connect($serveraddress,'scott','tiger',$service_name);
> 
> Server + SID:
> $conn->connectSID = true;
> $conn->Connect($serveraddress,'scott','tiger',$SID);
> 
> Problem is that DBAL does not provide any method to set the 
> driver-specific option "connectSID".
> 
> Solution:
> Supplied patch allows any driver-specific option to be specified in 
> localconf.php. This setting for instance can easily be set with this 
> configuration:
> 
> $TYPO3_CONF_VARS['EXTCONF']['dbal']['handlerCfg'] = array(
>     '_DEFAULT' => array(
>         'type' => 'adodb',
>         'config' => array(
>             'driver' => 'oci8',
>             'driverOptions' => array(
>                 'connectSID' => true,
>             ),
>         ),
>     ),
> );
> 
> Note:
> This patch was co-written by Karsten during T3DD09.
> 


-- 
Xavier Perseguers
DBAL-Member

http://xavier.perseguers.ch/en/tutorials/typo3.html


More information about the TYPO3-team-core mailing list