-
Notifications
You must be signed in to change notification settings - Fork 76
/
Copy pathsession-cache-expire.xml
149 lines (135 loc) · 5.19 KB
/
session-cache-expire.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 151e61773c016edcae8fd4989ad9a86ffd03c283 Maintainer: lex Status: ready -->
<!-- Reviewed: no -->
<refentry xml:id="function.session-cache-expire" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>session_cache_expire</refname>
<refpurpose>Получает и (или) устанавливает срок действия текущего кеша</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type class="union"><type>int</type><type>false</type></type><methodname>session_cache_expire</methodname>
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>value</parameter><initializer>&null;</initializer></methodparam>
</methodsynopsis>
<para>
Функция <function>session_cache_expire</function> возвращает текущее значение директивы
<literal>session.cache_expire</literal>.
</para>
<para>
Срок действия кеша сбрасывается до значения по умолчанию — 180, которое во время
запуска запроса хранит директива
<link linkend="ini.session.cache-expire">session.cache_expire</link>.
Поэтому функцию <function>session_cache_expire</function> требуется вызывать
для каждого запроса, и до вызова функции <function>session_start</function>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>value</parameter></term>
<listitem>
<para>
Текущий срок действия кеша заменяется значением <parameter>value</parameter>,
если в параметр <parameter>value</parameter> передали значение, которое не равно &null;.
</para>
<para>
<note>
<simpara>
Установка параметра <parameter>value</parameter> изменит срок действия кеша, только если
для директивы <literal>session.cache_limiter</literal> установили значение,
которое <emphasis>отличается</emphasis> от <literal>nocache</literal>.
</simpara>
</note>
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Функция возвращает текущую настройку директивы <literal>session.cache_expire</literal>.
Значение возврата считывается в минутах, и по умолчанию равно 180.
Функция возвращает &false;, если при изменении значения возникла ошибка.
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>8.0.0</entry>
<entry>
Параметр <parameter>value</parameter> теперь принимает значение &null;.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Пример использования функции <function>session_cache_expire</function></title>
<programlisting role="php">
<![CDATA[
<?php
/* Устанавливаем для ограничителя кеша значение 'private' */
session_cache_limiter('private');
$cache_limiter = session_cache_limiter();
/* Устанавливаем время истечения срока жизни кеша на 30 минут */
session_cache_expire(30);
$cache_expire = session_cache_expire();
/* Начинаем сессию */
session_start();
echo "Значение ограничителя кеша теперь равно $cache_limiter<br />";
echo "Срок действия страниц, которые добавили в кеш в течение сессии, истекает через $cache_expire минут";
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><link linkend="ini.session.cache-expire">session.cache_expire</link></member>
<member><link linkend="ini.session.cache-limiter">session.cache_limiter</link></member>
<member><function>session_cache_limiter</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->