PluginProbe ʕ •ᴥ•ʔ
WP All Import – Drag & Drop Import for CSV, XML, Excel & Google Sheets / trunk
WP All Import – Drag & Drop Import for CSV, XML, Excel & Google Sheets vtrunk
3.9.5 3.9.6 4.0.0 4.0.1 4.1.0 trunk 2.12 2.13 2.14 3.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6 3.4.7 3.4.8 3.4.9 3.5.0 3.5.1 3.5.2 3.5.3 3.5.4 3.5.5 3.5.6 3.5.7 3.5.8 3.5.9 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.6.5 3.6.6 3.6.7 3.6.8 3.6.9 3.7.0 3.7.1 3.7.2 3.7.3 3.7.3-beta-1.0 3.7.4 3.7.4-beta-1.0 3.7.5 3.7.6 3.7.7 3.7.8 3.7.9 3.8.0 3.9.0 3.9.1 3.9.2 3.9.3 3.9.4
wp-all-import / classes / session.php
wp-all-import / classes Last commit date
XmlStreamReader 3 weeks ago partner-discount-sdk 3 weeks ago api.php 3 weeks ago arraytoxml.php 3 weeks ago chunk.php 3 weeks ago config.php 2 years ago download.php 3 weeks ago error.php 3 weeks ago handler.php 3 weeks ago helper.php 3 weeks ago input.php 3 weeks ago nested.php 3 weeks ago rapidaddon.php 3 weeks ago render.php 3 weeks ago session.php 9 months ago upload.php 3 weeks ago zip.php 10 years ago
session.php
96 lines
1 <?php
2
3 abstract class PMXI_Session {
4
5 /** @var int $_customer_id */
6 protected $_import_id;
7
8 /** @var array $_data */
9 protected $_data = array();
10
11 /** @var bool $_dirty When something changes */
12 protected $_dirty = false;
13
14 /**
15 * __get function.
16 *
17 * @access public
18 * @param mixed $key
19 * @return mixed
20 */
21 public function __get( $key ) {
22 return $this->get( $key );
23 }
24
25 /**
26 * __set function.
27 *
28 * @access public
29 * @param mixed $key
30 * @param mixed $value
31 * @return void
32 */
33 public function __set( $key, $value ) {
34 $this->set( $key, $value );
35 }
36
37 /**
38 * __isset function.
39 *
40 * @access public
41 * @param mixed $key
42 * @return bool
43 */
44 public function __isset( $key ) {
45 return isset( $this->_data[ sanitize_title( $key ) ] );
46 }
47
48 /**
49 * __unset function.
50 *
51 * @access public
52 * @param mixed $key
53 * @return void
54 */
55 public function __unset( $key ) {
56
57 if ( isset( $this->_data[ $key ] ) ) {
58 unset( $this->_data[ $key ] );
59 $this->_dirty = true;
60 }
61
62 }
63
64 /**
65 * Get a session variable
66 *
67 * @param string $key
68 * @param mixed $default used if the session variable isn't set
69 * @return mixed value of session variable
70 */
71 public function get( $key, $default = null ) {
72 $key = sanitize_key( $key );
73 return isset( $this->_data[ $key ] ) ? \pmxi_maybe_unserialize( $this->_data[ $key ] ) : $default;
74 }
75
76 /**
77 * Set a session variable
78 *
79 * @param string $key
80 * @param mixed $value
81 */
82 public function set( $key, $value ) {
83 $this->_data[ sanitize_key( $key ) ] = maybe_serialize( $value );
84 $this->_dirty = true;
85 }
86
87 /**
88 * get_import_id function.
89 *
90 * @access public
91 * @return int
92 */
93 public function get_import_id() {
94 return $this->_import_id;
95 }
96 }