@@ -136,10 +136,10 @@ |
||
136 | 136 | $retval = array(); |
137 | 137 | foreach (sqlsrv_field_metadata($this->result_id) as $i => $field) |
138 | 138 | { |
139 | - $retval[$i] = new stdClass(); |
|
139 | + $retval[$i] = new stdClass(); |
|
140 | 140 | $retval[$i]->name = $field['Name']; |
141 | 141 | $retval[$i]->type = $field['Type']; |
142 | - $retval[$i]->max_length = $field['Size']; |
|
142 | + $retval[$i]->max_length = $field['Size']; |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | return $retval; |
@@ -51,14 +51,14 @@ |
||
51 | 51 | * |
52 | 52 | * @var string |
53 | 53 | */ |
54 | - protected $_list_databases = 'EXEC sp_helpdb'; // Can also be: EXEC sp_databases |
|
54 | + protected $_list_databases = 'EXEC sp_helpdb'; // Can also be: EXEC sp_databases |
|
55 | 55 | |
56 | 56 | /** |
57 | 57 | * OPTIMIZE TABLE statement |
58 | 58 | * |
59 | 59 | * @var string |
60 | 60 | */ |
61 | - protected $_optimize_table = 'ALTER INDEX all ON %s REORGANIZE'; |
|
61 | + protected $_optimize_table = 'ALTER INDEX all ON %s REORGANIZE'; |
|
62 | 62 | |
63 | 63 | // -------------------------------------------------------------------- |
64 | 64 |
@@ -75,10 +75,10 @@ discard block |
||
75 | 75 | 'img_id' => '', |
76 | 76 | 'pool' => '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', |
77 | 77 | 'colors' => array( |
78 | - 'background' => array(255,255,255), |
|
79 | - 'border' => array(153,102,102), |
|
80 | - 'text' => array(204,153,153), |
|
81 | - 'grid' => array(255,182,182) |
|
78 | + 'background' => array(255, 255, 255), |
|
79 | + 'border' => array(153, 102, 102), |
|
80 | + 'text' => array(204, 153, 153), |
|
81 | + 'grid' => array(255, 182, 182) |
|
82 | 82 | ) |
83 | 83 | ); |
84 | 84 | |
@@ -225,8 +225,8 @@ discard block |
||
225 | 225 | // Determine angle and position |
226 | 226 | // ----------------------------------- |
227 | 227 | $length = strlen($word); |
228 | - $angle = ($length >= 6) ? mt_rand(-($length-6), ($length-6)) : 0; |
|
229 | - $x_axis = mt_rand(6, (360/$length)-16); |
|
228 | + $angle = ($length >= 6) ? mt_rand(-($length - 6), ($length - 6)) : 0; |
|
229 | + $x_axis = mt_rand(6, (360 / $length) - 16); |
|
230 | 230 | $y_axis = ($angle >= 0) ? mt_rand($img_height, $img_width) : mt_rand(6, $img_height); |
231 | 231 | |
232 | 232 | // Create image |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | // ----------------------------------- |
255 | 255 | // Create the spiral pattern |
256 | 256 | // ----------------------------------- |
257 | - $theta = 1; |
|
257 | + $theta = 1; |
|
258 | 258 | $thetac = 7; |
259 | 259 | $radius = 16; |
260 | 260 | $circles = 20; |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | { |
297 | 297 | if ($use_font === FALSE) |
298 | 298 | { |
299 | - $y = mt_rand(0 , $img_height / 2); |
|
299 | + $y = mt_rand(0, $img_height / 2); |
|
300 | 300 | imagestring($im, $font_size, $x, $y, $word[$i], $colors['text']); |
301 | 301 | $x += ($font_size * 2); |
302 | 302 | } |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | return FALSE; |
332 | 332 | } |
333 | 333 | |
334 | - $img = '<img '.($img_id === '' ? '' : 'id="'.$img_id.'"').' src="'.$img_url.$img_filename.'" style="width: '.$img_width.'; height: '.$img_height .'; border: 0;" alt=" " />'; |
|
334 | + $img = '<img '.($img_id === '' ? '' : 'id="'.$img_id.'"').' src="'.$img_url.$img_filename.'" style="width: '.$img_width.'; height: '.$img_height.'; border: 0;" alt=" " />'; |
|
335 | 335 | ImageDestroy($im); |
336 | 336 | |
337 | 337 | return array('word' => $word, 'time' => $now, 'image' => $img, 'filename' => $img_filename); |
@@ -87,8 +87,7 @@ discard block |
||
87 | 87 | if ( ! is_array($data) && empty($$key)) |
88 | 88 | { |
89 | 89 | $$key = $val; |
90 | - } |
|
91 | - else |
|
90 | + } else |
|
92 | 91 | { |
93 | 92 | $$key = isset($data[$key]) ? $data[$key] : $val; |
94 | 93 | } |
@@ -137,8 +136,7 @@ discard block |
||
137 | 136 | { |
138 | 137 | $word .= $pool[random_int(0, $rand_max)]; |
139 | 138 | } |
140 | - } |
|
141 | - catch (Exception $e) |
|
139 | + } catch (Exception $e) |
|
142 | 140 | { |
143 | 141 | // This means fallback to the next possible |
144 | 142 | // alternative to random_int() |
@@ -215,8 +213,7 @@ discard block |
||
215 | 213 | { |
216 | 214 | $word .= $pool[mt_rand(0, $rand_max)]; |
217 | 215 | } |
218 | - } |
|
219 | - elseif ( ! is_string($word)) |
|
216 | + } elseif ( ! is_string($word)) |
|
220 | 217 | { |
221 | 218 | $word = (string) $word; |
222 | 219 | } |
@@ -284,8 +281,7 @@ discard block |
||
284 | 281 | ($font_size > 5) && $font_size = 5; |
285 | 282 | $x = mt_rand(0, $img_width / ($length / 3)); |
286 | 283 | $y = 0; |
287 | - } |
|
288 | - else |
|
284 | + } else |
|
289 | 285 | { |
290 | 286 | ($font_size > 30) && $font_size = 30; |
291 | 287 | $x = mt_rand(0, $img_width / ($length / 1.5)); |
@@ -299,8 +295,7 @@ discard block |
||
299 | 295 | $y = mt_rand(0 , $img_height / 2); |
300 | 296 | imagestring($im, $font_size, $x, $y, $word[$i], $colors['text']); |
301 | 297 | $x += ($font_size * 2); |
302 | - } |
|
303 | - else |
|
298 | + } else |
|
304 | 299 | { |
305 | 300 | $y = mt_rand($img_height / 2, $img_height - 3); |
306 | 301 | imagettftext($im, $font_size, $angle, $x, $y, $colors['text'], $font_path, $word[$i]); |
@@ -320,13 +315,11 @@ discard block |
||
320 | 315 | { |
321 | 316 | $img_filename = $now.'.jpg'; |
322 | 317 | imagejpeg($im, $img_path.$img_filename); |
323 | - } |
|
324 | - elseif (function_exists('imagepng')) |
|
318 | + } elseif (function_exists('imagepng')) |
|
325 | 319 | { |
326 | 320 | $img_filename = $now.'.png'; |
327 | 321 | imagepng($im, $img_path.$img_filename); |
328 | - } |
|
329 | - else |
|
322 | + } else |
|
330 | 323 | { |
331 | 324 | return FALSE; |
332 | 325 | } |
@@ -68,9 +68,9 @@ |
||
68 | 68 | { |
69 | 69 | if ($fp = @opendir($source_dir)) |
70 | 70 | { |
71 | - $filedata = array(); |
|
72 | - $new_depth = $directory_depth - 1; |
|
73 | - $source_dir = rtrim($source_dir, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR; |
|
71 | + $filedata = array(); |
|
72 | + $new_depth = $directory_depth - 1; |
|
73 | + $source_dir = rtrim($source_dir, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR; |
|
74 | 74 | |
75 | 75 | while (FALSE !== ($file = readdir($fp))) |
76 | 76 | { |
@@ -85,8 +85,7 @@ |
||
85 | 85 | if (($directory_depth < 1 OR $new_depth > 0) && is_dir($source_dir.$file)) |
86 | 86 | { |
87 | 87 | $filedata[$file] = directory_map($source_dir.$file, $new_depth, $hidden); |
88 | - } |
|
89 | - else |
|
88 | + } else |
|
90 | 89 | { |
91 | 90 | $filedata[] = $file; |
92 | 91 | } |
@@ -100,7 +100,7 @@ |
||
100 | 100 | } |
101 | 101 | |
102 | 102 | // Load the mime types |
103 | - $mimes =& get_mimes(); |
|
103 | + $mimes = & get_mimes(); |
|
104 | 104 | |
105 | 105 | // Only change the default MIME if we can find one |
106 | 106 | if (isset($mimes[$extension])) |
@@ -66,8 +66,7 @@ discard block |
||
66 | 66 | if ($filename === '' OR $data === '') |
67 | 67 | { |
68 | 68 | return; |
69 | - } |
|
70 | - elseif ($data === NULL) |
|
69 | + } elseif ($data === NULL) |
|
71 | 70 | { |
72 | 71 | if ( ! @is_file($filename) OR ($filesize = @filesize($filename)) === FALSE) |
73 | 72 | { |
@@ -77,8 +76,7 @@ discard block |
||
77 | 76 | $filepath = $filename; |
78 | 77 | $filename = explode('/', str_replace(DIRECTORY_SEPARATOR, '/', $filename)); |
79 | 78 | $filename = end($filename); |
80 | - } |
|
81 | - else |
|
79 | + } else |
|
82 | 80 | { |
83 | 81 | $filesize = strlen($data); |
84 | 82 | } |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | */ |
178 | 178 | function img($src = '', $index_page = FALSE, $attributes = '') |
179 | 179 | { |
180 | - if ( ! is_array($src) ) |
|
180 | + if ( ! is_array($src)) |
|
181 | 181 | { |
182 | 182 | $src = array('src' => $src); |
183 | 183 | } |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | */ |
278 | 278 | function link_tag($href = '', $rel = 'stylesheet', $type = 'text/css', $title = '', $media = '', $index_page = FALSE) |
279 | 279 | { |
280 | - $CI =& get_instance(); |
|
280 | + $CI = & get_instance(); |
|
281 | 281 | $link = '<link '; |
282 | 282 | |
283 | 283 | if (is_array($href)) |
@@ -363,10 +363,10 @@ discard block |
||
363 | 363 | $str = ''; |
364 | 364 | foreach ($name as $meta) |
365 | 365 | { |
366 | - $type = (isset($meta['type']) && $meta['type'] !== 'name') ? 'http-equiv' : 'name'; |
|
367 | - $name = isset($meta['name']) ? $meta['name'] : ''; |
|
368 | - $content = isset($meta['content']) ? $meta['content'] : ''; |
|
369 | - $newline = isset($meta['newline']) ? $meta['newline'] : "\n"; |
|
366 | + $type = (isset($meta['type']) && $meta['type'] !== 'name') ? 'http-equiv' : 'name'; |
|
367 | + $name = isset($meta['name']) ? $meta['name'] : ''; |
|
368 | + $content = isset($meta['content']) ? $meta['content'] : ''; |
|
369 | + $newline = isset($meta['newline']) ? $meta['newline'] : "\n"; |
|
370 | 370 | |
371 | 371 | $str .= '<meta '.$type.'="'.$name.'" content="'.$content.'" />'.$newline; |
372 | 372 | } |
@@ -147,8 +147,7 @@ discard block |
||
147 | 147 | if ( ! is_array($val)) |
148 | 148 | { |
149 | 149 | $out .= $val; |
150 | - } |
|
151 | - else |
|
150 | + } else |
|
152 | 151 | { |
153 | 152 | $out .= $_last_list_item."\n"._list($type, $val, '', $depth + 4).str_repeat(' ', $depth + 2); |
154 | 153 | } |
@@ -197,13 +196,11 @@ discard block |
||
197 | 196 | if ($index_page === TRUE) |
198 | 197 | { |
199 | 198 | $img .= ' src="'.get_instance()->config->site_url($v).'"'; |
200 | - } |
|
201 | - else |
|
199 | + } else |
|
202 | 200 | { |
203 | 201 | $img .= ' src="'.get_instance()->config->slash_item('base_url').$v.'"'; |
204 | 202 | } |
205 | - } |
|
206 | - else |
|
203 | + } else |
|
207 | 204 | { |
208 | 205 | $img .= ' '.$k.'="'.$v.'"'; |
209 | 206 | } |
@@ -289,29 +286,24 @@ discard block |
||
289 | 286 | if ($index_page === TRUE) |
290 | 287 | { |
291 | 288 | $link .= 'href="'.$CI->config->site_url($v).'" '; |
292 | - } |
|
293 | - else |
|
289 | + } else |
|
294 | 290 | { |
295 | 291 | $link .= 'href="'.$CI->config->slash_item('base_url').$v.'" '; |
296 | 292 | } |
297 | - } |
|
298 | - else |
|
293 | + } else |
|
299 | 294 | { |
300 | 295 | $link .= $k.'="'.$v.'" '; |
301 | 296 | } |
302 | 297 | } |
303 | - } |
|
304 | - else |
|
298 | + } else |
|
305 | 299 | { |
306 | 300 | if (preg_match('#^([a-z]+:)?//#i', $href)) |
307 | 301 | { |
308 | 302 | $link .= 'href="'.$href.'" '; |
309 | - } |
|
310 | - elseif ($index_page === TRUE) |
|
303 | + } elseif ($index_page === TRUE) |
|
311 | 304 | { |
312 | 305 | $link .= 'href="'.$CI->config->site_url($href).'" '; |
313 | - } |
|
314 | - else |
|
306 | + } else |
|
315 | 307 | { |
316 | 308 | $link .= 'href="'.$CI->config->slash_item('base_url').$href.'" '; |
317 | 309 | } |
@@ -353,8 +345,7 @@ discard block |
||
353 | 345 | if ( ! is_array($name)) |
354 | 346 | { |
355 | 347 | $name = array(array('name' => $name, 'content' => $content, 'type' => $type, 'newline' => $newline)); |
356 | - } |
|
357 | - elseif (isset($name['name'])) |
|
348 | + } elseif (isset($name['name'])) |
|
358 | 349 | { |
359 | 350 | // Turn single array into multidimensional |
360 | 351 | $name = array($name); |
@@ -133,25 +133,25 @@ |
||
133 | 133 | } |
134 | 134 | |
135 | 135 | $plural_rules = array( |
136 | - '/(quiz)$/' => '\1zes', // quizzes |
|
137 | - '/^(ox)$/' => '\1\2en', // ox |
|
138 | - '/([m|l])ouse$/' => '\1ice', // mouse, louse |
|
139 | - '/(matr|vert|ind)ix|ex$/' => '\1ices', // matrix, vertex, index |
|
140 | - '/(x|ch|ss|sh)$/' => '\1es', // search, switch, fix, box, process, address |
|
141 | - '/([^aeiouy]|qu)y$/' => '\1ies', // query, ability, agency |
|
142 | - '/(hive)$/' => '\1s', // archive, hive |
|
143 | - '/(?:([^f])fe|([lr])f)$/' => '\1\2ves', // half, safe, wife |
|
144 | - '/sis$/' => 'ses', // basis, diagnosis |
|
145 | - '/([ti])um$/' => '\1a', // datum, medium |
|
146 | - '/(p)erson$/' => '\1eople', // person, salesperson |
|
147 | - '/(m)an$/' => '\1en', // man, woman, spokesman |
|
148 | - '/(c)hild$/' => '\1hildren', // child |
|
149 | - '/(buffal|tomat)o$/' => '\1\2oes', // buffalo, tomato |
|
150 | - '/(bu|campu)s$/' => '\1\2ses', // bus, campus |
|
151 | - '/(alias|status|virus)$/' => '\1es', // alias |
|
152 | - '/(octop)us$/' => '\1i', // octopus |
|
153 | - '/(ax|cris|test)is$/' => '\1es', // axis, crisis |
|
154 | - '/s$/' => 's', // no change (compatibility) |
|
136 | + '/(quiz)$/' => '\1zes', // quizzes |
|
137 | + '/^(ox)$/' => '\1\2en', // ox |
|
138 | + '/([m|l])ouse$/' => '\1ice', // mouse, louse |
|
139 | + '/(matr|vert|ind)ix|ex$/' => '\1ices', // matrix, vertex, index |
|
140 | + '/(x|ch|ss|sh)$/' => '\1es', // search, switch, fix, box, process, address |
|
141 | + '/([^aeiouy]|qu)y$/' => '\1ies', // query, ability, agency |
|
142 | + '/(hive)$/' => '\1s', // archive, hive |
|
143 | + '/(?:([^f])fe|([lr])f)$/' => '\1\2ves', // half, safe, wife |
|
144 | + '/sis$/' => 'ses', // basis, diagnosis |
|
145 | + '/([ti])um$/' => '\1a', // datum, medium |
|
146 | + '/(p)erson$/' => '\1eople', // person, salesperson |
|
147 | + '/(m)an$/' => '\1en', // man, woman, spokesman |
|
148 | + '/(c)hild$/' => '\1hildren', // child |
|
149 | + '/(buffal|tomat)o$/' => '\1\2oes', // buffalo, tomato |
|
150 | + '/(bu|campu)s$/' => '\1\2ses', // bus, campus |
|
151 | + '/(alias|status|virus)$/' => '\1es', // alias |
|
152 | + '/(octop)us$/' => '\1i', // octopus |
|
153 | + '/(ax|cris|test)is$/' => '\1es', // axis, crisis |
|
154 | + '/s$/' => 's', // no change (compatibility) |
|
155 | 155 | '/$/' => 's', |
156 | 156 | ); |
157 | 157 |
@@ -67,23 +67,19 @@ |
||
67 | 67 | { |
68 | 68 | $num = round($num / 1099511627776, $precision); |
69 | 69 | $unit = $CI->lang->line('terabyte_abbr'); |
70 | - } |
|
71 | - elseif ($num >= 1000000000) |
|
70 | + } elseif ($num >= 1000000000) |
|
72 | 71 | { |
73 | 72 | $num = round($num / 1073741824, $precision); |
74 | 73 | $unit = $CI->lang->line('gigabyte_abbr'); |
75 | - } |
|
76 | - elseif ($num >= 1000000) |
|
74 | + } elseif ($num >= 1000000) |
|
77 | 75 | { |
78 | 76 | $num = round($num / 1048576, $precision); |
79 | 77 | $unit = $CI->lang->line('megabyte_abbr'); |
80 | - } |
|
81 | - elseif ($num >= 1000) |
|
78 | + } elseif ($num >= 1000) |
|
82 | 79 | { |
83 | 80 | $num = round($num / 1024, $precision); |
84 | 81 | $unit = $CI->lang->line('kilobyte_abbr'); |
85 | - } |
|
86 | - else |
|
82 | + } else |
|
87 | 83 | { |
88 | 84 | $unit = $CI->lang->line('bytes'); |
89 | 85 | return number_format($num).' '.$unit; |
@@ -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 |
@@ -61,7 +61,7 @@ |
||
61 | 61 | function set_realpath($path, $check_existance = FALSE) |
62 | 62 | { |
63 | 63 | // Security check to make sure the path is NOT a URL. No remote file inclusion! |
64 | - if (preg_match('#^(http:\/\/|https:\/\/|www\.|ftp)#i', $path) OR filter_var($path, FILTER_VALIDATE_IP) === $path ) |
|
64 | + if (preg_match('#^(http:\/\/|https:\/\/|www\.|ftp)#i', $path) OR filter_var($path, FILTER_VALIDATE_IP) === $path) |
|
65 | 65 | { |
66 | 66 | show_error('The path you submitted must be a local server path, not a URL'); |
67 | 67 | } |
@@ -70,8 +70,7 @@ |
||
70 | 70 | if (realpath($path) !== FALSE) |
71 | 71 | { |
72 | 72 | $path = realpath($path); |
73 | - } |
|
74 | - elseif ($check_existance && ! is_dir($path) && ! is_file($path)) |
|
73 | + } elseif ($check_existance && ! is_dir($path) && ! is_file($path)) |
|
75 | 74 | { |
76 | 75 | show_error('Not a valid path: '.$path); |
77 | 76 | } |