Changeset 70164 in spip-zone


Ignore:
Timestamp:
Feb 24, 2013, 7:36:49 PM (7 years ago)
Author:
cedric@…
Message:

Attention : $_SERVERHTTP_HOST? est fournie par l'envoyeur et n'est pas fiable.
http://localhost:8888/ affichee dans le navigateur fournit 'localhost:8888'
mais
curl "http://localhost:8888/" fournit 'localhost' et perd la memoization (perte de cache sur le cron asynchrones par exemple)

On prefere utiliser SERVER_NAME et SERVER_PORT fournies par le serveur.

Location:
_plugins_/memoization
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • _plugins_/memoization/inc/memoization.php

    r59626 r70164  
    111111}
    112112if (!defined('_CACHE_NAMESPACE'))
    113         define('_CACHE_NAMESPACE', $_SERVER['HTTP_HOST'].':'.$GLOBALS['meta']['cache_namespace'].':');
     113        define('_CACHE_NAMESPACE', $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].':'.$GLOBALS['meta']['cache_namespace'].':');
    114114
    115115global $Memoization;
  • _plugins_/memoization/memo/apc.inc

    r59626 r70164  
    11<?php
    22if (!defined('_CACHE_NAMESPACE'))
    3         define('_CACHE_NAMESPACE', $_SERVER['HTTP_HOST'].':');
     3        define('_CACHE_NAMESPACE', $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].":");
    44
    55class MCacheBackend_apc extends MCacheBackend {
  • _plugins_/memoization/memo/eaccelerator.inc

    r59626 r70164  
    44
    55if (!defined('_CACHE_NAMESPACE'))
    6         define('_CACHE_NAMESPACE', $_SERVER['HTTP_HOST'].':');
     6        define('_CACHE_NAMESPACE', $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].":");
    77
    88class MCacheBackend_eaccelerator extends MCacheBackend {
  • _plugins_/memoization/memo/memcache.inc

    r59626 r70164  
    44
    55if (!defined('_CACHE_NAMESPACE'))
    6         define('_CACHE_NAMESPACE', $_SERVER['HTTP_HOST'].':');
     6        define('_CACHE_NAMESPACE', $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].":");
    77if (!defined('_LOCK_MAX'))
    88        define('_LOCK_MAX', 30); # max lock time (seconds)
  • _plugins_/memoization/memo/xcache.inc

    r59626 r70164  
    33# http://xcache.lighttpd.net/wiki/XcacheApi
    44if (!defined('_CACHE_NAMESPACE'))
    5         define('_CACHE_NAMESPACE', $_SERVER['HTTP_HOST'].':');
     5        define('_CACHE_NAMESPACE', $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].":");
    66if (!defined('_LOCK_MAX'))
    77        define('_LOCK_MAX', 30); # max lock time (seconds)
  • _plugins_/memoization/plugin.xml

    r68083 r70164  
    99        <auteur>Fil</auteur>
    1010        <licence>&#169; 2009-2011 - GNU/LGPL - MIT</licence>
    11         <version>1.2.3</version>
     11        <version>1.3.0</version>
    1212        <etat>stable</etat>
    1313        <description>
Note: See TracChangeset for help on using the changeset viewer.