@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /* Copyright (C) NAVER <http://www.navercorp.com> */ |
3 | 3 | |
4 | -if(!defined('__XE__')) |
|
4 | +if (!defined('__XE__')) |
|
5 | 5 | { |
6 | 6 | exit(); |
7 | 7 | } |
@@ -11,9 +11,9 @@ discard block |
||
11 | 11 | * @author NAVER ([email protected]) |
12 | 12 | * @brief Add-on to resize images in the body |
13 | 13 | */ |
14 | -if($called_position == 'after_module_proc' && Context::getResponseMethod() == "HTML" && !isCrawler()) |
|
14 | +if ($called_position == 'after_module_proc' && Context::getResponseMethod() == "HTML" && !isCrawler()) |
|
15 | 15 | { |
16 | - if(Mobile::isFromMobilePhone()) |
|
16 | + if (Mobile::isFromMobilePhone()) |
|
17 | 17 | { |
18 | 18 | Context::loadFile('./addons/resize_image/css/resize_image.mobile.css', true); |
19 | 19 | } |
@@ -16,8 +16,7 @@ |
||
16 | 16 | if(Mobile::isFromMobilePhone()) |
17 | 17 | { |
18 | 18 | Context::loadFile('./addons/resize_image/css/resize_image.mobile.css', true); |
19 | - } |
|
20 | - else |
|
19 | + } else |
|
21 | 20 | { |
22 | 21 | Context::loadJavascriptPlugin('ui'); |
23 | 22 | Context::loadFile(array('./addons/resize_image/js/resize_image.min.js', 'body', '', null), true); |
@@ -63,37 +63,30 @@ |
||
63 | 63 | if($info->use_object_cache == 'apc') |
64 | 64 | { |
65 | 65 | $type = 'apc'; |
66 | - } |
|
67 | - else if(substr($info->use_object_cache, 0, 8) == 'memcache') |
|
66 | + } else if(substr($info->use_object_cache, 0, 8) == 'memcache') |
|
68 | 67 | { |
69 | 68 | $type = 'memcache'; |
70 | 69 | $url = $info->use_object_cache; |
71 | - } |
|
72 | - else if($info->use_object_cache == 'wincache') |
|
70 | + } else if($info->use_object_cache == 'wincache') |
|
73 | 71 | { |
74 | 72 | $type = 'wincache'; |
75 | - } |
|
76 | - else if($info->use_object_cache == 'file') |
|
73 | + } else if($info->use_object_cache == 'file') |
|
77 | 74 | { |
78 | 75 | $type = 'file'; |
79 | - } |
|
80 | - else if($always_use_file) |
|
76 | + } else if($always_use_file) |
|
81 | 77 | { |
82 | 78 | $type = 'file'; |
83 | 79 | } |
84 | - } |
|
85 | - else if($target == 'template') |
|
80 | + } else if($target == 'template') |
|
86 | 81 | { |
87 | 82 | if($info->use_template_cache == 'apc') |
88 | 83 | { |
89 | 84 | $type = 'apc'; |
90 | - } |
|
91 | - else if(substr($info->use_template_cache, 0, 8) == 'memcache') |
|
85 | + } else if(substr($info->use_template_cache, 0, 8) == 'memcache') |
|
92 | 86 | { |
93 | 87 | $type = 'memcache'; |
94 | 88 | $url = $info->use_template_cache; |
95 | - } |
|
96 | - else if($info->use_template_cache == 'wincache') |
|
89 | + } else if($info->use_template_cache == 'wincache') |
|
97 | 90 | { |
98 | 91 | $type = 'wincache'; |
99 | 92 | } |
@@ -30,8 +30,8 @@ discard block |
||
30 | 30 | */ |
31 | 31 | function &getInstance($target = 'object', $info = null, $always_use_file = false) |
32 | 32 | { |
33 | - $cache_handler_key = $target . ($always_use_file ? '_file' : ''); |
|
34 | - if(!$GLOBALS['__XE_CACHE_HANDLER__'][$cache_handler_key]) |
|
33 | + $cache_handler_key = $target.($always_use_file ? '_file' : ''); |
|
34 | + if (!$GLOBALS['__XE_CACHE_HANDLER__'][$cache_handler_key]) |
|
35 | 35 | { |
36 | 36 | $GLOBALS['__XE_CACHE_HANDLER__'][$cache_handler_key] = new CacheHandler($target, $info, $always_use_file); |
37 | 37 | } |
@@ -51,61 +51,61 @@ discard block |
||
51 | 51 | */ |
52 | 52 | function CacheHandler($target, $info = null, $always_use_file = false) |
53 | 53 | { |
54 | - if(!$info) |
|
54 | + if (!$info) |
|
55 | 55 | { |
56 | 56 | $info = Context::getDBInfo(); |
57 | 57 | } |
58 | 58 | |
59 | - if($info) |
|
59 | + if ($info) |
|
60 | 60 | { |
61 | - if($target == 'object') |
|
61 | + if ($target == 'object') |
|
62 | 62 | { |
63 | - if($info->use_object_cache == 'apc') |
|
63 | + if ($info->use_object_cache == 'apc') |
|
64 | 64 | { |
65 | 65 | $type = 'apc'; |
66 | 66 | } |
67 | - else if(substr($info->use_object_cache, 0, 8) == 'memcache') |
|
67 | + else if (substr($info->use_object_cache, 0, 8) == 'memcache') |
|
68 | 68 | { |
69 | 69 | $type = 'memcache'; |
70 | 70 | $url = $info->use_object_cache; |
71 | 71 | } |
72 | - else if($info->use_object_cache == 'wincache') |
|
72 | + else if ($info->use_object_cache == 'wincache') |
|
73 | 73 | { |
74 | 74 | $type = 'wincache'; |
75 | 75 | } |
76 | - else if($info->use_object_cache == 'file') |
|
76 | + else if ($info->use_object_cache == 'file') |
|
77 | 77 | { |
78 | 78 | $type = 'file'; |
79 | 79 | } |
80 | - else if($always_use_file) |
|
80 | + else if ($always_use_file) |
|
81 | 81 | { |
82 | 82 | $type = 'file'; |
83 | 83 | } |
84 | 84 | } |
85 | - else if($target == 'template') |
|
85 | + else if ($target == 'template') |
|
86 | 86 | { |
87 | - if($info->use_template_cache == 'apc') |
|
87 | + if ($info->use_template_cache == 'apc') |
|
88 | 88 | { |
89 | 89 | $type = 'apc'; |
90 | 90 | } |
91 | - else if(substr($info->use_template_cache, 0, 8) == 'memcache') |
|
91 | + else if (substr($info->use_template_cache, 0, 8) == 'memcache') |
|
92 | 92 | { |
93 | 93 | $type = 'memcache'; |
94 | 94 | $url = $info->use_template_cache; |
95 | 95 | } |
96 | - else if($info->use_template_cache == 'wincache') |
|
96 | + else if ($info->use_template_cache == 'wincache') |
|
97 | 97 | { |
98 | 98 | $type = 'wincache'; |
99 | 99 | } |
100 | 100 | } |
101 | 101 | |
102 | - if($type) |
|
102 | + if ($type) |
|
103 | 103 | { |
104 | - $class = 'Cache' . ucfirst($type); |
|
104 | + $class = 'Cache'.ucfirst($type); |
|
105 | 105 | include_once sprintf('%sclasses/cache/%s.class.php', _XE_PATH_, $class); |
106 | 106 | $this->handler = call_user_func(array($class, 'getInstance'), $url); |
107 | 107 | $this->keyGroupVersions = $this->handler->get('key_group_versions', 0); |
108 | - if(!$this->keyGroupVersions) |
|
108 | + if (!$this->keyGroupVersions) |
|
109 | 109 | { |
110 | 110 | $this->keyGroupVersions = array(); |
111 | 111 | $this->handler->put('key_group_versions', $this->keyGroupVersions, 0); |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | */ |
122 | 122 | function isSupport() |
123 | 123 | { |
124 | - if($this->handler && $this->handler->isSupport()) |
|
124 | + if ($this->handler && $this->handler->isSupport()) |
|
125 | 125 | { |
126 | 126 | return true; |
127 | 127 | } |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | { |
140 | 140 | $key = str_replace('/', ':', $key); |
141 | 141 | |
142 | - return __XE_VERSION__ . ':' . $key; |
|
142 | + return __XE_VERSION__.':'.$key; |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | /** |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | */ |
153 | 153 | function get($key, $modified_time = 0) |
154 | 154 | { |
155 | - if(!$this->handler) |
|
155 | + if (!$this->handler) |
|
156 | 156 | { |
157 | 157 | return false; |
158 | 158 | } |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | */ |
175 | 175 | function put($key, $obj, $valid_time = 0) |
176 | 176 | { |
177 | - if(!$this->handler && !$key) |
|
177 | + if (!$this->handler && !$key) |
|
178 | 178 | { |
179 | 179 | return false; |
180 | 180 | } |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | */ |
193 | 193 | function delete($key) |
194 | 194 | { |
195 | - if(!$this->handler) |
|
195 | + if (!$this->handler) |
|
196 | 196 | { |
197 | 197 | return false; |
198 | 198 | } |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | */ |
213 | 213 | function isValid($key, $modified_time) |
214 | 214 | { |
215 | - if(!$this->handler) |
|
215 | + if (!$this->handler) |
|
216 | 216 | { |
217 | 217 | return false; |
218 | 218 | } |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | */ |
230 | 230 | function truncate() |
231 | 231 | { |
232 | - if(!$this->handler) |
|
232 | + if (!$this->handler) |
|
233 | 233 | { |
234 | 234 | return false; |
235 | 235 | } |
@@ -255,13 +255,13 @@ discard block |
||
255 | 255 | */ |
256 | 256 | function getGroupKey($keyGroupName, $key) |
257 | 257 | { |
258 | - if(!$this->keyGroupVersions[$keyGroupName]) |
|
258 | + if (!$this->keyGroupVersions[$keyGroupName]) |
|
259 | 259 | { |
260 | 260 | $this->keyGroupVersions[$keyGroupName] = 1; |
261 | 261 | $this->handler->put('key_group_versions', $this->keyGroupVersions, 0); |
262 | 262 | } |
263 | 263 | |
264 | - return 'cache_group_' . $this->keyGroupVersions[$keyGroupName] . ':' . $keyGroupName . ':' . $key; |
|
264 | + return 'cache_group_'.$this->keyGroupVersions[$keyGroupName].':'.$keyGroupName.':'.$key; |
|
265 | 265 | } |
266 | 266 | |
267 | 267 | /** |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | * @param string $key Cache key |
149 | 149 | * @param int $modified_time Unix time of data modified. |
150 | 150 | * If stored time is older then modified time, return false. |
151 | - * @return false|mixed Return false on failure or older then modified time. Return the string associated with the $key on success. |
|
151 | + * @return boolean Return false on failure or older then modified time. Return the string associated with the $key on success. |
|
152 | 152 | */ |
153 | 153 | function get($key, $modified_time = 0) |
154 | 154 | { |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | * @param string $key Cache key |
298 | 298 | * @param int $modified_time Unix time of data modified. |
299 | 299 | * If stored time is older then modified time, return false. |
300 | - * @return false|mixed Return false on failure or older then modified time. Return the string associated with the $key on success. |
|
300 | + * @return boolean Return false on failure or older then modified time. Return the string associated with the $key on success. |
|
301 | 301 | */ |
302 | 302 | function get($key, $modified_time = 0) |
303 | 303 | { |
@@ -64,8 +64,7 @@ |
||
64 | 64 | if($this->Memcache->set('xe', 'xe', MEMCACHE_COMPRESSED, 1)) |
65 | 65 | { |
66 | 66 | $GLOBALS['XE_MEMCACHE_SUPPORT'] = true; |
67 | - } |
|
68 | - else |
|
67 | + } else |
|
69 | 68 | { |
70 | 69 | $GLOBALS['XE_MEMCACHE_SUPPORT'] = false; |
71 | 70 | } |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | */ |
23 | 23 | function getInstance($url) |
24 | 24 | { |
25 | - if(!$GLOBALS['__CacheMemcache__']) |
|
25 | + if (!$GLOBALS['__CacheMemcache__']) |
|
26 | 26 | { |
27 | 27 | $GLOBALS['__CacheMemcache__'] = new CacheMemcache($url); |
28 | 28 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $config['url'] = is_array($url) ? $url : array($url); |
43 | 43 | $this->Memcache = new Memcache; |
44 | 44 | |
45 | - foreach($config['url'] as $url) |
|
45 | + foreach ($config['url'] as $url) |
|
46 | 46 | { |
47 | 47 | $info = parse_url($url); |
48 | 48 | $this->Memcache->addServer($info['host'], $info['port']); |
@@ -56,12 +56,12 @@ discard block |
||
56 | 56 | */ |
57 | 57 | function isSupport() |
58 | 58 | { |
59 | - if(isset($GLOBALS['XE_MEMCACHE_SUPPORT'])) |
|
59 | + if (isset($GLOBALS['XE_MEMCACHE_SUPPORT'])) |
|
60 | 60 | { |
61 | 61 | return true; |
62 | 62 | } |
63 | 63 | |
64 | - if($this->Memcache->set('xe', 'xe', MEMCACHE_COMPRESSED, 1)) |
|
64 | + if ($this->Memcache->set('xe', 'xe', MEMCACHE_COMPRESSED, 1)) |
|
65 | 65 | { |
66 | 66 | $GLOBALS['XE_MEMCACHE_SUPPORT'] = true; |
67 | 67 | } |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | */ |
82 | 82 | function getKey($key) |
83 | 83 | { |
84 | - return md5(_XE_PATH_ . $key); |
|
84 | + return md5(_XE_PATH_.$key); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | */ |
104 | 104 | function put($key, $buff, $valid_time = 0) |
105 | 105 | { |
106 | - if($valid_time == 0) |
|
106 | + if ($valid_time == 0) |
|
107 | 107 | { |
108 | 108 | $valid_time = $this->valid_time; |
109 | 109 | } |
@@ -124,13 +124,13 @@ discard block |
||
124 | 124 | $_key = $this->getKey($key); |
125 | 125 | |
126 | 126 | $obj = $this->Memcache->get($_key); |
127 | - if(!$obj || !is_array($obj)) |
|
127 | + if (!$obj || !is_array($obj)) |
|
128 | 128 | { |
129 | 129 | return false; |
130 | 130 | } |
131 | 131 | unset($obj[1]); |
132 | 132 | |
133 | - if($modified_time > 0 && $modified_time > $obj[0]) |
|
133 | + if ($modified_time > 0 && $modified_time > $obj[0]) |
|
134 | 134 | { |
135 | 135 | $this->_delete($_key); |
136 | 136 | return false; |
@@ -153,12 +153,12 @@ discard block |
||
153 | 153 | { |
154 | 154 | $_key = $this->getKey($key); |
155 | 155 | $obj = $this->Memcache->get($_key); |
156 | - if(!$obj || !is_array($obj)) |
|
156 | + if (!$obj || !is_array($obj)) |
|
157 | 157 | { |
158 | 158 | return false; |
159 | 159 | } |
160 | 160 | |
161 | - if($modified_time > 0 && $modified_time > $obj[0]) |
|
161 | + if ($modified_time > 0 && $modified_time > $obj[0]) |
|
162 | 162 | { |
163 | 163 | $this->_delete($_key); |
164 | 164 | return false; |
@@ -42,8 +42,7 @@ |
||
42 | 42 | if(count($this->conditions) === 0) |
43 | 43 | { |
44 | 44 | $this->_show = false; |
45 | - } |
|
46 | - else |
|
45 | + } else |
|
47 | 46 | { |
48 | 47 | $this->_show = true; |
49 | 48 | } |
@@ -32,14 +32,14 @@ discard block |
||
32 | 32 | function ConditionGroup($conditions, $pipe = "") |
33 | 33 | { |
34 | 34 | $this->conditions = array(); |
35 | - foreach($conditions as $condition) |
|
35 | + foreach ($conditions as $condition) |
|
36 | 36 | { |
37 | - if($condition->show()) |
|
37 | + if ($condition->show()) |
|
38 | 38 | { |
39 | 39 | $this->conditions[] = $condition; |
40 | 40 | } |
41 | 41 | } |
42 | - if(count($this->conditions) === 0) |
|
42 | + if (count($this->conditions) === 0) |
|
43 | 43 | { |
44 | 44 | $this->_show = false; |
45 | 45 | } |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | |
59 | 59 | function setPipe($pipe) |
60 | 60 | { |
61 | - if($this->pipe !== $pipe) |
|
61 | + if ($this->pipe !== $pipe) |
|
62 | 62 | { |
63 | 63 | $this->_group = null; |
64 | 64 | } |
@@ -72,24 +72,24 @@ discard block |
||
72 | 72 | */ |
73 | 73 | function toString($with_value = true) |
74 | 74 | { |
75 | - if(!isset($this->_group)) |
|
75 | + if (!isset($this->_group)) |
|
76 | 76 | { |
77 | 77 | $cond_indx = 0; |
78 | 78 | $group = ''; |
79 | 79 | |
80 | - foreach($this->conditions as $condition) |
|
80 | + foreach ($this->conditions as $condition) |
|
81 | 81 | { |
82 | - if($cond_indx === 0) |
|
82 | + if ($cond_indx === 0) |
|
83 | 83 | { |
84 | 84 | $condition->setPipe(""); |
85 | 85 | } |
86 | - $group .= $condition->toString($with_value) . ' '; |
|
86 | + $group .= $condition->toString($with_value).' '; |
|
87 | 87 | $cond_indx++; |
88 | 88 | } |
89 | 89 | |
90 | - if($this->pipe !== "" && trim($group) !== '') |
|
90 | + if ($this->pipe !== "" && trim($group) !== '') |
|
91 | 91 | { |
92 | - $group = $this->pipe . ' (' . $group . ')'; |
|
92 | + $group = $this->pipe.' ('.$group.')'; |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | $this->_group = $group; |
@@ -104,10 +104,10 @@ discard block |
||
104 | 104 | function getArguments() |
105 | 105 | { |
106 | 106 | $args = array(); |
107 | - foreach($this->conditions as $condition) |
|
107 | + foreach ($this->conditions as $condition) |
|
108 | 108 | { |
109 | 109 | $arg = $condition->getArgument(); |
110 | - if($arg) |
|
110 | + if ($arg) |
|
111 | 111 | { |
112 | 112 | $args[] = $arg; |
113 | 113 | } |
@@ -30,8 +30,9 @@ discard block |
||
30 | 30 | |
31 | 31 | function getArgument() |
32 | 32 | { |
33 | - if(!$this->show()) |
|
34 | - return; |
|
33 | + if(!$this->show()) { |
|
34 | + return; |
|
35 | + } |
|
35 | 36 | return $this->argument; |
36 | 37 | } |
37 | 38 | |
@@ -55,15 +56,13 @@ discard block |
||
55 | 56 | $q = substr($q, 0, -1); |
56 | 57 | } |
57 | 58 | $q = '(' . $q . ')'; |
58 | - } |
|
59 | - else |
|
59 | + } else |
|
60 | 60 | { |
61 | 61 | // Prepared statements: column names should not be sent as query arguments, but instead concatenated to query string |
62 | 62 | if($this->argument->isColumnName()) |
63 | 63 | { |
64 | 64 | $q = $value; |
65 | - } |
|
66 | - else |
|
65 | + } else |
|
67 | 66 | { |
68 | 67 | $q = '?'; |
69 | 68 | } |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | */ |
20 | 20 | function ConditionWithArgument($column_name, $argument, $operation, $pipe = "") |
21 | 21 | { |
22 | - if($argument === null) |
|
22 | + if ($argument === null) |
|
23 | 23 | { |
24 | 24 | $this->_show = false; |
25 | 25 | return; |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | |
31 | 31 | function getArgument() |
32 | 32 | { |
33 | - if(!$this->show()) |
|
33 | + if (!$this->show()) |
|
34 | 34 | return; |
35 | 35 | return $this->argument; |
36 | 36 | } |
@@ -43,23 +43,23 @@ discard block |
||
43 | 43 | { |
44 | 44 | $value = $this->argument->getUnescapedValue(); |
45 | 45 | |
46 | - if(is_array($value)) |
|
46 | + if (is_array($value)) |
|
47 | 47 | { |
48 | 48 | $q = ''; |
49 | - foreach($value as $v) |
|
49 | + foreach ($value as $v) |
|
50 | 50 | { |
51 | 51 | $q .= '?,'; |
52 | 52 | } |
53 | - if($q !== '') |
|
53 | + if ($q !== '') |
|
54 | 54 | { |
55 | 55 | $q = substr($q, 0, -1); |
56 | 56 | } |
57 | - $q = '(' . $q . ')'; |
|
57 | + $q = '('.$q.')'; |
|
58 | 58 | } |
59 | 59 | else |
60 | 60 | { |
61 | 61 | // Prepared statements: column names should not be sent as query arguments, but instead concatenated to query string |
62 | - if($this->argument->isColumnName()) |
|
62 | + if ($this->argument->isColumnName()) |
|
63 | 63 | { |
64 | 64 | $q = $value; |
65 | 65 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $q = '?'; |
69 | 69 | } |
70 | 70 | } |
71 | - return $this->pipe . ' ' . $this->getConditionPart($q); |
|
71 | + return $this->pipe.' '.$this->getConditionPart($q); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | /** |
@@ -76,17 +76,17 @@ discard block |
||
76 | 76 | */ |
77 | 77 | function show() |
78 | 78 | { |
79 | - if(!isset($this->_show)) |
|
79 | + if (!isset($this->_show)) |
|
80 | 80 | { |
81 | - if(!$this->argument->isValid()) |
|
81 | + if (!$this->argument->isValid()) |
|
82 | 82 | { |
83 | 83 | $this->_show = false; |
84 | 84 | } |
85 | - if($this->_value === '\'\'') |
|
85 | + if ($this->_value === '\'\'') |
|
86 | 86 | { |
87 | 87 | $this->_show = false; |
88 | 88 | } |
89 | - if(!isset($this->_show)) |
|
89 | + if (!isset($this->_show)) |
|
90 | 90 | { |
91 | 91 | return parent::show(); |
92 | 92 | } |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | { |
28 | 28 | parent::SelectExpression($column_name, $alias); |
29 | 29 | |
30 | - if(!is_bool($click_count)) |
|
30 | + if (!is_bool($click_count)) |
|
31 | 31 | { |
32 | 32 | // error_log("Click_count value for $column_name was not boolean", 0); |
33 | 33 | $this->click_count = false; |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | function getExpression() |
48 | 48 | { |
49 | 49 | $db_type = Context::getDBType(); |
50 | - if($db_type == 'cubrid') |
|
50 | + if ($db_type == 'cubrid') |
|
51 | 51 | { |
52 | 52 | return "INCR($this->column_name)"; |
53 | 53 | } |
@@ -50,8 +50,7 @@ |
||
50 | 50 | if($db_type == 'cubrid') |
51 | 51 | { |
52 | 52 | return "INCR($this->column_name)"; |
53 | - } |
|
54 | - else |
|
53 | + } else |
|
55 | 54 | { |
56 | 55 | return "$this->column_name"; |
57 | 56 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | function getValue($with_values = true) |
33 | 33 | { |
34 | - if($with_values) |
|
34 | + if ($with_values) |
|
35 | 35 | { |
36 | 36 | return $this->argument->getValue(); |
37 | 37 | } |
@@ -40,12 +40,12 @@ discard block |
||
40 | 40 | |
41 | 41 | function show() |
42 | 42 | { |
43 | - if(!$this->argument) |
|
43 | + if (!$this->argument) |
|
44 | 44 | { |
45 | 45 | return false; |
46 | 46 | } |
47 | 47 | $value = $this->argument->getValue(); |
48 | - if(!isset($value)) |
|
48 | + if (!isset($value)) |
|
49 | 49 | { |
50 | 50 | return false; |
51 | 51 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | function getArguments() |
61 | 61 | { |
62 | - if($this->argument) |
|
62 | + if ($this->argument) |
|
63 | 63 | { |
64 | 64 | return array($this->argument); |
65 | 65 | } |
@@ -62,8 +62,7 @@ |
||
62 | 62 | if($this->argument) |
63 | 63 | { |
64 | 64 | return array($this->argument); |
65 | - } |
|
66 | - else |
|
65 | + } else |
|
67 | 66 | { |
68 | 67 | return array(); |
69 | 68 | } |
@@ -59,11 +59,11 @@ |
||
59 | 59 | function getArguments() |
60 | 60 | { |
61 | 61 | $args = array(); |
62 | - if(is_a($this->column_name, 'Argument')) |
|
62 | + if (is_a($this->column_name, 'Argument')) |
|
63 | 63 | { |
64 | 64 | $args[] = $this->column_name; |
65 | 65 | } |
66 | - if(is_a($this->sort_order, 'Argument')) |
|
66 | + if (is_a($this->sort_order, 'Argument')) |
|
67 | 67 | { |
68 | 68 | $args[] = $this->sort_order; |
69 | 69 | } |
@@ -53,12 +53,10 @@ |
||
53 | 53 | if($index_hint_type == 'USE') |
54 | 54 | { |
55 | 55 | $use_index_hint .= $index_hint->getIndexName() . ', '; |
56 | - } |
|
57 | - else if($index_hint_type == 'FORCE') |
|
56 | + } else if($index_hint_type == 'FORCE') |
|
58 | 57 | { |
59 | 58 | $force_index_hint .= $index_hint->getIndexName() . ', '; |
60 | - } |
|
61 | - else if($index_hint_type == 'IGNORE') |
|
59 | + } else if($index_hint_type == 'IGNORE') |
|
62 | 60 | { |
63 | 61 | $ignore_index_hint .= $index_hint->getIndexName() . ', '; |
64 | 62 | } |
@@ -47,33 +47,33 @@ |
||
47 | 47 | $use_index_hint = ''; |
48 | 48 | $force_index_hint = ''; |
49 | 49 | $ignore_index_hint = ''; |
50 | - foreach($this->index_hints_list as $index_hint) |
|
50 | + foreach ($this->index_hints_list as $index_hint) |
|
51 | 51 | { |
52 | 52 | $index_hint_type = $index_hint->getIndexHintType(); |
53 | - if($index_hint_type == 'USE') |
|
53 | + if ($index_hint_type == 'USE') |
|
54 | 54 | { |
55 | - $use_index_hint .= $index_hint->getIndexName() . ', '; |
|
55 | + $use_index_hint .= $index_hint->getIndexName().', '; |
|
56 | 56 | } |
57 | - else if($index_hint_type == 'FORCE') |
|
57 | + else if ($index_hint_type == 'FORCE') |
|
58 | 58 | { |
59 | - $force_index_hint .= $index_hint->getIndexName() . ', '; |
|
59 | + $force_index_hint .= $index_hint->getIndexName().', '; |
|
60 | 60 | } |
61 | - else if($index_hint_type == 'IGNORE') |
|
61 | + else if ($index_hint_type == 'IGNORE') |
|
62 | 62 | { |
63 | - $ignore_index_hint .= $index_hint->getIndexName() . ', '; |
|
63 | + $ignore_index_hint .= $index_hint->getIndexName().', '; |
|
64 | 64 | } |
65 | 65 | } |
66 | - if($use_index_hint != '') |
|
66 | + if ($use_index_hint != '') |
|
67 | 67 | { |
68 | - $result .= ' USE INDEX (' . substr($use_index_hint, 0, -2) . ') '; |
|
68 | + $result .= ' USE INDEX ('.substr($use_index_hint, 0, -2).') '; |
|
69 | 69 | } |
70 | - if($force_index_hint != '') |
|
70 | + if ($force_index_hint != '') |
|
71 | 71 | { |
72 | - $result .= ' FORCE INDEX (' . substr($force_index_hint, 0, -2) . ') '; |
|
72 | + $result .= ' FORCE INDEX ('.substr($force_index_hint, 0, -2).') '; |
|
73 | 73 | } |
74 | - if($ignore_index_hint != '') |
|
74 | + if ($ignore_index_hint != '') |
|
75 | 75 | { |
76 | - $result .= ' IGNORE INDEX (' . substr($ignore_index_hint, 0, -2) . ') '; |
|
76 | + $result .= ' IGNORE INDEX ('.substr($ignore_index_hint, 0, -2).') '; |
|
77 | 77 | } |
78 | 78 | return $result; |
79 | 79 | } |