@@ -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 |
@@ -39,13 +39,13 @@ discard block |
||
39 | 39 | $result = sprintf('new %sTableWithHint(\'%s\'%s, array(' |
40 | 40 | , $dbType == 'Mysqli' ? 'Mysql' : $dbType |
41 | 41 | , $dbParser->escape($this->name) |
42 | - , $this->alias ? ', \'' . $dbParser->escape($this->alias) . '\'' : ', null' |
|
42 | + , $this->alias ? ', \''.$dbParser->escape($this->alias).'\'' : ', null' |
|
43 | 43 | //, ', \'' . $dbParser->escape($this->index->name) .'\', \'' . $this->index->type .'\'' |
44 | 44 | ); |
45 | - foreach($this->index as $indx) |
|
45 | + foreach ($this->index as $indx) |
|
46 | 46 | { |
47 | 47 | $result .= "new IndexHint("; |
48 | - $result .= '\'' . $dbParser->escape($indx->name) . '\', \'' . $indx->type . '\'' . ') , '; |
|
48 | + $result .= '\''.$dbParser->escape($indx->name).'\', \''.$indx->type.'\''.') , '; |
|
49 | 49 | } |
50 | 50 | $result = substr($result, 0, -2); |
51 | 51 | $result .= '))'; |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | |
55 | 55 | function getArguments() |
56 | 56 | { |
57 | - if(!isset($this->conditionsTag)) |
|
57 | + if (!isset($this->conditionsTag)) |
|
58 | 58 | { |
59 | 59 | return array(); |
60 | 60 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | $this->name = $dbParser->parseTableName($table->attrs->name); |
75 | 75 | |
76 | 76 | $this->alias = $table->attrs->alias; |
77 | - if(!$this->alias) |
|
77 | + if (!$this->alias) |
|
78 | 78 | { |
79 | 79 | $this->alias = $table->attrs->name; |
80 | 80 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | |
84 | 84 | $this->conditions = $table->conditions; |
85 | 85 | |
86 | - if($this->isJoinTable()) |
|
86 | + if ($this->isJoinTable()) |
|
87 | 87 | { |
88 | 88 | $this->conditionsTag = new JoinConditionsTag($this->conditions); |
89 | 89 | } |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | function isJoinTable() |
93 | 93 | { |
94 | 94 | $joinList = array('left join' => 1, 'left outer join' => 1, 'right join' => 1, 'right outer join' => 1); |
95 | - if(isset($joinList[$this->join_type]) && count($this->conditions)) |
|
95 | + if (isset($joinList[$this->join_type]) && count($this->conditions)) |
|
96 | 96 | { |
97 | 97 | return true; |
98 | 98 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | { |
120 | 120 | $dbParser = DB::getParser(); |
121 | 121 | |
122 | - if($this->isJoinTable()) |
|
122 | + if ($this->isJoinTable()) |
|
123 | 123 | { |
124 | 124 | return sprintf('new JoinTable(\'%s\', \'%s\', "%s", %s)' |
125 | 125 | , $dbParser->escape($this->name) |
@@ -128,12 +128,12 @@ discard block |
||
128 | 128 | } |
129 | 129 | return sprintf('new Table(\'%s\'%s)' |
130 | 130 | , $dbParser->escape($this->name) |
131 | - , $this->alias ? ', \'' . $dbParser->escape($this->alias) . '\'' : ''); |
|
131 | + , $this->alias ? ', \''.$dbParser->escape($this->alias).'\'' : ''); |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | function getArguments() |
135 | 135 | { |
136 | - if(!isset($this->conditionsTag)) |
|
136 | + if (!isset($this->conditionsTag)) |
|
137 | 137 | { |
138 | 138 | return array(); |
139 | 139 | } |
@@ -33,12 +33,12 @@ discard block |
||
33 | 33 | { |
34 | 34 | $this->pipe = $pipe; |
35 | 35 | |
36 | - if(!is_array($conditions)) |
|
36 | + if (!is_array($conditions)) |
|
37 | 37 | { |
38 | 38 | $conditions = array($conditions); |
39 | 39 | } |
40 | 40 | |
41 | - foreach($conditions as $condition) |
|
41 | + foreach ($conditions as $condition) |
|
42 | 42 | { |
43 | 43 | //if($condition->node_name === 'query') $this->conditions[] = new QueryTag($condition, true); |
44 | 44 | $this->conditions[] = new ConditionTag($condition); |
@@ -56,21 +56,21 @@ discard block |
||
56 | 56 | */ |
57 | 57 | function getConditionGroupString() |
58 | 58 | { |
59 | - $conditions_string = 'array(' . PHP_EOL; |
|
60 | - foreach($this->conditions as $condition) |
|
59 | + $conditions_string = 'array('.PHP_EOL; |
|
60 | + foreach ($this->conditions as $condition) |
|
61 | 61 | { |
62 | - $conditions_string .= $condition->getConditionString() . PHP_EOL . ','; |
|
62 | + $conditions_string .= $condition->getConditionString().PHP_EOL.','; |
|
63 | 63 | } |
64 | 64 | $conditions_string = substr($conditions_string, 0, -2); //remove ',' |
65 | 65 | $conditions_string .= ')'; |
66 | 66 | |
67 | - return sprintf("new ConditionGroup(%s%s)", $conditions_string, $this->pipe ? ',\'' . $this->pipe . '\'' : ''); |
|
67 | + return sprintf("new ConditionGroup(%s%s)", $conditions_string, $this->pipe ? ',\''.$this->pipe.'\'' : ''); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | function getArguments() |
71 | 71 | { |
72 | 72 | $arguments = array(); |
73 | - foreach($this->conditions as $condition) |
|
73 | + foreach ($this->conditions as $condition) |
|
74 | 74 | { |
75 | 75 | $arguments = array_merge($arguments, $condition->getArguments()); |
76 | 76 | } |