PHP_53.php ➔ session_is_registered()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 28 and the first side effect is on line 6.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
3
if (version_compare(PHP_VERSION, '5.4.0') >= 0) {
4
5
  if (!isset($_ENV)) {
6
    \DBSeller\Legacy\PHP53\Emulate::env();
7
  }
8
9
  /**
10
   * Register LongArrays
11
   */
12
  \DBSeller\Legacy\PHP53\Emulate::registerLongArrays();
13
14
  if (!ini_get('register_globals')) {
15
    \DBSeller\Legacy\PHP53\Emulate::registerGlobals();
16
  }
17
18
  if (!ini_get('magic_quotes_gpc')) {
19
    \DBSeller\Legacy\PHP53\Emulate::magicQuotesGPCR();
20
  }
21
22
  if (!function_exists('session_register')) {
23
24
    /**
25
     * Register one or more global variables with the current session
26
     * @return bool
27
     */
28
    function session_register() {
29
      return call_user_func_array('\DBSeller\Legacy\PHP53\Emulate::sessionRegister', func_get_args());
30
    }
31
32
    /**
33
     * Unregister a global variable from the current session
34
     *
35
     * @param  String $key Name
36
     * @return bool
37
     */
38
    function session_unregister($key) {
39
      return \DBSeller\Legacy\PHP53\Emulate::sessionUnregister($key);
40
    }
41
42
    /**
43
     * Find out whether a global variable is registered in a session
44
     *
45
     * @param  String  $key Name
46
     * @return boolean
47
     */
48
    function session_is_registered($key) {
49
      return \DBSeller\Legacy\PHP53\Emulate::sessionIsRegistered($key);
50
    }
51
  }
52
}
53