@@ -81,7 +81,7 @@ |
||
81 | 81 | { |
82 | 82 | parent::__construct($params); |
83 | 83 | |
84 | - $CI =& get_instance(); |
|
84 | + $CI = & get_instance(); |
|
85 | 85 | isset($CI->db) OR $CI->load->database(); |
86 | 86 | $this->_db = $CI->db; |
87 | 87 |
@@ -88,12 +88,10 @@ discard block |
||
88 | 88 | if ( ! $this->_db instanceof CI_DB_query_builder) |
89 | 89 | { |
90 | 90 | throw new Exception('Query Builder not enabled for the configured database. Aborting.'); |
91 | - } |
|
92 | - elseif ($this->_db->pconnect) |
|
91 | + } elseif ($this->_db->pconnect) |
|
93 | 92 | { |
94 | 93 | throw new Exception('Configured database connection is persistent. Aborting.'); |
95 | - } |
|
96 | - elseif ($this->_db->cache_on) |
|
94 | + } elseif ($this->_db->cache_on) |
|
97 | 95 | { |
98 | 96 | throw new Exception('Configured database connection has cache enabled. Aborting.'); |
99 | 97 | } |
@@ -102,8 +100,7 @@ discard block |
||
102 | 100 | if (strpos($db_driver, 'mysql') !== FALSE) |
103 | 101 | { |
104 | 102 | $this->_platform = 'mysql'; |
105 | - } |
|
106 | - elseif (in_array($db_driver, array('postgre', 'pdo_pgsql'), TRUE)) |
|
103 | + } elseif (in_array($db_driver, array('postgre', 'pdo_pgsql'), TRUE)) |
|
107 | 104 | { |
108 | 105 | $this->_platform = 'postgre'; |
109 | 106 | } |
@@ -206,8 +203,7 @@ discard block |
||
206 | 203 | |
207 | 204 | $this->_row_exists = FALSE; |
208 | 205 | $this->_session_id = $session_id; |
209 | - } |
|
210 | - elseif ($this->_lock === FALSE) |
|
206 | + } elseif ($this->_lock === FALSE) |
|
211 | 207 | { |
212 | 208 | return FALSE; |
213 | 209 | } |
@@ -334,8 +330,7 @@ discard block |
||
334 | 330 | } |
335 | 331 | |
336 | 332 | return FALSE; |
337 | - } |
|
338 | - elseif ($this->_platform === 'postgre') |
|
333 | + } elseif ($this->_platform === 'postgre') |
|
339 | 334 | { |
340 | 335 | $arg = "hashtext('".$session_id."')".($this->_config['match_ip'] ? ", hashtext('".$_SERVER['REMOTE_ADDR']."')" : ''); |
341 | 336 | if ($this->_db->simple_query('SELECT pg_advisory_lock('.$arg.')')) |
@@ -375,8 +370,7 @@ discard block |
||
375 | 370 | } |
376 | 371 | |
377 | 372 | return FALSE; |
378 | - } |
|
379 | - elseif ($this->_platform === 'postgre') |
|
373 | + } elseif ($this->_platform === 'postgre') |
|
380 | 374 | { |
381 | 375 | if ($this->_db->simple_query('SELECT pg_advisory_unlock('.$this->_lock.')')) |
382 | 376 | { |
@@ -92,8 +92,7 @@ discard block |
||
92 | 92 | { |
93 | 93 | $this->_config['save_path'] = rtrim($this->_config['save_path'], '/\\'); |
94 | 94 | ini_set('session.save_path', $this->_config['save_path']); |
95 | - } |
|
96 | - else |
|
95 | + } else |
|
97 | 96 | { |
98 | 97 | $this->_config['save_path'] = rtrim(ini_get('session.save_path'), '/\\'); |
99 | 98 | } |
@@ -118,8 +117,7 @@ discard block |
||
118 | 117 | { |
119 | 118 | throw new Exception("Session: Configured save path '".$this->_config['save_path']."' is not a directory, doesn't exist or cannot be created."); |
120 | 119 | } |
121 | - } |
|
122 | - elseif ( ! is_writable($save_path)) |
|
120 | + } elseif ( ! is_writable($save_path)) |
|
123 | 121 | { |
124 | 122 | throw new Exception("Session: Configured save path '".$this->_config['save_path']."' is not writable by the PHP process."); |
125 | 123 | } |
@@ -158,8 +156,7 @@ discard block |
||
158 | 156 | log_message('error', "Session: File '".$this->_file_path.$session_id."' doesn't exist and cannot be created."); |
159 | 157 | return FALSE; |
160 | 158 | } |
161 | - } |
|
162 | - elseif (($this->_file_handle = fopen($this->_file_path.$session_id, 'r+b')) === FALSE) |
|
159 | + } elseif (($this->_file_handle = fopen($this->_file_path.$session_id, 'r+b')) === FALSE) |
|
163 | 160 | { |
164 | 161 | log_message('error', "Session: Unable to open file '".$this->_file_path.$session_id."'."); |
165 | 162 | return FALSE; |
@@ -188,8 +185,7 @@ discard block |
||
188 | 185 | elseif ($this->_file_handler === FALSE) |
189 | 186 | { |
190 | 187 | return FALSE; |
191 | - } |
|
192 | - else |
|
188 | + } else |
|
193 | 189 | { |
194 | 190 | rewind($this->_file_handle); |
195 | 191 | } |
@@ -232,8 +228,7 @@ discard block |
||
232 | 228 | if ( ! is_resource($this->_file_handle)) |
233 | 229 | { |
234 | 230 | return FALSE; |
235 | - } |
|
236 | - elseif ($this->_fingerprint === md5($session_data)) |
|
231 | + } elseif ($this->_fingerprint === md5($session_data)) |
|
237 | 232 | { |
238 | 233 | return ($this->_file_new) |
239 | 234 | ? TRUE |
@@ -308,8 +303,7 @@ discard block |
||
308 | 303 | return file_exists($this->_file_path.$session_id) |
309 | 304 | ? (unlink($this->_file_path.$session_id) && $this->_cookie_destroy()) |
310 | 305 | : TRUE; |
311 | - } |
|
312 | - elseif ($this->_file_path !== NULL) |
|
306 | + } elseif ($this->_file_path !== NULL) |
|
313 | 307 | { |
314 | 308 | clearstatcache(); |
315 | 309 | return file_exists($this->_file_path.$session_id) |
@@ -84,8 +84,7 @@ discard block |
||
84 | 84 | if (empty($this->_config['save_path'])) |
85 | 85 | { |
86 | 86 | log_message('error', 'Session: No Redis save path configured.'); |
87 | - } |
|
88 | - elseif (preg_match('#(?:tcp://)?([^:?]+)(?:\:(\d+))?(\?.+)?#', $this->_config['save_path'], $matches)) |
|
87 | + } elseif (preg_match('#(?:tcp://)?([^:?]+)(?:\:(\d+))?(\?.+)?#', $this->_config['save_path'], $matches)) |
|
89 | 88 | { |
90 | 89 | isset($matches[3]) OR $matches[3] = ''; // Just to avoid undefined index notices below |
91 | 90 | $this->_config['save_path'] = array( |
@@ -97,8 +96,7 @@ discard block |
||
97 | 96 | ); |
98 | 97 | |
99 | 98 | preg_match('#prefix=([^\s&]+)#', $matches[3], $match) && $this->_key_prefix = $match[1]; |
100 | - } |
|
101 | - else |
|
99 | + } else |
|
102 | 100 | { |
103 | 101 | log_message('error', 'Session: Invalid Redis save path format: '.$this->_config['save_path']); |
104 | 102 | } |
@@ -131,16 +129,13 @@ discard block |
||
131 | 129 | if ( ! $redis->connect($this->_config['save_path']['host'], $this->_config['save_path']['port'], $this->_config['save_path']['timeout'])) |
132 | 130 | { |
133 | 131 | log_message('error', 'Session: Unable to connect to Redis with the configured settings.'); |
134 | - } |
|
135 | - elseif (isset($this->_config['save_path']['password']) && ! $redis->auth($this->_config['save_path']['password'])) |
|
132 | + } elseif (isset($this->_config['save_path']['password']) && ! $redis->auth($this->_config['save_path']['password'])) |
|
136 | 133 | { |
137 | 134 | log_message('error', 'Session: Unable to authenticate to Redis instance.'); |
138 | - } |
|
139 | - elseif (isset($this->_config['save_path']['database']) && ! $redis->select($this->_config['save_path']['database'])) |
|
135 | + } elseif (isset($this->_config['save_path']['database']) && ! $redis->select($this->_config['save_path']['database'])) |
|
140 | 136 | { |
141 | 137 | log_message('error', 'Session: Unable to select Redis database with index '.$this->_config['save_path']['database']); |
142 | - } |
|
143 | - else |
|
138 | + } else |
|
144 | 139 | { |
145 | 140 | $this->_redis = $redis; |
146 | 141 | return TRUE; |
@@ -245,8 +240,7 @@ discard block |
||
245 | 240 | return FALSE; |
246 | 241 | } |
247 | 242 | } |
248 | - } |
|
249 | - catch (RedisException $e) |
|
243 | + } catch (RedisException $e) |
|
250 | 244 | { |
251 | 245 | log_message('error', 'Session: Got RedisException on close(): '.$e->getMessage()); |
252 | 246 | } |
@@ -342,8 +336,7 @@ discard block |
||
342 | 336 | { |
343 | 337 | log_message('error', 'Session: Unable to obtain lock for '.$this->_key_prefix.$session_id.' after 30 attempts, aborting.'); |
344 | 338 | return FALSE; |
345 | - } |
|
346 | - elseif ($ttl === -1) |
|
339 | + } elseif ($ttl === -1) |
|
347 | 340 | { |
348 | 341 | log_message('debug', 'Session: Lock for '.$this->_key_prefix.$session_id.' had no TTL, overriding.'); |
349 | 342 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * |
61 | 61 | * @var string |
62 | 62 | */ |
63 | - public $skip_elements = 'p|pre|ol|ul|dl|object|table|h\d'; |
|
63 | + public $skip_elements = 'p|pre|ol|ul|dl|object|table|h\d'; |
|
64 | 64 | |
65 | 65 | /** |
66 | 66 | * Tags we want the parser to completely ignore when splitting the string. |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | * Etc... |
168 | 168 | * } |
169 | 169 | */ |
170 | - $chunks = preg_split('/(<(?:[^<>]+(?:"[^"]*"|\'[^\']*\')?)+>)/', $str, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY); |
|
170 | + $chunks = preg_split('/(<(?:[^<>]+(?:"[^"]*"|\'[^\']*\')?)+>)/', $str, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); |
|
171 | 171 | |
172 | 172 | // Build our finalized string. We cycle through the array, skipping tags, and processing the contained text |
173 | 173 | $str = ''; |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | // We trim off the right-side new line so that the closing </p> tag |
373 | 373 | // will be positioned immediately following the string, matching |
374 | 374 | // the behavior of the opening <p> tag |
375 | - $str = '<p>'.rtrim($str).'</p>'; |
|
375 | + $str = '<p>'.rtrim($str).'</p>'; |
|
376 | 376 | } |
377 | 377 | |
378 | 378 | // Remove empty paragraphs if they are on the first line, as this |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | */ |
396 | 396 | protected function _protect_characters($match) |
397 | 397 | { |
398 | - return str_replace(array("'",'"','--',' '), array('{@SQ}', '{@DQ}', '{@DD}', '{@NBS}'), $match[0]); |
|
398 | + return str_replace(array("'", '"', '--', ' '), array('{@SQ}', '{@DQ}', '{@DD}', '{@NBS}'), $match[0]); |
|
399 | 399 | } |
400 | 400 | |
401 | 401 | // -------------------------------------------------------------------- |
@@ -266,8 +266,7 @@ |
||
266 | 266 | if ($reduce_linebreaks === TRUE) |
267 | 267 | { |
268 | 268 | $table['#<p>\n*</p>#'] = ''; |
269 | - } |
|
270 | - else |
|
269 | + } else |
|
271 | 270 | { |
272 | 271 | // If we have empty paragraph tags we add a non-breaking space |
273 | 272 | // otherwise most browsers won't treat them as true paragraphs |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | * |
93 | 93 | * @var array |
94 | 94 | */ |
95 | - protected $_test_items_visible = array( |
|
95 | + protected $_test_items_visible = array( |
|
96 | 96 | 'test_name', |
97 | 97 | 'test_datatype', |
98 | 98 | 'res_datatype', |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | |
167 | 167 | $back = $this->_backtrace(); |
168 | 168 | |
169 | - $report = array ( |
|
169 | + $report = array( |
|
170 | 170 | 'test_name' => $test_name, |
171 | 171 | 'test_datatype' => gettype($test), |
172 | 172 | 'res_datatype' => $extype, |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | $result = $this->result(); |
199 | 199 | } |
200 | 200 | |
201 | - $CI =& get_instance(); |
|
201 | + $CI = & get_instance(); |
|
202 | 202 | $CI->load->language('unit_test'); |
203 | 203 | |
204 | 204 | $this->_parse_template(); |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | */ |
274 | 274 | public function result($results = array()) |
275 | 275 | { |
276 | - $CI =& get_instance(); |
|
276 | + $CI = & get_instance(); |
|
277 | 277 | $CI->load->language('unit_test'); |
278 | 278 | |
279 | 279 | if (count($results) === 0) |
@@ -157,8 +157,7 @@ discard block |
||
157 | 157 | $expected = str_replace('is_double', 'is_float', $expected); |
158 | 158 | $result = $expected($test); |
159 | 159 | $extype = str_replace(array('true', 'false'), 'bool', str_replace('is_', '', $expected)); |
160 | - } |
|
161 | - else |
|
160 | + } else |
|
162 | 161 | { |
163 | 162 | $result = ($this->strict === TRUE) ? ($test === $expected) : ($test == $expected); |
164 | 163 | $extype = gettype($expected); |
@@ -215,8 +214,7 @@ discard block |
||
215 | 214 | if ($val === $CI->lang->line('ut_passed')) |
216 | 215 | { |
217 | 216 | $val = '<span style="color: #0C0;">'.$val.'</span>'; |
218 | - } |
|
219 | - elseif ($val === $CI->lang->line('ut_failed')) |
|
217 | + } elseif ($val === $CI->lang->line('ut_failed')) |
|
220 | 218 | { |
221 | 219 | $val = '<span style="color: #C00;">'.$val.'</span>'; |
222 | 220 | } |
@@ -290,8 +288,7 @@ discard block |
||
290 | 288 | if ( ! in_array($key, $this->_test_items_visible)) |
291 | 289 | { |
292 | 290 | continue; |
293 | - } |
|
294 | - elseif (in_array($key, array('test_name', 'test_datatype', 'test_res_datatype', 'result'), TRUE)) |
|
291 | + } elseif (in_array($key, array('test_name', 'test_datatype', 'test_res_datatype', 'result'), TRUE)) |
|
295 | 292 | { |
296 | 293 | if (FALSE !== ($line = $CI->lang->line(strtolower('ut_'.$val), FALSE))) |
297 | 294 | { |
@@ -16,10 +16,10 @@ |
||
16 | 16 | |
17 | 17 | <ul class="nav navbar-nav navbar-right"> |
18 | 18 | <li> |
19 | - <?php if (! empty($_SESSION['logged_in']) ) : ?> |
|
20 | - <a href="<?= site_url( \Myth\Route::named('logout') ) ?>">Logout</a> |
|
19 | + <?php if ( ! empty($_SESSION['logged_in'])) : ?> |
|
20 | + <a href="<?= site_url(\Myth\Route::named('logout')) ?>">Logout</a> |
|
21 | 21 | <?php else : ?> |
22 | - <a href="<?= site_url( \Myth\Route::named('login') ) ?>">Login</a> |
|
22 | + <a href="<?= site_url(\Myth\Route::named('login')) ?>">Login</a> |
|
23 | 23 | <?php endif; ?> |
24 | 24 | </li> |
25 | 25 | </ul> |
@@ -18,9 +18,12 @@ |
||
18 | 18 | <li> |
19 | 19 | <?php if (! empty($_SESSION['logged_in']) ) : ?> |
20 | 20 | <a href="<?= site_url( \Myth\Route::named('logout') ) ?>">Logout</a> |
21 | - <?php else : ?> |
|
21 | + <?php else { |
|
22 | + : ?> |
|
22 | 23 | <a href="<?= site_url( \Myth\Route::named('login') ) ?>">Login</a> |
23 | - <?php endif; ?> |
|
24 | + <?php endif; |
|
25 | +} |
|
26 | +?> |
|
24 | 27 | </li> |
25 | 28 | </ul> |
26 | 29 | </div> |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | - if (empty($navbar_style)) $themer->set('navbar_style', 'navbar-static'); |
|
3 | - if (empty($containerClass)) |
|
4 | - { |
|
5 | - $themer->set('containerClass', 'container'); |
|
6 | - $containerClass = 'container'; |
|
7 | - } |
|
2 | + if (empty($navbar_style)) $themer->set('navbar_style', 'navbar-static'); |
|
3 | + if (empty($containerClass)) |
|
4 | + { |
|
5 | + $themer->set('containerClass', 'container'); |
|
6 | + $containerClass = 'container'; |
|
7 | + } |
|
8 | 8 | ?> |
9 | 9 | |
10 | 10 | <?= $themer->display('bootstrap:fragments/head') ?> |
@@ -1,5 +1,7 @@ |
||
1 | 1 | <?php |
2 | - if (empty($navbar_style)) $themer->set('navbar_style', 'navbar-static'); |
|
2 | + if (empty($navbar_style)) { |
|
3 | + $themer->set('navbar_style', 'navbar-static'); |
|
4 | + } |
|
3 | 5 | if (empty($containerClass)) |
4 | 6 | { |
5 | 7 | $themer->set('containerClass', 'container'); |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <!doctype html> |
2 | 2 | <html> |
3 | 3 | <head> |
4 | - <title><?= !empty($page_title) ? $page_title : 'Docs'; echo ' - '. config_item('site.name') ?></title> |
|
4 | + <title><?= ! empty($page_title) ? $page_title : 'Docs'; echo ' - '.config_item('site.name') ?></title> |
|
5 | 5 | |
6 | 6 | <?= $html_meta->renderTags() ?> |
7 | 7 | |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | </ul> |
38 | 38 | |
39 | 39 | <!-- Search Form --> |
40 | - <?= form_open( site_url('docs/search'), 'class="navbar-form navbar-right"' ); ?> |
|
40 | + <?= form_open(site_url('docs/search'), 'class="navbar-form navbar-right"'); ?> |
|
41 | 41 | <div class="form-group"> |
42 | 42 | <input type="search" class="form-control" name="search_terms" placeholder="<?= lang('docs_search_for') ?>"/> |
43 | 43 | </div> |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | <div class="row"> |
70 | 70 | |
71 | 71 | <div class="col-md-9 main"> |
72 | - <?php if (! empty($view_content)) : ?> |
|
72 | + <?php if ( ! empty($view_content)) : ?> |
|
73 | 73 | <?= $view_content; ?> |
74 | 74 | <?php else: ?> |
75 | 75 | <div class="alert"> |
@@ -30,7 +30,10 @@ discard block |
||
30 | 30 | <div class="collapse navbar-collapse" id="main-nav-collapse"> |
31 | 31 | <ul class="nav navbar-nav navbar-left"> |
32 | 32 | <?php foreach (config_item('docs.folders') as $group => $path) : ?> |
33 | - <li <?php if ($this->uri->segment(2) == $group) echo 'class="active"'; ?>> |
|
33 | + <li <?php if ($this->uri->segment(2) == $group) { |
|
34 | + echo 'class="active"'; |
|
35 | +} |
|
36 | +?>> |
|
34 | 37 | <a href="<?= site_url("docs/{$group}"); ?>"><?= ucwords($group) ?></a> |
35 | 38 | </li> |
36 | 39 | <?php endforeach; ?> |
@@ -71,11 +74,14 @@ discard block |
||
71 | 74 | <div class="col-md-9 main"> |
72 | 75 | <?php if (! empty($view_content)) : ?> |
73 | 76 | <?= $view_content; ?> |
74 | - <?php else: ?> |
|
77 | + <?php else { |
|
78 | + : ?> |
|
75 | 79 | <div class="alert"> |
76 | 80 | <?= lang('docs_not_found') ?> |
77 | 81 | </div> |
78 | - <?php endif; ?> |
|
82 | + <?php endif; |
|
83 | +} |
|
84 | +?> |
|
79 | 85 | </div> |
80 | 86 | |
81 | 87 | <div class="col-md-3 sidebar"> |
@@ -11,10 +11,10 @@ |
||
11 | 11 | <!-- Right Nav Section --> |
12 | 12 | <ul class="right"> |
13 | 13 | <li> |
14 | - <?php if (! empty($_SESSION['logged_in']) ) : ?> |
|
15 | - <a href="<?= site_url( \Myth\Route::named('logout') ) ?>">Logout</a> |
|
14 | + <?php if ( ! empty($_SESSION['logged_in'])) : ?> |
|
15 | + <a href="<?= site_url(\Myth\Route::named('logout')) ?>">Logout</a> |
|
16 | 16 | <?php else : ?> |
17 | - <a href="<?= site_url( \Myth\Route::named('login') ) ?>">Login</a> |
|
17 | + <a href="<?= site_url(\Myth\Route::named('login')) ?>">Login</a> |
|
18 | 18 | <?php endif; ?> |
19 | 19 | </li> |
20 | 20 | </ul> |
@@ -13,9 +13,12 @@ |
||
13 | 13 | <li> |
14 | 14 | <?php if (! empty($_SESSION['logged_in']) ) : ?> |
15 | 15 | <a href="<?= site_url( \Myth\Route::named('logout') ) ?>">Logout</a> |
16 | - <?php else : ?> |
|
16 | + <?php else { |
|
17 | + : ?> |
|
17 | 18 | <a href="<?= site_url( \Myth\Route::named('login') ) ?>">Login</a> |
18 | - <?php endif; ?> |
|
19 | + <?php endif; |
|
20 | +} |
|
21 | +?> |
|
19 | 22 | </li> |
20 | 23 | </ul> |
21 | 24 |