📄 03-ct_shm.sgml
字号:
<!-- $Id: 03-ct_shm.sgml,v 1.1.1.1 2000/04/17 16:40:01 kk Exp $ --><sect1>CT_Shm<p>The <tt/Session/ class used to contain a bit of SQL to read andwrite session data from and to a database. To make sessionsdatabase independent, <tt/Session/ now makes all storageaccesses through a container class. To let <tt/Session/ use sharedmemory as container, you use <tt/CT_Shm/.<sect2>Instance variables<p><table><tabular ca="">max_sessions<colsep>The maximum number of concurrent sessions supported by this container.<rowsep>shm_key<colsep>The unique (important!) key of the shared memory segment you want to use.<rowsep>shm_size<colsep>The size of the shared memory segment. The size is set, when the segment is accessed for the first time. If you do not use too many session variables, the formula shm_size = max_sessions * 600 should be sufficient.<rowsep></tabular><caption>Accessible instance variables.</caption></table><sect2>Example<p>Use a subclass to provide the appropriate parameters to your container. Usually your subclass looks like this: <tscreen><code>class My_Shm extends CT_Shm { var $classname = "My_Shm"; var $max_sessions = 500; var $shm_key = 0x1234232; var $shm_size = 64000;}</code></tscreen>You can then use My_Shm in class Session. Reference itby putting "My_Shm" in the "that_class" variable.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -