Browse Source

Update Cake to use Redis instead of APC # Please enter the commit message for your changes. Lines starting

Greg Hellings 10 years ago
parent
commit
ef391492fe

+ 3 - 1
config/php.ini

@@ -865,7 +865,9 @@ default_socket_timeout = 60
 ; extension folders as well as the separate PECL DLL download (PHP 5).
 ; Be sure to appropriately set the extension_dir directive.
 ;
-extension=apc.so
+;extension=apc.so
+zend_extension=opcache.so
+extension=redis.so
 extension=phalcon.so
 extension=yaf.so
 ;extension=php_bz2.dll

+ 3 - 1
frameworks/PHP/cakephp/app/Config/core.php

@@ -248,7 +248,7 @@ Configure::write('App.baseUrl', env('SCRIPT_NAME'));
  *       Please check the comments in boostrap.php for more info on the cache engines available
  *       and their setttings.
  */
-$engine = 'Apc';
+$engine = 'Redis';
 
 // In development mode, caches should expire quickly.
 $duration = '+999 days';
@@ -265,6 +265,7 @@ $prefix = 'myapp_';
  */
 Cache::config('_cake_core_', array(
 	'engine' => $engine,
+	'server' => 'REDISSERVER',
 	'prefix' => $prefix . 'cake_core_',
 	'path' => CACHE . 'persistent' . DS,
 	'serialize' => ($engine === 'File'),
@@ -277,6 +278,7 @@ Cache::config('_cake_core_', array(
  */
 Cache::config('_cake_model_', array(
 	'engine' => $engine,
+	'server' => 'REDISSERVER',
 	'prefix' => $prefix . 'cake_model_',
 	'path' => CACHE . 'models' . DS,
 	'serialize' => ($engine === 'File'),

+ 2 - 1
frameworks/PHP/cakephp/setup.py

@@ -8,13 +8,14 @@ from os.path import expanduser
 def start(args, logfile, errfile):
   fwroot = args.fwroot
   setup_util.replace_text("cakephp/app/Config/database.php", "'host' => '.*',", "'host' => '" + args.database_host + "',")
+  setup_util.replace_text("cakephp/app/Config/core.php", "'REDISSERVER'", "'" + args.database_host + "'")
   setup_util.replace_text("cakephp/deploy/cake", "\".*\/FrameworkBenchmarks/cakephp", "\"%s" % args.troot)
   setup_util.replace_text("cakephp/deploy/cake", "Directory .*\/FrameworkBenchmarks/cakephp", "Directory %s" % args.troot)
   setup_util.replace_text("cakephp/deploy/nginx.conf", "root .*\/FrameworkBenchmarks/cakephp", "root %s" % args.troot)
 
   try:
     if os.name == 'nt':
-      setup_util.replace_text("cakephp/app/Config/core.php", "'Apc'", "'Wincache'")
+      setup_util.replace_text("cakephp/app/Config/core.php", "'Redis'", "'Wincache'")
       subprocess.check_call('icacls "C:\\FrameworkBenchmarks\\cakephp" /grant "IIS_IUSRS:(OI)(CI)F"', shell=True, stderr=errfile, stdout=logfile)
       subprocess.check_call('appcmd add site /name:PHP /bindings:http/*:8080: /physicalPath:"C:\\FrameworkBenchmarks\\cakephp\\app\\webroot"', shell=True, stderr=errfile, stdout=logfile)
       return 0

+ 1 - 0
toolset/setup/linux/languages/php.sh

@@ -37,6 +37,7 @@ echo PHP compilation finished, building modules
 # Apc.so
 $IROOT/php-5.5.17/bin/pecl config-set php_ini $IROOT/php-5.5.17/lib/php.ini
 #printf "\n" | $IROOT/php-5.5.17/bin/pecl install -f apc-beta
+printf "\n" | $IROOT/php-5.5.17/bin/pecl install -f redis
 
 # yaf.so
 printf "\n" | $IROOT/php-5.5.17/bin/pecl install -f yaf