Skip to content

Commit bec60f8

Browse files
authored
Merge pull request #161 from Planetbiru/feature/version-3.19.0
Rename max_life_time to max_lifetime
2 parents 41403ac + 7671e83 commit bec60f8

9 files changed

Lines changed: 39 additions & 39 deletions

File tree

docs/doc.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26897,7 +26897,7 @@ <h3>Return</h3>
2689726897
<h3>Declaration</h3>
2689826898
<div class="method-declaratiopn"><span class="access-level">public</span> <span class="access-level">static</span> <span class="php-keyword">function</span> <span class="method-name">getInstance</span>(<br>
2689926899
&nbsp;&nbsp;&nbsp;&nbsp;<span class="parameter-type">string</span>|<span class="parameter-type">null</span> <span class="parameter-name">$name <span class="parameter-equal-sign">=</span> <span class="parameter-default">null</span></span>, <br>
26900-
&nbsp;&nbsp;&nbsp;&nbsp;<span class="parameter-type">int</span> <span class="parameter-name">$maxLifeTime <span class="parameter-equal-sign">=</span> <span class="parameter-default">0</span></span><br>
26900+
&nbsp;&nbsp;&nbsp;&nbsp;<span class="parameter-type">int</span> <span class="parameter-name">$maxLifetime <span class="parameter-equal-sign">=</span> <span class="parameter-default">0</span></span><br>
2690126901
) : <span class="return-type">self</span><br>{<br>}</div>
2690226902
<div class='docblock'>
2690326903
<h3>Description</h3>
@@ -26907,7 +26907,7 @@ <h3>Description</h3>
2690726907
<h3>Parameters</h3>
2690826908
<div class="parameter-name">$name</div>
2690926909
<div class="parameter-description"><p>Session name.</p></div>
26910-
<div class="parameter-name">$maxLifeTime</div>
26910+
<div class="parameter-name">$maxLifetime</div>
2691126911
<div class="parameter-description"><p>Maximum lifetime of the session.</p></div>
2691226912
<h3>Return</h3>
2691326913
<div class="return-type">self</div>

manual/includes/_environment-variable.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ database:
9494
salt: ${APP_DATABASE_SALT}
9595
session:
9696
name: MUSICPRODUCTIONMANAGER
97-
max_life_time: 86400
97+
max_lifetime: 86400
9898
vocal_guide_instrument: piano
9999
```
100100

manual/includes/_secret-object.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ database:
468468
salt: Asia/Jakarta
469469
session:
470470
name: MUSICPRODUCTIONMANAGER
471-
max_life_time: 86400
471+
max_lifetime: 86400
472472
save_handler: files
473473
save_path: /tmp/session
474474
vocal_guide_instrument: piano
@@ -495,7 +495,7 @@ database:
495495
salt: hdsBgcmvq/rzfNUuhgQiBop4Hp4wqd5w03Il9zaOshK0LgGtaEK1WTcPx5OdL+9VvhmZvs7g/jDGYjYoHwXjIg==
496496
session:
497497
name: 4u5xAE2K74pUxZyIVsphoYUka3vpnzUx7op6CnELtdWNEepz/jQLaKynItFt5dx6bv7wjBUFL1AaZaA4ypw/CP6xtR5WFQy+RV6V8VqYM8o=
498-
max_life_time: cspEenRp8+kwUY1RNvmEdWcLqmsRZ+UJZVjY4JwRsuIIfkr+J0w1SYCuRMzMtHG4/hZ5tlXhtGdRZyM7quCbZg==
498+
max_lifetime: cspEenRp8+kwUY1RNvmEdWcLqmsRZ+UJZVjY4JwRsuIIfkr+J0w1SYCuRMzMtHG4/hZ5tlXhtGdRZyM7quCbZg==
499499
save_handler: LIlCCaWHVqg9R4G6ghxDZnuenMLgSI6HjiW+tVGNDa7UyIA7FkFtOgOJtvT/EolUc+kkJSXiMo+76QhvFFq8Dg==
500500
save_path: CZijzyucTzrj3tZ1M9PbQ6Hky1+4Gz3RnXwZNSe9/SL+9QZdpK4PoW2TSLsuQ+cKBgKgkncd7JXWgA3CFg0f1A==
501501
result_per_page: 20

manual/includes/_session.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Session variables keep information about one single user, and are available to a
99
```yaml
1010
session:
1111
name: ${SESSION_NAME}
12-
max_life_time: ${SESSION_MAX_LIFE_TIME}
12+
max_lifetime: ${SESSION_MAX_LIFE_TIME}
1313
save_handler: ${SESSION_SAVE_HANDLER}
1414
save_path: ${SESSION_SAVE_PATH}
1515
cookie_lifetime: ${SESSION_COOKIE_LIFETIME}
@@ -23,7 +23,7 @@ session:
2323
2424
- **name**: Specifies the name of the session. The value `${SESSION_NAME}` refers to an environment variable or a parameter that should be defined elsewhere in the application or server environment. It determines the session's name identifier.
2525

26-
- **max_life_time**: Defines the maximum lifetime of the session in seconds. The value `${SESSION_MAX_LIFE_TIME}` is expected to come from an environment variable or configuration setting, controlling how long the session will last before it expires.
26+
- **max_lifetime**: Defines the maximum lifetime of the session in seconds. The value `${SESSION_MAX_LIFE_TIME}` is expected to come from an environment variable or configuration setting, controlling how long the session will last before it expires.
2727

2828
- **save_handler**: Specifies the handler used to save session data. In this case, `${SESSION_SAVE_HANDLER}` likely refers to the session handler, such as `redis`, `files`, or `database`, depending on the server configuration.
2929

@@ -66,7 +66,7 @@ $sessions->startSession();
6666
```yaml
6767
session:
6868
name: MUSICPRODUCTIONMANAGER
69-
max_life_time: 86400
69+
max_lifetime: 86400
7070
save_handler: redis
7171
save_path: tcp://127.0.0.1:6379?auth=myredispass
7272
```
@@ -76,7 +76,7 @@ or
7676
```yaml
7777
session:
7878
name: MUSICPRODUCTIONMANAGER
79-
max_life_time: 86400
79+
max_lifetime: 86400
8080
save_handler: redis
8181
save_path: tcp://127.0.0.1:6379?auth=${REDIS_AUTH}
8282
```
@@ -90,7 +90,7 @@ For example:
9090
```yaml
9191
session:
9292
name: ${SESSION_NAME}
93-
max_life_time: ${SESSION_MAX_LIFE_TIME}
93+
max_lifetime: ${SESSION_MAX_LIFE_TIME}
9494
save_handler: ${SESSION_SAVE_HANDLER}
9595
save_path: ${SESSION_SAVE_PATH}
9696
cookie_lifetime: ${SESSION_COOKIE_LIFETIME}

manual/index.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,7 +1233,7 @@ <h3>Create Yaml File</h3>
12331233
salt: ${APP_DATABASE_SALT}
12341234
session:
12351235
name: MUSICPRODUCTIONMANAGER
1236-
max_life_time: 86400
1236+
max_lifetime: 86400
12371237
vocal_guide_instrument: piano</code></pre>
12381238
<h3>Setting Up Environment Variables</h3>
12391239
<p>On Windows, users can directly create environment variables either via the graphical user interface (GUI) or the <code>setx</code> command line. PHP can immediately read environment variables after Windows is restarted.</p>
@@ -2591,7 +2591,7 @@ <h3>Multilevel Object Secure</h3>
25912591
salt: Asia/Jakarta
25922592
session:
25932593
name: MUSICPRODUCTIONMANAGER
2594-
max_life_time: 86400
2594+
max_lifetime: 86400
25952595
save_handler: files
25962596
save_path: /tmp/session
25972597
vocal_guide_instrument: piano
@@ -2618,7 +2618,7 @@ <h3>Multilevel Object Secure</h3>
26182618
salt: hdsBgcmvq/rzfNUuhgQiBop4Hp4wqd5w03Il9zaOshK0LgGtaEK1WTcPx5OdL+9VvhmZvs7g/jDGYjYoHwXjIg==
26192619
session:
26202620
name: 4u5xAE2K74pUxZyIVsphoYUka3vpnzUx7op6CnELtdWNEepz/jQLaKynItFt5dx6bv7wjBUFL1AaZaA4ypw/CP6xtR5WFQy+RV6V8VqYM8o=
2621-
max_life_time: cspEenRp8+kwUY1RNvmEdWcLqmsRZ+UJZVjY4JwRsuIIfkr+J0w1SYCuRMzMtHG4/hZ5tlXhtGdRZyM7quCbZg==
2621+
max_lifetime: cspEenRp8+kwUY1RNvmEdWcLqmsRZ+UJZVjY4JwRsuIIfkr+J0w1SYCuRMzMtHG4/hZ5tlXhtGdRZyM7quCbZg==
26222622
save_handler: LIlCCaWHVqg9R4G6ghxDZnuenMLgSI6HjiW+tVGNDa7UyIA7FkFtOgOJtvT/EolUc+kkJSXiMo+76QhvFFq8Dg==
26232623
save_path: CZijzyucTzrj3tZ1M9PbQ6Hky1+4Gz3RnXwZNSe9/SL+9QZdpK4PoW2TSLsuQ+cKBgKgkncd7JXWgA3CFg0f1A==
26242624
result_per_page: 20
@@ -3470,7 +3470,7 @@ <h3>Session with File</h3>
34703470
<p><strong>Yaml File</strong></p>
34713471
<pre><code class="language-yaml">session:
34723472
name: ${SESSION_NAME}
3473-
max_life_time: ${SESSION_MAX_LIFE_TIME}
3473+
max_lifetime: ${SESSION_MAX_LIFE_TIME}
34743474
save_handler: ${SESSION_SAVE_HANDLER}
34753475
save_path: ${SESSION_SAVE_PATH}
34763476
cookie_lifetime: ${SESSION_COOKIE_LIFETIME}
@@ -3484,7 +3484,7 @@ <h3>Explanation:</h3>
34843484
<p><strong>name</strong>: Specifies the name of the session. The value <code>${SESSION_NAME}</code> refers to an environment variable or a parameter that should be defined elsewhere in the application or server environment. It determines the session's name identifier.</p>
34853485
</li>
34863486
<li>
3487-
<p><strong>max_life_time</strong>: Defines the maximum lifetime of the session in seconds. The value <code>${SESSION_MAX_LIFE_TIME}</code> is expected to come from an environment variable or configuration setting, controlling how long the session will last before it expires.</p>
3487+
<p><strong>max_lifetime</strong>: Defines the maximum lifetime of the session in seconds. The value <code>${SESSION_MAX_LIFE_TIME}</code> is expected to come from an environment variable or configuration setting, controlling how long the session will last before it expires.</p>
34883488
</li>
34893489
<li>
34903490
<p><strong>save_handler</strong>: Specifies the handler used to save session data. In this case, <code>${SESSION_SAVE_HANDLER}</code> likely refers to the session handler, such as <code>redis</code>, <code>files</code>, or <code>database</code>, depending on the server configuration.</p>
@@ -3527,21 +3527,21 @@ <h3>Session with Redis</h3>
35273527
<p><strong>Yaml File</strong></p>
35283528
<pre><code class="language-yaml">session:
35293529
name: MUSICPRODUCTIONMANAGER
3530-
max_life_time: 86400
3530+
max_lifetime: 86400
35313531
save_handler: redis
35323532
save_path: tcp://127.0.0.1:6379?auth=myredispass</code></pre>
35333533
<p>or</p>
35343534
<pre><code class="language-yaml">session:
35353535
name: MUSICPRODUCTIONMANAGER
3536-
max_life_time: 86400
3536+
max_lifetime: 86400
35373537
save_handler: redis
35383538
save_path: tcp://127.0.0.1:6379?auth=${REDIS_AUTH}</code></pre>
35393539
<p><strong>WARNING!</strong></p>
35403540
<p>You can not encrypt the <code>${REDIS_AUTH}</code> value. If you want to secure the config, encrypt entire <code>save_path</code> instead.</p>
35413541
<p>For example:</p>
35423542
<pre><code class="language-yaml">session:
35433543
name: ${SESSION_NAME}
3544-
max_life_time: ${SESSION_MAX_LIFE_TIME}
3544+
max_lifetime: ${SESSION_MAX_LIFE_TIME}
35453545
save_handler: ${SESSION_SAVE_HANDLER}
35463546
save_path: ${SESSION_SAVE_PATH}
35473547
cookie_lifetime: ${SESSION_COOKIE_LIFETIME}

src/Request/InputSessions.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@ class InputSessions extends PicoSession
2121
* This method ensures that only one instance of PicoSession is created (Singleton pattern).
2222
*
2323
* @param string|null $name Session name.
24-
* @param int $maxLifeTime Maximum lifetime of the session.
24+
* @param int $maxLifetime Maximum lifetime of the session.
2525
* @return self The instance of PicoSession.
2626
*/
27-
public static function getInstance($name = null, $maxLifeTime = 0)
27+
public static function getInstance($name = null, $maxLifetime = 0)
2828
{
2929
if (!isset(self::$_instance)) {
3030
self::$_instance = new self;
3131
if (isset($name)) {
3232
self::$_instance->setSessionName($name);
3333
}
34-
if ($maxLifeTime > 0) {
35-
self::$_instance->setSessionMaxLifeTime($maxLifeTime);
34+
if ($maxLifetime > 0) {
35+
self::$_instance->setSessionMaxLifetime($maxLifetime);
3636
}
3737
}
3838
self::$_instance->startSession();

src/Session/PicoSession.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ public function __construct($sessConf = null)
6060
if ($sessConf->getName() != "") {
6161
$this->setSessionName($sessConf->getName());
6262
}
63-
if ($sessConf->getMaxLifeTime() > 0) {
64-
$this->setSessionMaxLifeTime($sessConf->getMaxLifeTime());
63+
if ($sessConf->getMaxLifetime() > 0) {
64+
$this->setSessionMaxLifetime($sessConf->getMaxLifetime());
6565
}
6666
if ($sessConf->getSaveHandler() == "redis") {
6767
$redisParams = $this->getRedisParams($sessConf);
@@ -175,18 +175,18 @@ function ($matches) {
175175
* This method ensures that only one instance of PicoSession is created (Singleton pattern).
176176
*
177177
* @param string|null $name Session name.
178-
* @param int $maxLifeTime Maximum lifetime of the session.
178+
* @param int $maxLifetime Maximum lifetime of the session.
179179
* @return self The instance of PicoSession.
180180
*/
181-
public static function getInstance($name = null, $maxLifeTime = 0)
181+
public static function getInstance($name = null, $maxLifetime = 0)
182182
{
183183
if (!isset(self::$_instance)) {
184184
self::$_instance = new self;
185185
if (isset($name)) {
186186
self::$_instance->setSessionName($name);
187187
}
188-
if ($maxLifeTime > 0) {
189-
self::$_instance->setSessionMaxLifeTime($maxLifeTime);
188+
if ($maxLifetime > 0) {
189+
self::$_instance->setSessionMaxLifetime($maxLifetime);
190190
}
191191
}
192192
self::$_instance->startSession();
@@ -403,7 +403,7 @@ public function setSessionSavePath($path)
403403
* @param int $lifeTime Maximum lifetime for the session in seconds.
404404
* @return self Returns the current instance for method chaining.
405405
*/
406-
public function setSessionMaxLifeTime($lifeTime)
406+
public function setSessionMaxLifetime($lifeTime)
407407
{
408408
ini_set("session.gc_maxlifetime", $lifeTime);
409409
ini_set("session.cookie_lifetime", $lifeTime);

tests/SecretObject.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class ConfigSecret2 extends SecretObject
8383
salt: Asia/Jakarta
8484
session:
8585
name: MUSICPRODUCTIONMANAGER
86-
max_life_time: 86400
86+
max_lifetime: 86400
8787
save_handler: files
8888
save_path: /tmp/session
8989
vocal_guide_instrument: piano
@@ -115,7 +115,7 @@ class ConfigSecret2 extends SecretObject
115115
salt: hdsBgcmvq/rzfNUuhgQiBop4Hp4wqd5w03Il9zaOshK0LgGtaEK1WTcPx5OdL+9VvhmZvs7g/jDGYjYoHwXjIg==
116116
session:
117117
name: 4u5xAE2K74pUxZyIVsphoYUka3vpnzUx7op6CnELtdWNEepz/jQLaKynItFt5dx6bv7wjBUFL1AaZaA4ypw/CP6xtR5WFQy+RV6V8VqYM8o=
118-
max_life_time: cspEenRp8+kwUY1RNvmEdWcLqmsRZ+UJZVjY4JwRsuIIfkr+J0w1SYCuRMzMtHG4/hZ5tlXhtGdRZyM7quCbZg==
118+
max_lifetime: cspEenRp8+kwUY1RNvmEdWcLqmsRZ+UJZVjY4JwRsuIIfkr+J0w1SYCuRMzMtHG4/hZ5tlXhtGdRZyM7quCbZg==
119119
save_handler: LIlCCaWHVqg9R4G6ghxDZnuenMLgSI6HjiW+tVGNDa7UyIA7FkFtOgOJtvT/EolUc+kkJSXiMo+76QhvFFq8Dg==
120120
save_path: CZijzyucTzrj3tZ1M9PbQ6Hky1+4Gz3RnXwZNSe9/SL+9QZdpK4PoW2TSLsuQ+cKBgKgkncd7JXWgA3CFg0f1A==
121121
result_per_page: 20

tutorial.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1375,7 +1375,7 @@ database:
13751375
salt: ${APP_DATABASE_SALT}
13761376
session:
13771377
name: MUSICPRODUCTIONMANAGER
1378-
max_life_time: 86400
1378+
max_lifetime: 86400
13791379
vocal_guide_instrument: piano
13801380
```
13811381
@@ -2827,7 +2827,7 @@ database:
28272827
salt: Asia/Jakarta
28282828
session:
28292829
name: MUSICPRODUCTIONMANAGER
2830-
max_life_time: 86400
2830+
max_lifetime: 86400
28312831
save_handler: files
28322832
save_path: /tmp/session
28332833
vocal_guide_instrument: piano
@@ -2854,7 +2854,7 @@ database:
28542854
salt: hdsBgcmvq/rzfNUuhgQiBop4Hp4wqd5w03Il9zaOshK0LgGtaEK1WTcPx5OdL+9VvhmZvs7g/jDGYjYoHwXjIg==
28552855
session:
28562856
name: 4u5xAE2K74pUxZyIVsphoYUka3vpnzUx7op6CnELtdWNEepz/jQLaKynItFt5dx6bv7wjBUFL1AaZaA4ypw/CP6xtR5WFQy+RV6V8VqYM8o=
2857-
max_life_time: cspEenRp8+kwUY1RNvmEdWcLqmsRZ+UJZVjY4JwRsuIIfkr+J0w1SYCuRMzMtHG4/hZ5tlXhtGdRZyM7quCbZg==
2857+
max_lifetime: cspEenRp8+kwUY1RNvmEdWcLqmsRZ+UJZVjY4JwRsuIIfkr+J0w1SYCuRMzMtHG4/hZ5tlXhtGdRZyM7quCbZg==
28582858
save_handler: LIlCCaWHVqg9R4G6ghxDZnuenMLgSI6HjiW+tVGNDa7UyIA7FkFtOgOJtvT/EolUc+kkJSXiMo+76QhvFFq8Dg==
28592859
save_path: CZijzyucTzrj3tZ1M9PbQ6Hky1+4Gz3RnXwZNSe9/SL+9QZdpK4PoW2TSLsuQ+cKBgKgkncd7JXWgA3CFg0f1A==
28602860
result_per_page: 20
@@ -3808,7 +3808,7 @@ Session variables keep information about one single user, and are available to a
38083808
```yaml
38093809
session:
38103810
name: ${SESSION_NAME}
3811-
max_life_time: ${SESSION_MAX_LIFE_TIME}
3811+
max_lifetime: ${SESSION_MAX_LIFE_TIME}
38123812
save_handler: ${SESSION_SAVE_HANDLER}
38133813
save_path: ${SESSION_SAVE_PATH}
38143814
cookie_lifetime: ${SESSION_COOKIE_LIFETIME}
@@ -3822,7 +3822,7 @@ session:
38223822
38233823
- **name**: Specifies the name of the session. The value `${SESSION_NAME}` refers to an environment variable or a parameter that should be defined elsewhere in the application or server environment. It determines the session's name identifier.
38243824

3825-
- **max_life_time**: Defines the maximum lifetime of the session in seconds. The value `${SESSION_MAX_LIFE_TIME}` is expected to come from an environment variable or configuration setting, controlling how long the session will last before it expires.
3825+
- **max_lifetime**: Defines the maximum lifetime of the session in seconds. The value `${SESSION_MAX_LIFE_TIME}` is expected to come from an environment variable or configuration setting, controlling how long the session will last before it expires.
38263826

38273827
- **save_handler**: Specifies the handler used to save session data. In this case, `${SESSION_SAVE_HANDLER}` likely refers to the session handler, such as `redis`, `files`, or `database`, depending on the server configuration.
38283828

@@ -3865,7 +3865,7 @@ $sessions->startSession();
38653865
```yaml
38663866
session:
38673867
name: MUSICPRODUCTIONMANAGER
3868-
max_life_time: 86400
3868+
max_lifetime: 86400
38693869
save_handler: redis
38703870
save_path: tcp://127.0.0.1:6379?auth=myredispass
38713871
```
@@ -3875,7 +3875,7 @@ or
38753875
```yaml
38763876
session:
38773877
name: MUSICPRODUCTIONMANAGER
3878-
max_life_time: 86400
3878+
max_lifetime: 86400
38793879
save_handler: redis
38803880
save_path: tcp://127.0.0.1:6379?auth=${REDIS_AUTH}
38813881
```
@@ -3889,7 +3889,7 @@ For example:
38893889
```yaml
38903890
session:
38913891
name: ${SESSION_NAME}
3892-
max_life_time: ${SESSION_MAX_LIFE_TIME}
3892+
max_lifetime: ${SESSION_MAX_LIFE_TIME}
38933893
save_handler: ${SESSION_SAVE_HANDLER}
38943894
save_path: ${SESSION_SAVE_PATH}
38953895
cookie_lifetime: ${SESSION_COOKIE_LIFETIME}

0 commit comments

Comments
 (0)