@@ -42,16 +42,16 @@ |
||
42 | 42 | function getValue() |
43 | 43 | { |
44 | 44 | // TODO Escape value according to column type instead of variable type |
45 | - if(!is_numeric($this->value)) |
|
45 | + if (!is_numeric($this->value)) |
|
46 | 46 | { |
47 | - return "'" . $this->value . "'"; |
|
47 | + return "'".$this->value."'"; |
|
48 | 48 | } |
49 | 49 | return $this->value; |
50 | 50 | } |
51 | 51 | |
52 | 52 | function show() |
53 | 53 | { |
54 | - if(!$this->value) |
|
54 | + if (!$this->value) |
|
55 | 55 | { |
56 | 56 | return false; |
57 | 57 | } |
@@ -38,21 +38,21 @@ |
||
38 | 38 | { |
39 | 39 | // TODO Escape value according to column type instead of variable type |
40 | 40 | $value = $this->argument; |
41 | - if(!is_numeric($value)) |
|
41 | + if (!is_numeric($value)) |
|
42 | 42 | { |
43 | - return "'" . $value . "'"; |
|
43 | + return "'".$value."'"; |
|
44 | 44 | } |
45 | 45 | return $value; |
46 | 46 | } |
47 | 47 | |
48 | 48 | function show() |
49 | 49 | { |
50 | - if(!$this->argument) |
|
50 | + if (!$this->argument) |
|
51 | 51 | { |
52 | 52 | return false; |
53 | 53 | } |
54 | 54 | $value = $this->argument; |
55 | - if(!isset($value)) |
|
55 | + if (!isset($value)) |
|
56 | 56 | { |
57 | 57 | return false; |
58 | 58 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | function isJoinTable() |
58 | 58 | { |
59 | - if($this->join_type) |
|
59 | + if ($this->join_type) |
|
60 | 60 | { |
61 | 61 | return true; |
62 | 62 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | { |
68 | 68 | $oDB = &DB::getInstance(); |
69 | 69 | |
70 | - return '(' . $oDB->getSelectSql($this, $with_values) . ')'; |
|
70 | + return '('.$oDB->getSelectSql($this, $with_values).')'; |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | function isSubquery() |
@@ -36,7 +36,7 @@ |
||
36 | 36 | function toString() |
37 | 37 | { |
38 | 38 | //return $this->name; |
39 | - return sprintf("%s%s", $this->name, $this->alias ? ' as ' . $this->alias : ''); |
|
39 | + return sprintf("%s%s", $this->name, $this->alias ? ' as '.$this->alias : ''); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | function getName() |
@@ -52,13 +52,13 @@ |
||
52 | 52 | $db_info = Context::getDBInfo(); |
53 | 53 | $prefix = $db_info->master_db["db_table_prefix"]; |
54 | 54 | |
55 | - foreach($this->index_hints_list as $index_hint) |
|
55 | + foreach ($this->index_hints_list as $index_hint) |
|
56 | 56 | { |
57 | 57 | $index_hint_type = $index_hint->getIndexHintType(); |
58 | - if($index_hint_type !== 'IGNORE') |
|
58 | + if ($index_hint_type !== 'IGNORE') |
|
59 | 59 | { |
60 | - $result .= $this->alias . '.' |
|
61 | - . '"' . $prefix . substr($index_hint->getIndexName(), 1) |
|
60 | + $result .= $this->alias.'.' |
|
61 | + . '"'.$prefix.substr($index_hint->getIndexName(), 1) |
|
62 | 62 | . ($index_hint_type == 'FORCE' ? '(+)' : '') |
63 | 63 | . ', '; |
64 | 64 | } |
@@ -46,17 +46,17 @@ |
||
46 | 46 | |
47 | 47 | $index_hint_string = ''; |
48 | 48 | $indexTypeList = array('USE' => 1, 'FORCE' => 1); |
49 | - foreach($this->index_hints_list as $index_hint) |
|
49 | + foreach ($this->index_hints_list as $index_hint) |
|
50 | 50 | { |
51 | 51 | $index_hint_type = $index_hint->getIndexHintType(); |
52 | - if(isset($indexTypeList[$index_hint_type])) |
|
52 | + if (isset($indexTypeList[$index_hint_type])) |
|
53 | 53 | { |
54 | - $index_hint_string .= 'INDEX(' . $index_hint->getIndexName() . '), '; |
|
54 | + $index_hint_string .= 'INDEX('.$index_hint->getIndexName().'), '; |
|
55 | 55 | } |
56 | 56 | } |
57 | - if($index_hint_string != '') |
|
57 | + if ($index_hint_string != '') |
|
58 | 58 | { |
59 | - $result .= ' WITH(' . substr($index_hint_string, 0, -2) . ') '; |
|
59 | + $result .= ' WITH('.substr($index_hint_string, 0, -2).') '; |
|
60 | 60 | } |
61 | 61 | return $result; |
62 | 62 | } |
@@ -41,10 +41,10 @@ discard block |
||
41 | 41 | |
42 | 42 | function toString($with_value = true) |
43 | 43 | { |
44 | - $part = $this->join_type . ' ' . $this->name; |
|
45 | - $part .= $this->alias ? ' as ' . $this->alias : ''; |
|
44 | + $part = $this->join_type.' '.$this->name; |
|
45 | + $part .= $this->alias ? ' as '.$this->alias : ''; |
|
46 | 46 | $part .= ' on '; |
47 | - foreach($this->conditions as $conditionGroup) |
|
47 | + foreach ($this->conditions as $conditionGroup) |
|
48 | 48 | { |
49 | 49 | $part .= $conditionGroup->toString($with_value); |
50 | 50 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | function getArguments() |
60 | 60 | { |
61 | 61 | $args = array(); |
62 | - foreach($this->conditions as $conditionGroup) |
|
62 | + foreach ($this->conditions as $conditionGroup) |
|
63 | 63 | { |
64 | 64 | $args = array_merge($args, $conditionGroup->getArguments()); |
65 | 65 | } |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | */ |
19 | 19 | function getInstance($opt = null) |
20 | 20 | { |
21 | - if(!$GLOBALS['__CacheApc__']) |
|
21 | + if (!$GLOBALS['__CacheApc__']) |
|
22 | 22 | { |
23 | 23 | $GLOBALS['__CacheApc__'] = new CacheApc(); |
24 | 24 | } |
@@ -56,12 +56,12 @@ discard block |
||
56 | 56 | */ |
57 | 57 | function put($key, $buff, $valid_time = 0) |
58 | 58 | { |
59 | - if($valid_time == 0) |
|
59 | + if ($valid_time == 0) |
|
60 | 60 | { |
61 | 61 | $valid_time = $this->valid_time; |
62 | 62 | } |
63 | 63 | |
64 | - return apc_store(md5(_XE_PATH_ . $key), array($_SERVER['REQUEST_TIME'], $buff), $valid_time); |
|
64 | + return apc_store(md5(_XE_PATH_.$key), array($_SERVER['REQUEST_TIME'], $buff), $valid_time); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
@@ -74,15 +74,15 @@ discard block |
||
74 | 74 | */ |
75 | 75 | function isValid($key, $modified_time = 0) |
76 | 76 | { |
77 | - $_key = md5(_XE_PATH_ . $key); |
|
77 | + $_key = md5(_XE_PATH_.$key); |
|
78 | 78 | $obj = apc_fetch($_key, $success); |
79 | - if(!$success || !is_array($obj)) |
|
79 | + if (!$success || !is_array($obj)) |
|
80 | 80 | { |
81 | 81 | return false; |
82 | 82 | } |
83 | 83 | unset($obj[1]); |
84 | 84 | |
85 | - if($modified_time > 0 && $modified_time > $obj[0]) |
|
85 | + if ($modified_time > 0 && $modified_time > $obj[0]) |
|
86 | 86 | { |
87 | 87 | $this->delete($key); |
88 | 88 | return false; |
@@ -101,14 +101,14 @@ discard block |
||
101 | 101 | */ |
102 | 102 | function get($key, $modified_time = 0) |
103 | 103 | { |
104 | - $_key = md5(_XE_PATH_ . $key); |
|
104 | + $_key = md5(_XE_PATH_.$key); |
|
105 | 105 | $obj = apc_fetch($_key, $success); |
106 | - if(!$success || !is_array($obj)) |
|
106 | + if (!$success || !is_array($obj)) |
|
107 | 107 | { |
108 | 108 | return false; |
109 | 109 | } |
110 | 110 | |
111 | - if($modified_time > 0 && $modified_time > $obj[0]) |
|
111 | + if ($modified_time > 0 && $modified_time > $obj[0]) |
|
112 | 112 | { |
113 | 113 | $this->delete($key); |
114 | 114 | return false; |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | */ |
126 | 126 | function delete($key) |
127 | 127 | { |
128 | - $_key = md5(_XE_PATH_ . $key); |
|
128 | + $_key = md5(_XE_PATH_.$key); |
|
129 | 129 | return apc_delete($_key); |
130 | 130 | } |
131 | 131 | |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | } |
149 | 149 | } |
150 | 150 | |
151 | -CacheApc::$isSupport = function_exists('apc_add'); |
|
151 | +CacheApc::$isSupport = function_exists('apc_add'); |
|
152 | 152 | |
153 | 153 | /* End of file CacheApc.class.php */ |
154 | 154 | /* Location: ./classes/cache/CacheApc.class.php */ |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | */ |
21 | 21 | function getInstance($opt = null) |
22 | 22 | { |
23 | - if(!$GLOBALS['__CacheWincache__']) |
|
23 | + if (!$GLOBALS['__CacheWincache__']) |
|
24 | 24 | { |
25 | 25 | $GLOBALS['__CacheWincache__'] = new CacheWincache(); |
26 | 26 | } |
@@ -59,11 +59,11 @@ discard block |
||
59 | 59 | */ |
60 | 60 | function put($key, $buff, $valid_time = 0) |
61 | 61 | { |
62 | - if($valid_time == 0) |
|
62 | + if ($valid_time == 0) |
|
63 | 63 | { |
64 | 64 | $valid_time = $this->valid_time; |
65 | 65 | } |
66 | - return wincache_ucache_set(md5(_XE_PATH_ . $key), array($_SERVER['REQUEST_TIME'], $buff), $valid_time); |
|
66 | + return wincache_ucache_set(md5(_XE_PATH_.$key), array($_SERVER['REQUEST_TIME'], $buff), $valid_time); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |
@@ -76,15 +76,15 @@ discard block |
||
76 | 76 | */ |
77 | 77 | function isValid($key, $modified_time = 0) |
78 | 78 | { |
79 | - $_key = md5(_XE_PATH_ . $key); |
|
79 | + $_key = md5(_XE_PATH_.$key); |
|
80 | 80 | $obj = wincache_ucache_get($_key, $success); |
81 | - if(!$success || !is_array($obj)) |
|
81 | + if (!$success || !is_array($obj)) |
|
82 | 82 | { |
83 | 83 | return false; |
84 | 84 | } |
85 | 85 | unset($obj[1]); |
86 | 86 | |
87 | - if($modified_time > 0 && $modified_time > $obj[0]) |
|
87 | + if ($modified_time > 0 && $modified_time > $obj[0]) |
|
88 | 88 | { |
89 | 89 | $this->_delete($_key); |
90 | 90 | return false; |
@@ -103,14 +103,14 @@ discard block |
||
103 | 103 | */ |
104 | 104 | function get($key, $modified_time = 0) |
105 | 105 | { |
106 | - $_key = md5(_XE_PATH_ . $key); |
|
106 | + $_key = md5(_XE_PATH_.$key); |
|
107 | 107 | $obj = wincache_ucache_get($_key, $success); |
108 | - if(!$success || !is_array($obj)) |
|
108 | + if (!$success || !is_array($obj)) |
|
109 | 109 | { |
110 | 110 | return false; |
111 | 111 | } |
112 | 112 | |
113 | - if($modified_time > 0 && $modified_time > $obj[0]) |
|
113 | + if ($modified_time > 0 && $modified_time > $obj[0]) |
|
114 | 114 | { |
115 | 115 | $this->_delete($_key); |
116 | 116 | return false; |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | */ |
139 | 139 | function delete($key) |
140 | 140 | { |
141 | - $_key = md5(_XE_PATH_ . $key); |
|
141 | + $_key = md5(_XE_PATH_.$key); |
|
142 | 142 | $this->_delete($_key); |
143 | 143 | } |
144 | 144 |