Dear screenreader-user, please let me know, if I can make any improvements for your convinience. Mail me to "n" dot "company" at "mac" dot "com". Thank you.
Skip to the navigation. / Zur Navigation springen. Newer Entries / Neuere Einträge Older Entries / Ältere Einträge Skip to the search. / Zur Suche springen. Skip to the content. / Zum Inhalt springen. Skip to the bottom. / Zum Ende springen.
Fullscreen-Modus einschalten um die Artikel besser lesen zu können.
For my latest project, we used Extbase and Fluid with Typo3 4.5. My development environment is a MacBook Pro running OSX Lion with MAMP Pro 2.0. Newer versions of Typo3 come with a caching framework that allows you to define different caching methods for different tasks and even lets you integrate your own caching mechanisms into your extensions. The caching framework makes use of several caching backend – DB, File, RAM-Memory, APC etc.
For my installation I wanted to use the apache memcache extension.
Do enable the framework you need to set some values in the localconf-file. Take care – some values will change in Typo3 4.6. – especially there are more defaults so you don’t have to set all of this. The code below is for Typo3 4.5.X to be put into typo3conf/localconf.php:
// cachingframework-Memcached - START
$TYPO3_CONF_VARS['SYS']['useCachingFramework'] = '1';
$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['cache_hash'] = array (
'frontend' => 't3lib_cache_frontend_VariableFrontend',
'backend' => 't3lib_cache_backend_FileBackend',
'options' => array(
)
);
if($_SERVER['T3_USEMEMCACHE']){
$mserver = $_SERVER['T3_MCACHESERVER'] ? $_SERVER['T3_MCACHESERVER'] : 'localhost:11211';
$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['cache_pages'] = array (
'frontend' => 't3lib_cache_frontend_VariableFrontend',
'backend' => 't3lib_cache_backend_MemcachedBackend',
'options' => array(
'servers' => array($mserver),
)
);
$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['cache_pagesection'] = array (
'frontend' => 't3lib_cache_frontend_VariableFrontend',
'backend' => 't3lib_cache_backend_MemcachedBackend',
'options' => array(
'servers' => array($mserver),
)
);
}
// cachingframework-Memcached - END
Take a look at line 9 – I use such settings to make configurations on server / environment level – you can then set this variables in the a .htaccess file or – as I use to do it – in the vHost config:
# Use memcache extension for caching SetEnv T3_USEMEMCACHE 1
If you have inserted the code into your localconf.php file and hit the refresh-button, you’ll get this;
Now, MAMP Pro comes with the memcache extensions enabled – unfortunately it doesn’t work. (it’s 32Bit, not 64Bit…)
After digging around a bit I finally could make it run. This article of Leon Barrett was the key to success. I am using MAMP Pro Version 2.0 so a few paths are different. That’s why I decided to create this article so you don’t have to make the same mistakes as I did…
Install XcodeFirst, you need to download the free Xcode from the App-Store. What you download is only the installer – install it after download! After installing Xcode, you are ready to compile memcache for MAMP. Most parts of the following steps are taken from Leon’s Website.
sudo chmod +xrw /Applications/MAMP/bin/php/php*
cd ~/Downloads/
curl http://pecl.php.net/get/memcache-2.2.5.tgz > memcache-2.2.5.tgz
tar -zxvf memcache-2.2.5.tgz
cd memcache-2.2.5
/Applications/MAMP/bin/php/php5.3.6/bin/phpize
CFLAGS=’-O3 -fno-common -arch i386 -arch x86_64 -g -Os’ LDFLAGS=’-O3 -arch i386 -arch x86_64′ CXXFLAGS=’-O3 -fno-common -arch i386 -arch x86_64 -g -Os’ ./configure –disable-dependancy-tracking –disable-shared -enable-static
make
sudo cp modules/memcache.so /Applications/MAMP/bin/php/php5.3.6/lib/php/extensions/no-debug-non-zts-20090626/.
To do this open the MAMP application, go to File > Edit Template > PHP > PHP 5.3.6 php.ini
Search for “; Extensions” and add the following line:
extension=memcache.so
Somewhere in this file, you need to configure Memcache. I used the configuration proposed by Dmitry Dulepov which works just fine for me:
memcached.allow_failover 1
memcached.chunk_size 32768
memcached.default_port 11211
memcached.hash_function fnv
memcached.hash_strategy consistent
memcached.max_failover_attempts 20
Save the file, stop MAMP and start it back up. Take a look inside your php log to see if there were any errors starting up.
memcached -d -m 8 -M -p 11211
You can stop memcached with “killall memcached”
Hit the refresh-button on your website again – it shines in memcached glory!
Now, memcache needs to be started manually each time you start MAMP. The should be ways to automate this – but I couldn’t make it work…
About a year ago, I created a jQuery Plugin to add tab-functionality to your page. The special thing about the plugin is, that is uses an event based approach. xaseTabs: xtensible and simple evented tabs. This enables you to extend the functionality of the plugin without altering the plugin-code. I have now published xasetabs.noelboss.ch where the options are documented and where you find extensions for the plugin.
