Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 49... Línea 49...
49
     */
49
     */
50
    protected $ageKey = [
50
    protected $ageKey = [
51
        'max-age',
51
        'max-age',
52
    ];
52
    ];
Línea 53... Línea 53...
53
 
53
 
54
    public function __construct(CacheStorageInterface $cache = null)
54
    public function __construct(?CacheStorageInterface $cache = null)
55
    {
55
    {
56
        $this->storage = $cache !== null ? $cache : new VolatileRuntimeStorage();
56
        $this->storage = $cache !== null ? $cache : new VolatileRuntimeStorage();
Línea 57... Línea 57...
57
    }
57
    }
Línea 118... Línea 118...
118
     * @param RequestInterface   $request
118
     * @param RequestInterface   $request
119
     * @param null|KeyValueHttpHeader $varyHeaders The vary headers which should be honoured by the cache (optional)
119
     * @param null|KeyValueHttpHeader $varyHeaders The vary headers which should be honoured by the cache (optional)
120
     *
120
     *
121
     * @return string
121
     * @return string
122
     */
122
     */
123
    protected function getCacheKey(RequestInterface $request, KeyValueHttpHeader $varyHeaders = null)
123
    protected function getCacheKey(RequestInterface $request, ?KeyValueHttpHeader $varyHeaders = null)
124
    {
124
    {
125
        if (!$varyHeaders) {
125
        if (!$varyHeaders) {
126
            return hash('sha256', $request->getMethod().$request->getUri());
126
            return hash('sha256', $request->getMethod().$request->getUri());
127
        }
127
        }