@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | use Myth\Themers\MetaCollection; |
| 33 | 33 | use Zend\Escaper\Escaper; |
| 34 | 34 | |
| 35 | -require_once dirname(__FILE__) .'/../Themers/escape.php'; |
|
| 35 | +require_once dirname(__FILE__).'/../Themers/escape.php'; |
|
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | 38 | * Class ThemedController |
@@ -122,10 +122,10 @@ discard block |
||
| 122 | 122 | $themer = config_item('active_themer'); |
| 123 | 123 | |
| 124 | 124 | if (empty($themer)) { |
| 125 | - throw new \RuntimeException( lang('no_themer') ); |
|
| 125 | + throw new \RuntimeException(lang('no_themer')); |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | - $this->themer = new $themer( get_instance() ); |
|
| 128 | + $this->themer = new $themer(get_instance()); |
|
| 129 | 129 | |
| 130 | 130 | // Register our paths with the themer |
| 131 | 131 | $paths = config_item('theme.paths'); |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | // Set our default theme. |
| 138 | - $this->themer->setDefaultTheme( config_item('theme.default_theme') ); |
|
| 138 | + $this->themer->setDefaultTheme(config_item('theme.default_theme')); |
|
| 139 | 139 | |
| 140 | 140 | // Register our variants with the engine. |
| 141 | 141 | $variants = config_item('theme.variants'); |
@@ -155,12 +155,12 @@ discard block |
||
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | // Load up our meta collection |
| 158 | - $this->meta = new MetaCollection( get_instance() ); |
|
| 158 | + $this->meta = new MetaCollection(get_instance()); |
|
| 159 | 159 | |
| 160 | 160 | // Should we autoescape vars? |
| 161 | 161 | if (is_null($this->auto_escape)) |
| 162 | 162 | { |
| 163 | - $this->auto_escape = config_item( 'theme.auto_escape' ); |
|
| 163 | + $this->auto_escape = config_item('theme.auto_escape'); |
|
| 164 | 164 | } |
| 165 | 165 | } |
| 166 | 166 | |
@@ -175,11 +175,11 @@ discard block |
||
| 175 | 175 | * @param array $data |
| 176 | 176 | * @param int $cache_time |
| 177 | 177 | */ |
| 178 | - public function render($data = array(), $cache_time=0) |
|
| 178 | + public function render($data = array(), $cache_time = 0) |
|
| 179 | 179 | { |
| 180 | 180 | if ($cache_time > 0) |
| 181 | 181 | { |
| 182 | - $this->output->cache( (int)$cache_time ); |
|
| 182 | + $this->output->cache((int) $cache_time); |
|
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | // Determine the correct theme to use |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | $this->themer->setTheme($theme); |
| 188 | 188 | |
| 189 | 189 | // Determine the correct layout to use |
| 190 | - $layout = !empty($this->layout) ? $this->layout : null; |
|
| 190 | + $layout = ! empty($this->layout) ? $this->layout : null; |
|
| 191 | 191 | $this->themer->setLayout($layout); |
| 192 | 192 | |
| 193 | 193 | // Merge any saved vars into the data |
@@ -202,12 +202,12 @@ discard block |
||
| 202 | 202 | $data['html_meta'] = $this->meta; |
| 203 | 203 | |
| 204 | 204 | // Include our UIKit so views can use it |
| 205 | - if (! empty($this->uikit)) { |
|
| 205 | + if ( ! empty($this->uikit)) { |
|
| 206 | 206 | $data['uikit'] = $this->uikit; |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | // Build our notices from the theme's view file. |
| 210 | - $data['notice'] = $this->themer->display($this->themer->theme() . ':notice', ["notice" => $this->message()]); |
|
| 210 | + $data['notice'] = $this->themer->display($this->themer->theme().':notice', ["notice" => $this->message()]); |
|
| 211 | 211 | |
| 212 | 212 | // Make sure any scripts/stylesheets are available to the view |
| 213 | 213 | $data['external_scripts'] = $this->external_scripts; |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | * @param string $context |
| 239 | 239 | * @param bool $do_escape |
| 240 | 240 | */ |
| 241 | - public function setVar($name, $value = null, $context='html', $do_escape=null) |
|
| 241 | + public function setVar($name, $value = null, $context = 'html', $do_escape = null) |
|
| 242 | 242 | { |
| 243 | 243 | $escape = $do_escape == true ? true : $this->auto_escape; |
| 244 | 244 | |
@@ -276,9 +276,9 @@ discard block |
||
| 276 | 276 | */ |
| 277 | 277 | public function setMessage($message = '', $type = 'info') |
| 278 | 278 | { |
| 279 | - if (! empty($message)) { |
|
| 279 | + if ( ! empty($message)) { |
|
| 280 | 280 | if (isset($this->session)) { |
| 281 | - $this->session->set_flashdata('message', $type . '::' . $message); |
|
| 281 | + $this->session->set_flashdata('message', $type.'::'.$message); |
|
| 282 | 282 | } |
| 283 | 283 | |
| 284 | 284 | $this->message = array( |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | if (empty($message) && class_exists('CI_Session')) { |
| 309 | 309 | $message = $this->session->flashdata('message'); |
| 310 | 310 | |
| 311 | - if (! empty($message)) { |
|
| 311 | + if ( ! empty($message)) { |
|
| 312 | 312 | // Split out our message parts |
| 313 | 313 | $temp_message = explode('::', $message); |
| 314 | 314 | $return['type'] = $temp_message[0]; |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | public function addScript($filename) |
| 374 | 374 | { |
| 375 | 375 | if (strpos($filename, 'http') === FALSE) { |
| 376 | - $filename = base_url() . 'assets/js/' . $filename; |
|
| 376 | + $filename = base_url().'assets/js/'.$filename; |
|
| 377 | 377 | } |
| 378 | 378 | |
| 379 | 379 | $this->external_scripts[] = $filename; |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | public function addStyle($filename) |
| 388 | 388 | { |
| 389 | 389 | if (strpos($filename, 'http') === FALSE) { |
| 390 | - $filename = base_url() . 'assets/css/' . $filename; |
|
| 390 | + $filename = base_url().'assets/css/'.$filename; |
|
| 391 | 391 | } |
| 392 | 392 | |
| 393 | 393 | $this->stylesheets[] = $filename; |
@@ -48,21 +48,21 @@ discard block |
||
| 48 | 48 | public static function schedule($alias, $time_string, $task) |
| 49 | 49 | { |
| 50 | 50 | // Valid Alias? |
| 51 | - if (! is_string($alias) || empty($alias)) |
|
| 51 | + if ( ! is_string($alias) || empty($alias)) |
|
| 52 | 52 | { |
| 53 | - throw new \RuntimeException( lang('cron.bad_alias') ); |
|
| 53 | + throw new \RuntimeException(lang('cron.bad_alias')); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | // Valid TimeString? |
| 57 | - if (! is_string($time_string) || empty($time_string)) |
|
| 57 | + if ( ! is_string($time_string) || empty($time_string)) |
|
| 58 | 58 | { |
| 59 | - throw new \RuntimeException( lang('cron.bad_timestring') ); |
|
| 59 | + throw new \RuntimeException(lang('cron.bad_timestring')); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | // Valid Task? |
| 63 | - if (! is_callable($task) && ! is_string($task)) |
|
| 63 | + if ( ! is_callable($task) && ! is_string($task)) |
|
| 64 | 64 | { |
| 65 | - throw new \RuntimeException( lang('cron.bad_task') . $alias); |
|
| 65 | + throw new \RuntimeException(lang('cron.bad_task').$alias); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | static::$tasks[$alias] = new CronTask($time_string, $task); |
@@ -102,9 +102,9 @@ discard block |
||
| 102 | 102 | * ... |
| 103 | 103 | * ] |
| 104 | 104 | */ |
| 105 | - public static function listAll($current_time='now') |
|
| 105 | + public static function listAll($current_time = 'now') |
|
| 106 | 106 | { |
| 107 | - if (! count(static::$tasks)) |
|
| 107 | + if ( ! count(static::$tasks)) |
|
| 108 | 108 | { |
| 109 | 109 | return null; |
| 110 | 110 | } |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | */ |
| 134 | 134 | public static function task($alias) |
| 135 | 135 | { |
| 136 | - if (empty(static::$tasks[$alias]) ) |
|
| 136 | + if (empty(static::$tasks[$alias])) |
|
| 137 | 137 | { |
| 138 | 138 | return null; |
| 139 | 139 | } |
@@ -168,13 +168,13 @@ discard block |
||
| 168 | 168 | * @param string $current_time |
| 169 | 169 | * @return string |
| 170 | 170 | */ |
| 171 | - public static function run($alias=null, $force_run=false, $current_time='now') |
|
| 171 | + public static function run($alias = null, $force_run = false, $current_time = 'now') |
|
| 172 | 172 | { |
| 173 | 173 | $tasks = static::$tasks; |
| 174 | 174 | |
| 175 | - if (! empty($alias) && isset($tasks[$alias])) |
|
| 175 | + if ( ! empty($alias) && isset($tasks[$alias])) |
|
| 176 | 176 | { |
| 177 | - $tasks = [$alias => $tasks[$alias] ]; |
|
| 177 | + $tasks = [$alias => $tasks[$alias]]; |
|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | $output = ''; |
@@ -185,34 +185,34 @@ discard block |
||
| 185 | 185 | { |
| 186 | 186 | if ($task->isDue($current_time) || $force_run === true) |
| 187 | 187 | { |
| 188 | - $output .= sprintf( lang('cron.running_task'), $alias); |
|
| 188 | + $output .= sprintf(lang('cron.running_task'), $alias); |
|
| 189 | 189 | |
| 190 | 190 | try { |
| 191 | 191 | $result = self::runTask($alias); |
| 192 | 192 | |
| 193 | 193 | if (is_bool($result)) |
| 194 | 194 | { |
| 195 | - $output .= $result === true ? lang('done') ."\n" : lang('failed') ."\n"; |
|
| 195 | + $output .= $result === true ? lang('done')."\n" : lang('failed')."\n"; |
|
| 196 | 196 | } |
| 197 | 197 | else if (is_string($result)) |
| 198 | 198 | { |
| 199 | - $output .= sprintf( lang('cron.done_with_msg'), $result); |
|
| 199 | + $output .= sprintf(lang('cron.done_with_msg'), $result); |
|
| 200 | 200 | } |
| 201 | 201 | } |
| 202 | 202 | catch (\Exception $e) |
| 203 | 203 | { |
| 204 | - $output .= "[Exception] ". $e->getMessage() ."\n"; |
|
| 204 | + $output .= "[Exception] ".$e->getMessage()."\n"; |
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | $count++; |
| 208 | 208 | } |
| 209 | 209 | else |
| 210 | 210 | { |
| 211 | - $output .= sprintf( lang('cron.not_scheduled_until'), $alias, $task->nextRunDate() ); |
|
| 211 | + $output .= sprintf(lang('cron.not_scheduled_until'), $alias, $task->nextRunDate()); |
|
| 212 | 212 | } |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | - if (! $count) |
|
| 215 | + if ( ! $count) |
|
| 216 | 216 | { |
| 217 | 217 | $output .= lang('cron.nothing_scheduled'); |
| 218 | 218 | } |
@@ -270,10 +270,10 @@ discard block |
||
| 270 | 270 | $class = new $class(); |
| 271 | 271 | } else { |
| 272 | 272 | get_instance()->load->library($class); |
| 273 | - $class =& get_instance()->$class; |
|
| 273 | + $class = & get_instance()->$class; |
|
| 274 | 274 | } |
| 275 | 275 | |
| 276 | - if (! method_exists($class, $method)) { |
|
| 276 | + if ( ! method_exists($class, $method)) { |
|
| 277 | 277 | log_message('error', "[CRON] Method not found: {$class}::{$method}"); |
| 278 | 278 | return $success; |
| 279 | 279 | } |
@@ -75,9 +75,9 @@ discard block |
||
| 75 | 75 | |
| 76 | 76 | // If $task is not callable, it should be a library:method |
| 77 | 77 | // string that we can parse. But it must have the colon in the string. |
| 78 | - if (! is_callable($task) && strpos($task, ':') === false) |
|
| 78 | + if ( ! is_callable($task) && strpos($task, ':') === false) |
|
| 79 | 79 | { |
| 80 | - throw new \RuntimeException( lang('cron.invalid_task') ); |
|
| 80 | + throw new \RuntimeException(lang('cron.invalid_task')); |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | $this->task = $task; |
@@ -92,9 +92,9 @@ discard block |
||
| 92 | 92 | * |
| 93 | 93 | * @return timestamp|null |
| 94 | 94 | */ |
| 95 | - public function nextRunDate($current_time='now') |
|
| 95 | + public function nextRunDate($current_time = 'now') |
|
| 96 | 96 | { |
| 97 | - $current_time = is_numeric($current_time) ? (int)$current_time : strtotime($current_time); |
|
| 97 | + $current_time = is_numeric($current_time) ? (int) $current_time : strtotime($current_time); |
|
| 98 | 98 | |
| 99 | 99 | $scheduleType = $this->determineScheduleType($this->schedule); |
| 100 | 100 | |
@@ -123,9 +123,9 @@ discard block |
||
| 123 | 123 | * |
| 124 | 124 | * @return timestamp|null |
| 125 | 125 | */ |
| 126 | - public function previousRunDate($current_time='now') |
|
| 126 | + public function previousRunDate($current_time = 'now') |
|
| 127 | 127 | { |
| 128 | - $current_time = is_numeric($current_time) ? (int)$current_time : strtotime($current_time); |
|
| 128 | + $current_time = is_numeric($current_time) ? (int) $current_time : strtotime($current_time); |
|
| 129 | 129 | |
| 130 | 130 | $scheduleType = $this->determineScheduleType($this->schedule); |
| 131 | 131 | |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | return $this->findPreviousOrdinal($this->schedule, $current_time); |
| 139 | 139 | break; |
| 140 | 140 | case 'increment': |
| 141 | - return strtotime('-1 '. $this->schedule, $current_time); |
|
| 141 | + return strtotime('-1 '.$this->schedule, $current_time); |
|
| 142 | 142 | break; |
| 143 | 143 | } |
| 144 | 144 | |
@@ -155,13 +155,13 @@ discard block |
||
| 155 | 155 | * |
| 156 | 156 | * @return bool |
| 157 | 157 | */ |
| 158 | - public function isDue($current_time='now') |
|
| 158 | + public function isDue($current_time = 'now') |
|
| 159 | 159 | { |
| 160 | - $current_time = is_numeric($current_time) ? (int)$current_time : strtotime($current_time); |
|
| 160 | + $current_time = is_numeric($current_time) ? (int) $current_time : strtotime($current_time); |
|
| 161 | 161 | |
| 162 | 162 | // For easier matching, and I can't imagine people needing cronjob |
| 163 | 163 | // accuracy to the seconds, we'll just take the current minute. |
| 164 | - return date('Y-m-d H:i', $current_time) == date('Y-m-d H:i', $this->nextRunDate($current_time) ); |
|
| 164 | + return date('Y-m-d H:i', $current_time) == date('Y-m-d H:i', $this->nextRunDate($current_time)); |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | //-------------------------------------------------------------------- |
@@ -219,15 +219,15 @@ discard block |
||
| 219 | 219 | { |
| 220 | 220 | $incs = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sun', 'mon', 'tue', |
| 221 | 221 | 'wed', 'thu', 'fri', 'sat', 'weekday', 'weekdays', 'midnight', 'noon']; |
| 222 | - $bigger_incs = [ 'back of', 'front of', 'first day of', 'last day of']; |
|
| 222 | + $bigger_incs = ['back of', 'front of', 'first day of', 'last day of']; |
|
| 223 | 223 | $ordinals = ['first', 'second', 'third', 'fourth', 'fifth', 'sixth', 'seventh', 'eighth', 'ninth', 'tenth', 'eleventh', 'twelfth']; |
| 224 | - $schedule = trim( strtolower($schedule) ); |
|
| 224 | + $schedule = trim(strtolower($schedule)); |
|
| 225 | 225 | |
| 226 | 226 | $multiple_words = strpos($schedule, ' '); |
| 227 | 227 | $first_word = substr($schedule, 0, $multiple_words ? $multiple_words : strlen($schedule)); |
| 228 | 228 | |
| 229 | 229 | // Is the first character a number? Then it's a time |
| 230 | - if ( is_numeric( $first_word ) ) |
|
| 230 | + if (is_numeric($first_word)) |
|
| 231 | 231 | { |
| 232 | 232 | return 'time'; |
| 233 | 233 | } |
@@ -269,9 +269,9 @@ discard block |
||
| 269 | 269 | * @param $type |
| 270 | 270 | * @return float|int|null |
| 271 | 271 | */ |
| 272 | - public function findDateInterval($schedule, $type, $current_time='now') |
|
| 272 | + public function findDateInterval($schedule, $type, $current_time = 'now') |
|
| 273 | 273 | { |
| 274 | - $current_time = is_numeric($current_time) ? (int)$current_time : strtotime($current_time); |
|
| 274 | + $current_time = is_numeric($current_time) ? (int) $current_time : strtotime($current_time); |
|
| 275 | 275 | |
| 276 | 276 | // list($int, $period) = explode(' ', $schedule); |
| 277 | 277 | |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | |
| 302 | 302 | if (is_numeric($return)) |
| 303 | 303 | { |
| 304 | - $return = (int)$return; |
|
| 304 | + $return = (int) $return; |
|
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | return $return; |
@@ -317,9 +317,9 @@ discard block |
||
| 317 | 317 | * @param string $current_time |
| 318 | 318 | * @return int|null |
| 319 | 319 | */ |
| 320 | - public function findPreviousOrdinal($schedule, $current_time='now') |
|
| 320 | + public function findPreviousOrdinal($schedule, $current_time = 'now') |
|
| 321 | 321 | { |
| 322 | - $current_time = is_numeric($current_time) ? (int)$current_time : strtotime($current_time); |
|
| 322 | + $current_time = is_numeric($current_time) ? (int) $current_time : strtotime($current_time); |
|
| 323 | 323 | |
| 324 | 324 | if (empty($schedule)) return null; |
| 325 | 325 | |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | |
| 87 | 87 | public function __construct($config = array()) |
| 88 | 88 | { |
| 89 | - $this->apppath = ! empty($config['apppath']) ? rtrim($config['apppath'], '/') . '/' : ''; |
|
| 89 | + $this->apppath = ! empty($config['apppath']) ? rtrim($config['apppath'], '/').'/' : ''; |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | //-------------------------------------------------------------------- |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | try { |
| 160 | - $xml = new \SimpleXMLElement('<?xml version="1.0" standalone="yes"?><div>' . $content . '</div>'); |
|
| 160 | + $xml = new \SimpleXMLElement('<?xml version="1.0" standalone="yes"?><div>'.$content.'</div>'); |
|
| 161 | 161 | } catch (\Exception $e) { |
| 162 | 162 | // SimpleXML barfed on us, so send back the un-modified content |
| 163 | 163 | return $content; |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | |
| 166 | 166 | // Prepare some things and cleanup others |
| 167 | 167 | $groups = array_keys($this->doc_folders); |
| 168 | - $site_url = rtrim($site_url, '/') . '/'; |
|
| 168 | + $site_url = rtrim($site_url, '/').'/'; |
|
| 169 | 169 | $current_url = rtrim($current_url, '#/'); |
| 170 | 170 | |
| 171 | 171 | // Try to determine the current_url if one isn't set. |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | $content = trim(str_replace('<?xml version="1.0" standalone="yes"?>', '', $content)); |
| 185 | 185 | |
| 186 | 186 | // Clean up and style the tables |
| 187 | - $content = str_replace('<table>', '<table class="' . $this->table_classes . '">', $content); |
|
| 187 | + $content = str_replace('<table>', '<table class="'.$this->table_classes.'">', $content); |
|
| 188 | 188 | |
| 189 | 189 | return $content; |
| 190 | 190 | } |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | try { |
| 239 | - $xml = new \SimpleXMLElement('<?xml version="1.0" standalone="yes"?><div>' . $content . '</div>'); |
|
| 239 | + $xml = new \SimpleXMLElement('<?xml version="1.0" standalone="yes"?><div>'.$content.'</div>'); |
|
| 240 | 240 | } catch (\Exception $e) { |
| 241 | 241 | // SimpleXML barfed on us, so send back the un-modified content |
| 242 | 242 | return []; |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | |
| 267 | 267 | $this->formatters[] = [ |
| 268 | 268 | 'callable' => $callback, |
| 269 | - 'cascade' => (bool)$cascade |
|
| 269 | + 'cascade' => (bool) $cascade |
|
| 270 | 270 | ]; |
| 271 | 271 | |
| 272 | 272 | return $this; |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | */ |
| 283 | 283 | public function format($str) |
| 284 | 284 | { |
| 285 | - if (! is_array($this->formatters)) return $str; |
|
| 285 | + if ( ! is_array($this->formatters)) return $str; |
|
| 286 | 286 | |
| 287 | 287 | foreach ($this->formatters as $formatter) { |
| 288 | 288 | $method = $formatter['callable']; |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | |
| 291 | 291 | $str = call_user_func($method, $str); |
| 292 | 292 | |
| 293 | - if (! $cascade) return $str; |
|
| 293 | + if ( ! $cascade) return $str; |
|
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | return $str; |
@@ -334,14 +334,14 @@ discard block |
||
| 334 | 334 | // Module docs need $this->current_group and $type. |
| 335 | 335 | $tocRoot = $this->current_folder; |
| 336 | 336 | if ($this->current_folder != strtolower($folder)) { |
| 337 | - $tocRoot .= '/' . strtolower($folder); |
|
| 337 | + $tocRoot .= '/'.strtolower($folder); |
|
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | $toc = []; |
| 341 | 341 | foreach ($map as $files) { |
| 342 | 342 | // If $files isn't an array, then make it one so that all situations |
| 343 | 343 | // may be dealt with cleanly. |
| 344 | - if (! is_array($files)) { |
|
| 344 | + if ( ! is_array($files)) { |
|
| 345 | 345 | $files = [$files]; |
| 346 | 346 | } |
| 347 | 347 | |
@@ -389,7 +389,7 @@ discard block |
||
| 389 | 389 | $sizes[] = count($chapters); |
| 390 | 390 | } |
| 391 | 391 | |
| 392 | - $column_avg = (int)round(array_sum($sizes) / $section_count); |
|
| 392 | + $column_avg = (int) round(array_sum($sizes) / $section_count); |
|
| 393 | 393 | |
| 394 | 394 | // Split things into 4 columns of approximately equal size. |
| 395 | 395 | // If we only have 4 columns (or less), then make sure to |
@@ -401,7 +401,7 @@ discard block |
||
| 401 | 401 | $keys = array_keys($toc); |
| 402 | 402 | |
| 403 | 403 | for ($i = 0; $i <= $section_count; $i++) { |
| 404 | - if (! isset($keys[$i])) { |
|
| 404 | + if ( ! isset($keys[$i])) { |
|
| 405 | 405 | continue; |
| 406 | 406 | } |
| 407 | 407 | |
@@ -450,11 +450,11 @@ discard block |
||
| 450 | 450 | public function addDocFolder($name, $path) |
| 451 | 451 | { |
| 452 | 452 | // Standardize the path |
| 453 | - $path = realpath($path) . '/'; |
|
| 453 | + $path = realpath($path).'/'; |
|
| 454 | 454 | |
| 455 | 455 | // realpath will return FALSE if the path doesn't exist |
| 456 | 456 | // or the script doesn't have access to it. |
| 457 | - if (! $path || $path == '/') { |
|
| 457 | + if ( ! $path || $path == '/') { |
|
| 458 | 458 | return $this; |
| 459 | 459 | } |
| 460 | 460 | |
@@ -501,7 +501,7 @@ discard block |
||
| 501 | 501 | */ |
| 502 | 502 | protected function detectCurrentFolder($current_url, $groups = []) |
| 503 | 503 | { |
| 504 | - if (! is_array($groups)) { |
|
| 504 | + if ( ! is_array($groups)) { |
|
| 505 | 505 | return null; |
| 506 | 506 | } |
| 507 | 507 | |
@@ -549,9 +549,9 @@ discard block |
||
| 549 | 549 | { |
| 550 | 550 | $folders = $this->doc_folders; |
| 551 | 551 | |
| 552 | - if (! is_null($restrictToFolder)) { |
|
| 552 | + if ( ! is_null($restrictToFolder)) { |
|
| 553 | 553 | // Make sure the folder exists |
| 554 | - if (! is_null($restrictToFolder) && ! isset($this->doc_folders[$restrictToFolder])) { |
|
| 554 | + if ( ! is_null($restrictToFolder) && ! isset($this->doc_folders[$restrictToFolder])) { |
|
| 555 | 555 | throw new \RuntimeException('You must add the docs folder that you wish to find docs from.'); |
| 556 | 556 | } |
| 557 | 557 | |
@@ -559,11 +559,11 @@ discard block |
||
| 559 | 559 | } |
| 560 | 560 | |
| 561 | 561 | foreach ($folders as $alias => $folder) { |
| 562 | - if (file_exists($folder . $path . $this->docs_ext)) { |
|
| 562 | + if (file_exists($folder.$path.$this->docs_ext)) { |
|
| 563 | 563 | // Store the alias so we know which folder we're in. |
| 564 | 564 | $this->current_folder = $alias; |
| 565 | 565 | |
| 566 | - return file_get_contents($folder . $path . $this->docs_ext); |
|
| 566 | + return file_get_contents($folder.$path.$this->docs_ext); |
|
| 567 | 567 | } |
| 568 | 568 | } |
| 569 | 569 | |
@@ -586,7 +586,7 @@ discard block |
||
| 586 | 586 | $href = $link->attributes()->href; |
| 587 | 587 | |
| 588 | 588 | // If the href is null, it's probably a named anchor with no content. |
| 589 | - if (! $href) { |
|
| 589 | + if ( ! $href) { |
|
| 590 | 590 | // Make sure it has an href, else the XML will not close this |
| 591 | 591 | // tag correctly. |
| 592 | 592 | $link['href'] = ' '; |
@@ -599,7 +599,7 @@ discard block |
||
| 599 | 599 | |
| 600 | 600 | // If the href starts with #, then attach the current_url to it |
| 601 | 601 | if ($href != '' && substr_compare($href, '#', 0, 1) === 0) { |
| 602 | - $link['href'] = $current_url . $href; |
|
| 602 | + $link['href'] = $current_url.$href; |
|
| 603 | 603 | |
| 604 | 604 | return $link; |
| 605 | 605 | } |
@@ -637,13 +637,13 @@ discard block |
||
| 637 | 637 | } |
| 638 | 638 | } |
| 639 | 639 | |
| 640 | - if (! $group_found) { |
|
| 641 | - $href = $this->current_folder . '/' . $href; |
|
| 640 | + if ( ! $group_found) { |
|
| 641 | + $href = $this->current_folder.'/'.$href; |
|
| 642 | 642 | } |
| 643 | 643 | |
| 644 | 644 | // Convert to full site_url |
| 645 | 645 | if (strpos($href, 'http') !== 0) { |
| 646 | - $href = $site_url . 'docs/' . ltrim($href, '/ '); |
|
| 646 | + $href = $site_url.'docs/'.ltrim($href, '/ '); |
|
| 647 | 647 | } |
| 648 | 648 | |
| 649 | 649 | // Save the corrected href |
@@ -678,7 +678,7 @@ discard block |
||
| 678 | 678 | // our page title. |
| 679 | 679 | if ($childType == 'h1' && empty($this->page_title)) |
| 680 | 680 | { |
| 681 | - $this->page_title = (string)$line; |
|
| 681 | + $this->page_title = (string) $line; |
|
| 682 | 682 | } |
| 683 | 683 | |
| 684 | 684 | // Make sure that our current object is |
@@ -691,39 +691,39 @@ discard block |
||
| 691 | 691 | } |
| 692 | 692 | |
| 693 | 693 | if ($childType == 'h2') { |
| 694 | - $name = (string)$line; |
|
| 695 | - $link = strtolower(str_replace(' ', '_', (string)$line)); |
|
| 694 | + $name = (string) $line; |
|
| 695 | + $link = strtolower(str_replace(' ', '_', (string) $line)); |
|
| 696 | 696 | |
| 697 | 697 | $current_obj['name'] = $name; |
| 698 | - $current_obj['link'] = '#' . $link; |
|
| 698 | + $current_obj['link'] = '#'.$link; |
|
| 699 | 699 | $current_obj['items'] = []; |
| 700 | 700 | |
| 701 | 701 | // Insert a named anchor into the $content |
| 702 | - $anchor = '<a name="' . $link . '" id="' . $link . '" ></a>'; |
|
| 702 | + $anchor = '<a name="'.$link.'" id="'.$link.'" ></a>'; |
|
| 703 | 703 | |
| 704 | 704 | $search = "<h2>{$name}</h2>"; |
| 705 | 705 | |
| 706 | - $content = str_replace($search, $anchor . $search, $content); |
|
| 706 | + $content = str_replace($search, $anchor.$search, $content); |
|
| 707 | 707 | } elseif ($childType == 'h3') { |
| 708 | 708 | // Make sure we have some place to store the items. |
| 709 | - if (! isset($current_obj['items'])) { |
|
| 709 | + if ( ! isset($current_obj['items'])) { |
|
| 710 | 710 | $current_obj['items'] = []; |
| 711 | 711 | } |
| 712 | 712 | |
| 713 | - $link = strtolower(str_replace(' ', '_', (string)$line)); |
|
| 714 | - $name = (string)$line; |
|
| 713 | + $link = strtolower(str_replace(' ', '_', (string) $line)); |
|
| 714 | + $name = (string) $line; |
|
| 715 | 715 | |
| 716 | 716 | $current_obj['items'][] = [ |
| 717 | 717 | 'name' => $name, |
| 718 | - 'link' => '#' . $link |
|
| 718 | + 'link' => '#'.$link |
|
| 719 | 719 | ]; |
| 720 | 720 | |
| 721 | 721 | // Insert a named anchor into the $content |
| 722 | - $anchor = '<a name="' . $link . '" id="' . $link . '" ></a>'; |
|
| 722 | + $anchor = '<a name="'.$link.'" id="'.$link.'" ></a>'; |
|
| 723 | 723 | |
| 724 | 724 | $search = "<h3>{$name}</h3>"; |
| 725 | 725 | |
| 726 | - $content = str_replace($search, $anchor . $search, $content); |
|
| 726 | + $content = str_replace($search, $anchor.$search, $content); |
|
| 727 | 727 | } |
| 728 | 728 | |
| 729 | 729 | // Is this the last element? Then close out our current object. |
@@ -755,7 +755,7 @@ discard block |
||
| 755 | 755 | if ($fp = @opendir($source_dir)) { |
| 756 | 756 | $filedata = array(); |
| 757 | 757 | $new_depth = $directory_depth - 1; |
| 758 | - $source_dir = rtrim($source_dir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; |
|
| 758 | + $source_dir = rtrim($source_dir, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR; |
|
| 759 | 759 | |
| 760 | 760 | while (FALSE !== ($file = readdir($fp))) { |
| 761 | 761 | // Remove '.', '..', and hidden files [optional] |
@@ -763,10 +763,10 @@ discard block |
||
| 763 | 763 | continue; |
| 764 | 764 | } |
| 765 | 765 | |
| 766 | - is_dir($source_dir . $file) && $file .= DIRECTORY_SEPARATOR; |
|
| 766 | + is_dir($source_dir.$file) && $file .= DIRECTORY_SEPARATOR; |
|
| 767 | 767 | |
| 768 | - if (($directory_depth < 1 OR $new_depth > 0) && is_dir($source_dir . $file)) { |
|
| 769 | - $filedata[$file] = directory_map($source_dir . $file, $new_depth, $hidden); |
|
| 768 | + if (($directory_depth < 1 OR $new_depth > 0) && is_dir($source_dir.$file)) { |
|
| 769 | + $filedata[$file] = directory_map($source_dir.$file, $new_depth, $hidden); |
|
| 770 | 770 | } else { |
| 771 | 771 | $filedata[] = $file; |
| 772 | 772 | } |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | * @param bool $cascade // If FALSE the formatting of a component ends here. If TRUE, will be passed to next formatter. |
| 55 | 55 | * @return $this |
| 56 | 56 | */ |
| 57 | - public function registerFormatter($callback_name='', $cascade=false); |
|
| 57 | + public function registerFormatter($callback_name = '', $cascade = false); |
|
| 58 | 58 | |
| 59 | 59 | //-------------------------------------------------------------------- |
| 60 | 60 | |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | $map = $this->flattenMap($map); |
| 148 | 148 | |
| 149 | 149 | // Make sure we have something to work with. |
| 150 | - if (! is_array($map) || (is_array($map) && ! count($map))) { |
|
| 150 | + if ( ! is_array($map) || (is_array($map) && ! count($map))) { |
|
| 151 | 151 | return []; |
| 152 | 152 | } |
| 153 | 153 | |
@@ -161,16 +161,16 @@ discard block |
||
| 161 | 161 | |
| 162 | 162 | // Is it a folder? |
| 163 | 163 | if (is_array($file) && count($file)) { |
| 164 | - $results = array_merge($results, $this->searchFolder($term, $folder . '/' . $dir, $group_name)); |
|
| 164 | + $results = array_merge($results, $this->searchFolder($term, $folder.'/'.$dir, $group_name)); |
|
| 165 | 165 | continue; |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | // Make sure it's the right file type... |
| 169 | - if (! preg_match("/({$this->allowed_file_types})/i", $file)) { |
|
| 169 | + if ( ! preg_match("/({$this->allowed_file_types})/i", $file)) { |
|
| 170 | 170 | continue; |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | - $path = is_string($dir) ? $folder . '/' . $dir . '/' . $file : $folder . '/' . $file; |
|
| 173 | + $path = is_string($dir) ? $folder.'/'.$dir.'/'.$file : $folder.'/'.$file; |
|
| 174 | 174 | $term_html = htmlentities($term); |
| 175 | 175 | |
| 176 | 176 | // Read in the file text |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | // Do we have a match in here somewhere? |
| 181 | 181 | $found = stristr($text, $term) || stristr($text, $term_html); |
| 182 | 182 | |
| 183 | - if (! $found) { |
|
| 183 | + if ( ! $found) { |
|
| 184 | 184 | continue; |
| 185 | 185 | } |
| 186 | 186 | |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | if ($file_count >= $this->max_per_file) { |
| 203 | 203 | continue; |
| 204 | 204 | } |
| 205 | - $result_url = '/docs/' . $group_name . '/' . str_replace('.md', '', $file); |
|
| 205 | + $result_url = '/docs/'.$group_name.'/'.str_replace('.md', '', $file); |
|
| 206 | 206 | |
| 207 | 207 | foreach ($this->doc_folders as $alias => $folder) { |
| 208 | 208 | $result_url = str_replace($folder, $alias, $result_url); |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | |
| 211 | 211 | $results[] = [ |
| 212 | 212 | 'title' => $this->extractTitle($excerpt, $file), |
| 213 | - 'file' => $folder . '/' . $file, |
|
| 213 | + 'file' => $folder.'/'.$file, |
|
| 214 | 214 | 'url' => $result_url, |
| 215 | 215 | 'extract' => $this->buildExtract($excerpt, $term, $match[0][0]) |
| 216 | 216 | ]; |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | */ |
| 255 | 255 | public function format($str) |
| 256 | 256 | { |
| 257 | - if (! is_array($this->formatters)) return $str; |
|
| 257 | + if ( ! is_array($this->formatters)) return $str; |
|
| 258 | 258 | |
| 259 | 259 | foreach ($this->formatters as $formatter) { |
| 260 | 260 | $method = key($formatter); |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | |
| 263 | 263 | $str = call_user_func($method, $str); |
| 264 | 264 | |
| 265 | - if (! $cascade) return $str; |
|
| 265 | + if ( ! $cascade) return $str; |
|
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | return $str; |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | */ |
| 286 | 286 | protected function flattenMap($map, $prefix = '') |
| 287 | 287 | { |
| 288 | - if (! is_array($map) || ! count($map)) { |
|
| 288 | + if ( ! is_array($map) || ! count($map)) { |
|
| 289 | 289 | return $map; |
| 290 | 290 | } |
| 291 | 291 | |
@@ -296,12 +296,12 @@ discard block |
||
| 296 | 296 | // If it's a folder name and an array of files |
| 297 | 297 | // then call this method recursively to flatten it out. |
| 298 | 298 | if (is_array($files)) { |
| 299 | - $return = array_merge($return, $this->flattenMap($files, $prefix . $folder)); |
|
| 299 | + $return = array_merge($return, $this->flattenMap($files, $prefix.$folder)); |
|
| 300 | 300 | continue; |
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | // Else, add our prefix (if any) to the filename... |
| 304 | - $return[] = $prefix . $files; |
|
| 304 | + $return[] = $prefix.$files; |
|
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | return $return; |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | $extract = $this->firstXWords($extract, $this->excerpt_length); |
| 341 | 341 | |
| 342 | 342 | // Wrap the search term in a span we can style. |
| 343 | - $extract = str_ireplace($term, '<span class="term-hilight">' . $term . '</span>', $extract); |
|
| 343 | + $extract = str_ireplace($term, '<span class="term-hilight">'.$term.'</span>', $extract); |
|
| 344 | 344 | |
| 345 | 345 | return $extract; |
| 346 | 346 | } |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | if ($fp = @opendir($source_dir)) { |
| 401 | 401 | $filedata = array(); |
| 402 | 402 | $new_depth = $directory_depth - 1; |
| 403 | - $source_dir = rtrim($source_dir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; |
|
| 403 | + $source_dir = rtrim($source_dir, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR; |
|
| 404 | 404 | |
| 405 | 405 | while (FALSE !== ($file = readdir($fp))) { |
| 406 | 406 | // Remove '.', '..', and hidden files [optional] |
@@ -408,11 +408,11 @@ discard block |
||
| 408 | 408 | continue; |
| 409 | 409 | } |
| 410 | 410 | |
| 411 | - is_dir($source_dir . $file) && $file .= DIRECTORY_SEPARATOR; |
|
| 411 | + is_dir($source_dir.$file) && $file .= DIRECTORY_SEPARATOR; |
|
| 412 | 412 | |
| 413 | - if (($directory_depth < 1 OR $new_depth > 0) && is_dir($source_dir . $file)) |
|
| 413 | + if (($directory_depth < 1 OR $new_depth > 0) && is_dir($source_dir.$file)) |
|
| 414 | 414 | { |
| 415 | - $filedata[$file] = $this->directory_map($source_dir . $file, $new_depth, $hidden); |
|
| 415 | + $filedata[$file] = $this->directory_map($source_dir.$file, $new_depth, $hidden); |
|
| 416 | 416 | } else |
| 417 | 417 | { |
| 418 | 418 | // Replace the directory separator here with a forward slash since |
@@ -66,12 +66,12 @@ discard block |
||
| 66 | 66 | * @param callable $callback |
| 67 | 67 | * @param int $priority |
| 68 | 68 | */ |
| 69 | - public static function on($event_name, callable $callback, $priority=EVENTS_PRIORITY_NORMAL) |
|
| 69 | + public static function on($event_name, callable $callback, $priority = EVENTS_PRIORITY_NORMAL) |
|
| 70 | 70 | { |
| 71 | - if (! isset(self::$listeners[$event_name])) |
|
| 71 | + if ( ! isset(self::$listeners[$event_name])) |
|
| 72 | 72 | { |
| 73 | 73 | self::$listeners[$event_name] = [ |
| 74 | - true, // If there's only 1 item, it's sorted. |
|
| 74 | + true, // If there's only 1 item, it's sorted. |
|
| 75 | 75 | [$priority], |
| 76 | 76 | [$callback] |
| 77 | 77 | ]; |
@@ -98,11 +98,11 @@ discard block |
||
| 98 | 98 | public static function trigger($event_name, array $arguments = []) |
| 99 | 99 | { |
| 100 | 100 | // Read in our config/events file so that we have them all! |
| 101 | - if (! self::$have_read_from_file) |
|
| 101 | + if ( ! self::$have_read_from_file) |
|
| 102 | 102 | { |
| 103 | - if (is_file(APPPATH .'config/events.php')) |
|
| 103 | + if (is_file(APPPATH.'config/events.php')) |
|
| 104 | 104 | { |
| 105 | - include APPPATH .'config/events.php'; |
|
| 105 | + include APPPATH.'config/events.php'; |
|
| 106 | 106 | } |
| 107 | 107 | self::$have_read_from_file = true; |
| 108 | 108 | } |
@@ -134,13 +134,13 @@ discard block |
||
| 134 | 134 | */ |
| 135 | 135 | public static function listeners($event_name) |
| 136 | 136 | { |
| 137 | - if (! isset(self::$listeners[$event_name])) |
|
| 137 | + if ( ! isset(self::$listeners[$event_name])) |
|
| 138 | 138 | { |
| 139 | 139 | return []; |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | // The list is not sorted |
| 143 | - if (! self::$listeners[$event_name][0]) |
|
| 143 | + if ( ! self::$listeners[$event_name][0]) |
|
| 144 | 144 | { |
| 145 | 145 | // Sort it! |
| 146 | 146 | array_multisort(self::$listeners[$event_name][1], SORT_NUMERIC, self::$listeners[$event_name][2]); |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | */ |
| 167 | 167 | public static function removeListener($event_name, callable $listener) |
| 168 | 168 | { |
| 169 | - if (! isset(self::$listeners[$event_name])) |
|
| 169 | + if ( ! isset(self::$listeners[$event_name])) |
|
| 170 | 170 | { |
| 171 | 171 | return false; |
| 172 | 172 | } |
@@ -195,9 +195,9 @@ discard block |
||
| 195 | 195 | * |
| 196 | 196 | * @param null $event_name |
| 197 | 197 | */ |
| 198 | - public static function removeAllListeners($event_name=null) |
|
| 198 | + public static function removeAllListeners($event_name = null) |
|
| 199 | 199 | { |
| 200 | - if (! is_null($event_name)) |
|
| 200 | + if ( ! is_null($event_name)) |
|
| 201 | 201 | { |
| 202 | 202 | unset(self::$listeners[$event_name]); |
| 203 | 203 | } |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | */ |
| 93 | 93 | public static function init() |
| 94 | 94 | { |
| 95 | - self::$ci =& get_instance(); |
|
| 95 | + self::$ci = & get_instance(); |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | //-------------------------------------------------------------------- |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | Parameters: |
| 106 | 106 | $data - The variable to log. |
| 107 | 107 | */ |
| 108 | - public static function log($data=null) |
|
| 108 | + public static function log($data = null) |
|
| 109 | 109 | { |
| 110 | 110 | if ($data !== 0 && empty($data)) |
| 111 | 111 | { |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | $object - The object to store the memory usage of. |
| 132 | 132 | $name - The name to be displayed in the console. |
| 133 | 133 | */ |
| 134 | - public static function logMemory($object=false, $name='PHP') |
|
| 134 | + public static function logMemory($object = false, $name = 'PHP') |
|
| 135 | 135 | { |
| 136 | 136 | $memory = memory_get_usage(); |
| 137 | 137 | |
@@ -182,15 +182,15 @@ discard block |
||
| 182 | 182 | // !PRIVATE METHODS |
| 183 | 183 | //-------------------------------------------------------------------- |
| 184 | 184 | |
| 185 | - protected static function addToConsole($log=null, $item=null) |
|
| 185 | + protected static function addToConsole($log = null, $item = null) |
|
| 186 | 186 | { |
| 187 | 187 | if (empty($log) || empty($item)) |
| 188 | 188 | { |
| 189 | 189 | return; |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | - self::$logs['console'][] = $item; |
|
| 193 | - self::$logs[$log] += 1; |
|
| 192 | + self::$logs['console'][] = $item; |
|
| 193 | + self::$logs[$log] += 1; |
|
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | //-------------------------------------------------------------------- |
@@ -81,20 +81,20 @@ discard block |
||
| 81 | 81 | 'view_data' |
| 82 | 82 | ); |
| 83 | 83 | |
| 84 | - protected $_sections = array(); // Stores _compile_x() results |
|
| 84 | + protected $_sections = array(); // Stores _compile_x() results |
|
| 85 | 85 | |
| 86 | - protected $_query_toggle_count = 25; |
|
| 86 | + protected $_query_toggle_count = 25; |
|
| 87 | 87 | |
| 88 | 88 | // -------------------------------------------------------------------- |
| 89 | 89 | |
| 90 | 90 | public function __construct($config = array()) |
| 91 | 91 | { |
| 92 | - $this->CI =& get_instance(); |
|
| 92 | + $this->CI = & get_instance(); |
|
| 93 | 93 | $this->CI->load->language('profiler'); |
| 94 | 94 | |
| 95 | 95 | // If the config file has a query_toggle_count, |
| 96 | 96 | // use it, but remove it from the config array. |
| 97 | - if ( isset($config['query_toggle_count']) ) |
|
| 97 | + if (isset($config['query_toggle_count'])) |
|
| 98 | 98 | { |
| 99 | 99 | $this->_query_toggle_count = (int) $config['query_toggle_count']; |
| 100 | 100 | unset($config['query_toggle_count']); |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | // Let's determine which databases are currently connected to |
| 196 | 196 | foreach (get_object_vars($this->CI) as $CI_object) |
| 197 | 197 | { |
| 198 | - if (is_object($CI_object) && is_subclass_of(get_class($CI_object), 'CI_DB') ) |
|
| 198 | + if (is_object($CI_object) && is_subclass_of(get_class($CI_object), 'CI_DB')) |
|
| 199 | 199 | { |
| 200 | 200 | $dbs[] = $CI_object; |
| 201 | 201 | } |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | |
| 230 | 230 | foreach ($highlight as $bold) |
| 231 | 231 | { |
| 232 | - $val = str_replace($bold, '<b>'. $bold .'</b>', $val); |
|
| 232 | + $val = str_replace($bold, '<b>'.$bold.'</b>', $val); |
|
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | $output[][$time] = $val; |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | { |
| 269 | 269 | if (is_array($val)) |
| 270 | 270 | { |
| 271 | - $output[$key] = "<pre>" . htmlspecialchars(stripslashes(print_r($val, true))) . "</pre>"; |
|
| 271 | + $output[$key] = "<pre>".htmlspecialchars(stripslashes(print_r($val, true)))."</pre>"; |
|
| 272 | 272 | } |
| 273 | 273 | else |
| 274 | 274 | { |
@@ -306,11 +306,11 @@ discard block |
||
| 306 | 306 | |
| 307 | 307 | if (is_array($val)) |
| 308 | 308 | { |
| 309 | - $output['$_POST['. $key .']'] = '<pre>'. htmlspecialchars(stripslashes(print_r($val, TRUE))) . '</pre>'; |
|
| 309 | + $output['$_POST['.$key.']'] = '<pre>'.htmlspecialchars(stripslashes(print_r($val, TRUE))).'</pre>'; |
|
| 310 | 310 | } |
| 311 | 311 | else |
| 312 | 312 | { |
| 313 | - $output['$_POST['. $key .']'] = htmlspecialchars(stripslashes($val)); |
|
| 313 | + $output['$_POST['.$key.']'] = htmlspecialchars(stripslashes($val)); |
|
| 314 | 314 | } |
| 315 | 315 | } |
| 316 | 316 | } |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | { |
| 367 | 367 | if (function_exists('memory_get_usage') && ($usage = memory_get_usage()) != '') |
| 368 | 368 | { |
| 369 | - $output = number_format($usage) .' bytes'; |
|
| 369 | + $output = number_format($usage).' bytes'; |
|
| 370 | 370 | } |
| 371 | 371 | else |
| 372 | 372 | { |
@@ -389,10 +389,10 @@ discard block |
||
| 389 | 389 | { |
| 390 | 390 | $output = array(); |
| 391 | 391 | |
| 392 | - foreach (array('HTTP_ACCEPT', 'HTTP_USER_AGENT', 'HTTP_CONNECTION', 'SERVER_PORT', 'SERVER_NAME', 'REMOTE_ADDR', 'SERVER_SOFTWARE', 'HTTP_ACCEPT_LANGUAGE', 'SCRIPT_NAME', 'REQUEST_METHOD',' HTTP_HOST', 'REMOTE_HOST', 'CONTENT_TYPE', 'SERVER_PROTOCOL', 'QUERY_STRING', 'HTTP_ACCEPT_ENCODING', 'HTTP_X_FORWARDED_FOR') as $header) |
|
| 392 | + foreach (array('HTTP_ACCEPT', 'HTTP_USER_AGENT', 'HTTP_CONNECTION', 'SERVER_PORT', 'SERVER_NAME', 'REMOTE_ADDR', 'SERVER_SOFTWARE', 'HTTP_ACCEPT_LANGUAGE', 'SCRIPT_NAME', 'REQUEST_METHOD', ' HTTP_HOST', 'REMOTE_HOST', 'CONTENT_TYPE', 'SERVER_PROTOCOL', 'QUERY_STRING', 'HTTP_ACCEPT_ENCODING', 'HTTP_X_FORWARDED_FOR') as $header) |
|
| 393 | 393 | { |
| 394 | 394 | $val = (isset($_SERVER[$header])) ? $_SERVER[$header] : ''; |
| 395 | - $output[$header] = $val; |
|
| 395 | + $output[$header] = $val; |
|
| 396 | 396 | } |
| 397 | 397 | |
| 398 | 398 | return $output; |