@@ -4,16 +4,16 @@ |
||
4 | 4 | $up = -100; |
5 | 5 | $ut = 50; |
6 | 6 | $cw = array( |
7 | - chr(0)=>278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278, |
|
8 | - chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>278,'"'=>355,'#'=>556,'$'=>556,'%'=>889,'&'=>667,'\''=>191,'('=>333,')'=>333,'*'=>389,'+'=>584, |
|
9 | - ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>278,';'=>278,'<'=>584,'='=>584,'>'=>584,'?'=>556,'@'=>1015,'A'=>667, |
|
10 | - 'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>500,'K'=>667,'L'=>556,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944, |
|
11 | - 'X'=>667,'Y'=>667,'Z'=>611,'['=>278,'\\'=>278,']'=>278,'^'=>469,'_'=>556,'`'=>333,'a'=>556,'b'=>556,'c'=>500,'d'=>556,'e'=>556,'f'=>278,'g'=>556,'h'=>556,'i'=>222,'j'=>222,'k'=>500,'l'=>222,'m'=>833, |
|
12 | - 'n'=>556,'o'=>556,'p'=>556,'q'=>556,'r'=>333,'s'=>500,'t'=>278,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>500,'{'=>334,'|'=>260,'}'=>334,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>222,chr(131)=>556, |
|
13 | - chr(132)=>333,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>222,chr(146)=>222,chr(147)=>333,chr(148)=>333,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000, |
|
14 | - chr(154)=>500,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>260,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333, |
|
15 | - chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>556,chr(182)=>537,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667, |
|
16 | - chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722, |
|
17 | - chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>500,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>556,chr(241)=>556, |
|
18 | - chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>584,chr(248)=>611,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500); |
|
7 | + chr(0)=>278, chr(1)=>278, chr(2)=>278, chr(3)=>278, chr(4)=>278, chr(5)=>278, chr(6)=>278, chr(7)=>278, chr(8)=>278, chr(9)=>278, chr(10)=>278, chr(11)=>278, chr(12)=>278, chr(13)=>278, chr(14)=>278, chr(15)=>278, chr(16)=>278, chr(17)=>278, chr(18)=>278, chr(19)=>278, chr(20)=>278, chr(21)=>278, |
|
8 | + chr(22)=>278, chr(23)=>278, chr(24)=>278, chr(25)=>278, chr(26)=>278, chr(27)=>278, chr(28)=>278, chr(29)=>278, chr(30)=>278, chr(31)=>278, ' '=>278, '!'=>278, '"'=>355, '#'=>556, '$'=>556, '%'=>889, '&'=>667, '\''=>191, '('=>333, ')'=>333, '*'=>389, '+'=>584, |
|
9 | + ','=>278, '-'=>333, '.'=>278, '/'=>278, '0'=>556, '1'=>556, '2'=>556, '3'=>556, '4'=>556, '5'=>556, '6'=>556, '7'=>556, '8'=>556, '9'=>556, ':'=>278, ';'=>278, '<'=>584, '='=>584, '>'=>584, '?'=>556, '@'=>1015, 'A'=>667, |
|
10 | + 'B'=>667, 'C'=>722, 'D'=>722, 'E'=>667, 'F'=>611, 'G'=>778, 'H'=>722, 'I'=>278, 'J'=>500, 'K'=>667, 'L'=>556, 'M'=>833, 'N'=>722, 'O'=>778, 'P'=>667, 'Q'=>778, 'R'=>722, 'S'=>667, 'T'=>611, 'U'=>722, 'V'=>667, 'W'=>944, |
|
11 | + 'X'=>667, 'Y'=>667, 'Z'=>611, '['=>278, '\\'=>278, ']'=>278, '^'=>469, '_'=>556, '`'=>333, 'a'=>556, 'b'=>556, 'c'=>500, 'd'=>556, 'e'=>556, 'f'=>278, 'g'=>556, 'h'=>556, 'i'=>222, 'j'=>222, 'k'=>500, 'l'=>222, 'm'=>833, |
|
12 | + 'n'=>556, 'o'=>556, 'p'=>556, 'q'=>556, 'r'=>333, 's'=>500, 't'=>278, 'u'=>556, 'v'=>500, 'w'=>722, 'x'=>500, 'y'=>500, 'z'=>500, '{'=>334, '|'=>260, '}'=>334, '~'=>584, chr(127)=>350, chr(128)=>556, chr(129)=>350, chr(130)=>222, chr(131)=>556, |
|
13 | + chr(132)=>333, chr(133)=>1000, chr(134)=>556, chr(135)=>556, chr(136)=>333, chr(137)=>1000, chr(138)=>667, chr(139)=>333, chr(140)=>1000, chr(141)=>350, chr(142)=>611, chr(143)=>350, chr(144)=>350, chr(145)=>222, chr(146)=>222, chr(147)=>333, chr(148)=>333, chr(149)=>350, chr(150)=>556, chr(151)=>1000, chr(152)=>333, chr(153)=>1000, |
|
14 | + chr(154)=>500, chr(155)=>333, chr(156)=>944, chr(157)=>350, chr(158)=>500, chr(159)=>667, chr(160)=>278, chr(161)=>333, chr(162)=>556, chr(163)=>556, chr(164)=>556, chr(165)=>556, chr(166)=>260, chr(167)=>556, chr(168)=>333, chr(169)=>737, chr(170)=>370, chr(171)=>556, chr(172)=>584, chr(173)=>333, chr(174)=>737, chr(175)=>333, |
|
15 | + chr(176)=>400, chr(177)=>584, chr(178)=>333, chr(179)=>333, chr(180)=>333, chr(181)=>556, chr(182)=>537, chr(183)=>278, chr(184)=>333, chr(185)=>333, chr(186)=>365, chr(187)=>556, chr(188)=>834, chr(189)=>834, chr(190)=>834, chr(191)=>611, chr(192)=>667, chr(193)=>667, chr(194)=>667, chr(195)=>667, chr(196)=>667, chr(197)=>667, |
|
16 | + chr(198)=>1000, chr(199)=>722, chr(200)=>667, chr(201)=>667, chr(202)=>667, chr(203)=>667, chr(204)=>278, chr(205)=>278, chr(206)=>278, chr(207)=>278, chr(208)=>722, chr(209)=>722, chr(210)=>778, chr(211)=>778, chr(212)=>778, chr(213)=>778, chr(214)=>778, chr(215)=>584, chr(216)=>778, chr(217)=>722, chr(218)=>722, chr(219)=>722, |
|
17 | + chr(220)=>722, chr(221)=>667, chr(222)=>667, chr(223)=>611, chr(224)=>556, chr(225)=>556, chr(226)=>556, chr(227)=>556, chr(228)=>556, chr(229)=>556, chr(230)=>889, chr(231)=>500, chr(232)=>556, chr(233)=>556, chr(234)=>556, chr(235)=>556, chr(236)=>278, chr(237)=>278, chr(238)=>278, chr(239)=>278, chr(240)=>556, chr(241)=>556, |
|
18 | + chr(242)=>556, chr(243)=>556, chr(244)=>556, chr(245)=>556, chr(246)=>556, chr(247)=>584, chr(248)=>611, chr(249)=>556, chr(250)=>556, chr(251)=>556, chr(252)=>556, chr(253)=>500, chr(254)=>556, chr(255)=>500); |
|
19 | 19 | ?> |
@@ -36,17 +36,17 @@ discard block |
||
36 | 36 | */ |
37 | 37 | class CI_Xmlrpcs extends CI_Xmlrpc |
38 | 38 | { |
39 | - var $methods = array(); //array of methods mapped to function names and signatures |
|
40 | - var $debug_msg = ''; // Debug Message |
|
41 | - var $system_methods = array(); // XML RPC Server methods |
|
39 | + var $methods = array(); //array of methods mapped to function names and signatures |
|
40 | + var $debug_msg = ''; // Debug Message |
|
41 | + var $system_methods = array(); // XML RPC Server methods |
|
42 | 42 | var $controller_obj; |
43 | 43 | |
44 | - var $object = FALSE; |
|
44 | + var $object = FALSE; |
|
45 | 45 | |
46 | 46 | /** |
47 | 47 | * Constructor |
48 | 48 | */ |
49 | - public function __construct($config=array()) |
|
49 | + public function __construct($config = array()) |
|
50 | 50 | { |
51 | 51 | parent::__construct(); |
52 | 52 | $this->set_system_methods(); |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * @param mixed |
69 | 69 | * @return void |
70 | 70 | */ |
71 | - function initialize($config=array()) |
|
71 | + function initialize($config = array()) |
|
72 | 72 | { |
73 | 73 | if (isset($config['functions']) && is_array($config['functions'])) |
74 | 74 | { |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | * @param string data |
172 | 172 | * @return object xmlrpc response |
173 | 173 | */ |
174 | - function parseRequest($data='') |
|
174 | + function parseRequest($data = '') |
|
175 | 175 | { |
176 | 176 | global $HTTP_RAW_POST_DATA; |
177 | 177 | |
@@ -191,11 +191,11 @@ discard block |
||
191 | 191 | $parser = xml_parser_create($this->xmlrpc_defencoding); |
192 | 192 | $parser_object = new XML_RPC_Message("filler"); |
193 | 193 | |
194 | - $parser_object->xh[$parser] = array(); |
|
195 | - $parser_object->xh[$parser]['isf'] = 0; |
|
194 | + $parser_object->xh[$parser] = array(); |
|
195 | + $parser_object->xh[$parser]['isf'] = 0; |
|
196 | 196 | $parser_object->xh[$parser]['isf_reason'] = ''; |
197 | 197 | $parser_object->xh[$parser]['params'] = array(); |
198 | - $parser_object->xh[$parser]['stack'] = array(); |
|
198 | + $parser_object->xh[$parser]['stack'] = array(); |
|
199 | 199 | $parser_object->xh[$parser]['valuestack'] = array(); |
200 | 200 | $parser_object->xh[$parser]['method'] = ''; |
201 | 201 | |
@@ -229,13 +229,13 @@ discard block |
||
229 | 229 | xml_parser_free($parser); |
230 | 230 | |
231 | 231 | $m = new XML_RPC_Message($parser_object->xh[$parser]['method']); |
232 | - $plist=''; |
|
232 | + $plist = ''; |
|
233 | 233 | |
234 | - for ($i=0; $i < count($parser_object->xh[$parser]['params']); $i++) |
|
234 | + for ($i = 0; $i < count($parser_object->xh[$parser]['params']); $i++) |
|
235 | 235 | { |
236 | 236 | if ($this->debug === TRUE) |
237 | 237 | { |
238 | - $plist .= "$i - " . print_r(get_object_vars($parser_object->xh[$parser]['params'][$i]), TRUE). ";\n"; |
|
238 | + $plist .= "$i - ".print_r(get_object_vars($parser_object->xh[$parser]['params'][$i]), TRUE).";\n"; |
|
239 | 239 | } |
240 | 240 | |
241 | 241 | $m->addParam($parser_object->xh[$parser]['params'][$i]); |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | if ($this->debug === TRUE) |
245 | 245 | { |
246 | 246 | echo "<pre>"; |
247 | - echo "---PLIST---\n" . $plist . "\n---PLIST END---\n\n"; |
|
247 | + echo "---PLIST---\n".$plist."\n---PLIST END---\n\n"; |
|
248 | 248 | echo "</pre>"; |
249 | 249 | } |
250 | 250 | |
@@ -302,14 +302,14 @@ discard block |
||
302 | 302 | |
303 | 303 | if ($system_call === TRUE) |
304 | 304 | { |
305 | - if ( ! is_callable(array($this,$method_parts['1']))) |
|
305 | + if ( ! is_callable(array($this, $method_parts['1']))) |
|
306 | 306 | { |
307 | 307 | return new XML_RPC_Response(0, $this->xmlrpcerr['unknown_method'], $this->xmlrpcstr['unknown_method']); |
308 | 308 | } |
309 | 309 | } |
310 | 310 | else |
311 | 311 | { |
312 | - if ($objectCall && ! is_callable(array($method_parts['0'],$method_parts['1']))) |
|
312 | + if ($objectCall && ! is_callable(array($method_parts['0'], $method_parts['1']))) |
|
313 | 313 | { |
314 | 314 | return new XML_RPC_Response(0, $this->xmlrpcerr['unknown_method'], $this->xmlrpcstr['unknown_method']); |
315 | 315 | } |
@@ -326,25 +326,25 @@ discard block |
||
326 | 326 | if (isset($this->methods[$methName]['signature'])) |
327 | 327 | { |
328 | 328 | $sig = $this->methods[$methName]['signature']; |
329 | - for ($i=0; $i<count($sig); $i++) |
|
329 | + for ($i = 0; $i < count($sig); $i++) |
|
330 | 330 | { |
331 | 331 | $current_sig = $sig[$i]; |
332 | 332 | |
333 | - if (count($current_sig) == count($m->params)+1) |
|
333 | + if (count($current_sig) == count($m->params) + 1) |
|
334 | 334 | { |
335 | - for ($n=0; $n < count($m->params); $n++) |
|
335 | + for ($n = 0; $n < count($m->params); $n++) |
|
336 | 336 | { |
337 | 337 | $p = $m->params[$n]; |
338 | 338 | $pt = ($p->kindOf() == 'scalar') ? $p->scalarval() : $p->kindOf(); |
339 | 339 | |
340 | - if ($pt != $current_sig[$n+1]) |
|
340 | + if ($pt != $current_sig[$n + 1]) |
|
341 | 341 | { |
342 | - $pno = $n+1; |
|
343 | - $wanted = $current_sig[$n+1]; |
|
342 | + $pno = $n + 1; |
|
343 | + $wanted = $current_sig[$n + 1]; |
|
344 | 344 | |
345 | 345 | return new XML_RPC_Response(0, |
346 | 346 | $this->xmlrpcerr['incorrect_params'], |
347 | - $this->xmlrpcstr['incorrect_params'] . |
|
347 | + $this->xmlrpcstr['incorrect_params']. |
|
348 | 348 | ": Wanted {$wanted}, got {$pt} at param {$pno})"); |
349 | 349 | } |
350 | 350 | } |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | { |
367 | 367 | if ($this->object === FALSE) |
368 | 368 | { |
369 | - $CI =& get_instance(); |
|
369 | + $CI = & get_instance(); |
|
370 | 370 | return $CI->$method_parts['1']($m); |
371 | 371 | } |
372 | 372 | else |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | |
404 | 404 | foreach ($this->system_methods as $key => $value) |
405 | 405 | { |
406 | - $output[]= new XML_RPC_Values($key, 'string'); |
|
406 | + $output[] = new XML_RPC_Values($key, 'string'); |
|
407 | 407 | } |
408 | 408 | |
409 | 409 | $v->addArray($output); |
@@ -431,15 +431,15 @@ discard block |
||
431 | 431 | $sigs = array(); |
432 | 432 | $signature = $this->methods[$method_name]['signature']; |
433 | 433 | |
434 | - for ($i=0; $i < count($signature); $i++) |
|
434 | + for ($i = 0; $i < count($signature); $i++) |
|
435 | 435 | { |
436 | 436 | $cursig = array(); |
437 | 437 | $inSig = $signature[$i]; |
438 | - for ($j=0; $j<count($inSig); $j++) |
|
438 | + for ($j = 0; $j < count($inSig); $j++) |
|
439 | 439 | { |
440 | - $cursig[]= new XML_RPC_Values($inSig[$j], 'string'); |
|
440 | + $cursig[] = new XML_RPC_Values($inSig[$j], 'string'); |
|
441 | 441 | } |
442 | - $sigs[]= new XML_RPC_Values($cursig, 'array'); |
|
442 | + $sigs[] = new XML_RPC_Values($cursig, 'array'); |
|
443 | 443 | } |
444 | 444 | $r = new XML_RPC_Response(new XML_RPC_Values($sigs, 'array')); |
445 | 445 | } |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | } |
451 | 451 | else |
452 | 452 | { |
453 | - $r = new XML_RPC_Response(0,$this->xmlrpcerr['introspect_unknown'], $this->xmlrpcstr['introspect_unknown']); |
|
453 | + $r = new XML_RPC_Response(0, $this->xmlrpcerr['introspect_unknown'], $this->xmlrpcstr['introspect_unknown']); |
|
454 | 454 | } |
455 | 455 | return $r; |
456 | 456 | } |
@@ -505,9 +505,9 @@ discard block |
||
505 | 505 | //$attempt = $this->_execute(new XML_RPC_Message($value[0], $value[1])); |
506 | 506 | |
507 | 507 | $m = new XML_RPC_Message($value[0]); |
508 | - $plist=''; |
|
508 | + $plist = ''; |
|
509 | 509 | |
510 | - for ($i=0; $i < count($value[1]); $i++) |
|
510 | + for ($i = 0; $i < count($value[1]); $i++) |
|
511 | 511 | { |
512 | 512 | $m->addParam(new XML_RPC_Values($value[1][$i], 'string')); |
513 | 513 | } |
@@ -565,7 +565,7 @@ discard block |
||
565 | 565 | return $this->multicall_error('nomethod'); |
566 | 566 | } |
567 | 567 | |
568 | - list($scalar_type,$scalar_value)=each($methName->me); |
|
568 | + list($scalar_type, $scalar_value) = each($methName->me); |
|
569 | 569 | $scalar_type = $scalar_type == $this->xmlrpcI4 ? $this->xmlrpcInt : $scalar_type; |
570 | 570 | |
571 | 571 | if ($methName->kindOf() != 'scalar' OR $scalar_type != 'string') |
@@ -585,7 +585,7 @@ discard block |
||
585 | 585 | return $this->multicall_error('notarray'); |
586 | 586 | } |
587 | 587 | |
588 | - list($a,$b)=each($params->me); |
|
588 | + list($a, $b) = each($params->me); |
|
589 | 589 | $numParams = count($b); |
590 | 590 | |
591 | 591 | $msg = new XML_RPC_Message($scalar_value); |
@@ -42,12 +42,12 @@ discard block |
||
42 | 42 | |
43 | 43 | extract($defaults); |
44 | 44 | |
45 | - $this->CI =& get_instance(); |
|
45 | + $this->CI = & get_instance(); |
|
46 | 46 | |
47 | 47 | // load the requested js library |
48 | 48 | $this->CI->load->library('javascript/'.$js_library_driver, array('autoload' => $autoload)); |
49 | 49 | // make js to refer to current library |
50 | - $this->js =& $this->CI->$js_library_driver; |
|
50 | + $this->js = & $this->CI->$js_library_driver; |
|
51 | 51 | |
52 | 52 | log_message('debug', "Javascript Class Initialized and loaded. Driver used: $js_library_driver"); |
53 | 53 | } |
@@ -570,7 +570,7 @@ discard block |
||
570 | 570 | * @param string - element |
571 | 571 | * @return string |
572 | 572 | */ |
573 | - function toggleClass($element = 'this', $class='') |
|
573 | + function toggleClass($element = 'this', $class = '') |
|
574 | 574 | { |
575 | 575 | return $this->js->_toggleClass($element, $class); |
576 | 576 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | |
31 | 31 | var $CI; |
32 | 32 | var $encryption_key = ''; |
33 | - var $_hash_type = 'sha1'; |
|
33 | + var $_hash_type = 'sha1'; |
|
34 | 34 | var $_mcrypt_exists = FALSE; |
35 | 35 | var $_mcrypt_cipher; |
36 | 36 | var $_mcrypt_mode; |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function __construct() |
45 | 45 | { |
46 | - $this->CI =& get_instance(); |
|
46 | + $this->CI = & get_instance(); |
|
47 | 47 | $this->_mcrypt_exists = ( ! function_exists('mcrypt_encrypt')) ? FALSE : TRUE; |
48 | 48 | log_message('debug', "Encrypt Class Initialized"); |
49 | 49 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | return $this->encryption_key; |
70 | 70 | } |
71 | 71 | |
72 | - $CI =& get_instance(); |
|
72 | + $CI = & get_instance(); |
|
73 | 73 | $key = $CI->config->item('encryption_key'); |
74 | 74 | |
75 | 75 | if ($key == FALSE) |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | return 0; |
382 | 382 | } |
383 | 383 | |
384 | - $query = $this->query($this->_count_string . $this->_protect_identifiers('numrows') . " FROM " . $this->_protect_identifiers($table, TRUE, NULL, FALSE)); |
|
384 | + $query = $this->query($this->_count_string.$this->_protect_identifiers('numrows')." FROM ".$this->_protect_identifiers($table, TRUE, NULL, FALSE)); |
|
385 | 385 | |
386 | 386 | if ($query->num_rows() == 0) |
387 | 387 | { |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | |
391 | 391 | $row = $query->row(); |
392 | 392 | $this->_reset_select(); |
393 | - return (int) $row->numrows; |
|
393 | + return (int)$row->numrows; |
|
394 | 394 | } |
395 | 395 | |
396 | 396 | // -------------------------------------------------------------------- |
@@ -496,7 +496,7 @@ discard block |
||
496 | 496 | { |
497 | 497 | if (strpos($item, '.'.$id) !== FALSE) |
498 | 498 | { |
499 | - $str = $this->_escape_char. str_replace('.', $this->_escape_char.'.', $item); |
|
499 | + $str = $this->_escape_char.str_replace('.', $this->_escape_char.'.', $item); |
|
500 | 500 | |
501 | 501 | // remove duplicates if the user already included the escape |
502 | 502 | return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); |
@@ -613,16 +613,16 @@ discard block |
||
613 | 613 | { |
614 | 614 | foreach ($values as $key => $val) |
615 | 615 | { |
616 | - $valstr[] = $key . ' = ' . $val; |
|
616 | + $valstr[] = $key.' = '.$val; |
|
617 | 617 | } |
618 | 618 | |
619 | 619 | $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; |
620 | 620 | |
621 | - $orderby = (count($orderby) >= 1)?' ORDER BY '.implode(", ", $orderby):''; |
|
621 | + $orderby = (count($orderby) >= 1) ? ' ORDER BY '.implode(", ", $orderby) : ''; |
|
622 | 622 | |
623 | 623 | $sql = "UPDATE ".$table." SET ".implode(', ', $valstr); |
624 | 624 | |
625 | - $sql .= ($where != '' AND count($where) >=1) ? " WHERE ".implode(" ", $where) : ''; |
|
625 | + $sql .= ($where != '' AND count($where) >= 1) ? " WHERE ".implode(" ", $where) : ''; |
|
626 | 626 | |
627 | 627 | $sql .= $orderby.$limit; |
628 | 628 | |
@@ -646,7 +646,7 @@ discard block |
||
646 | 646 | function _update_batch($table, $values, $index, $where = NULL) |
647 | 647 | { |
648 | 648 | $ids = array(); |
649 | - $where = ($where != '' AND count($where) >=1) ? implode(" ", $where).' AND ' : ''; |
|
649 | + $where = ($where != '' AND count($where) >= 1) ? implode(" ", $where).' AND ' : ''; |
|
650 | 650 | |
651 | 651 | foreach ($values as $key => $val) |
652 | 652 | { |
@@ -656,7 +656,7 @@ discard block |
||
656 | 656 | { |
657 | 657 | if ($field != $index) |
658 | 658 | { |
659 | - $final[$field][] = 'WHEN '.$index.' = '.$val[$index].' THEN '.$val[$field]; |
|
659 | + $final[$field][] = 'WHEN '.$index.' = '.$val[$index].' THEN '.$val[$field]; |
|
660 | 660 | } |
661 | 661 | } |
662 | 662 | } |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | } |
159 | 159 | |
160 | 160 | // Trim off the end comma |
161 | - $field_str = preg_replace( "/, $/" , "" , $field_str); |
|
161 | + $field_str = preg_replace("/, $/", "", $field_str); |
|
162 | 162 | |
163 | 163 | |
164 | 164 | // Build the insert string |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | } |
194 | 194 | |
195 | 195 | // Remove the comma at the end of the string |
196 | - $val_str = preg_replace( "/, $/" , "" , $val_str); |
|
196 | + $val_str = preg_replace("/, $/", "", $val_str); |
|
197 | 197 | |
198 | 198 | // Build the INSERT string |
199 | 199 | $output .= 'INSERT INTO '.$table.' ('.$field_str.') VALUES ('.$val_str.');'.$newline; |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $this->_like_escape_chr = ''; |
60 | 60 | |
61 | 61 | //Prior to this version, the charset can't be set in the dsn |
62 | - if(is_php('5.3.6')) |
|
62 | + if (is_php('5.3.6')) |
|
63 | 63 | { |
64 | 64 | $this->hostname .= ";charset={$this->char_set}"; |
65 | 65 | } |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | // Reset the transaction failure flag. |
244 | 244 | // If the $test_mode flag is set to TRUE transactions will be rolled back |
245 | 245 | // even if the queries produce a successful result. |
246 | - $this->_trans_failure = (bool) ($test_mode === TRUE); |
|
246 | + $this->_trans_failure = (bool)($test_mode === TRUE); |
|
247 | 247 | |
248 | 248 | return $this->conn_id->beginTransaction(); |
249 | 249 | } |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | // escape LIKE condition wildcards |
333 | 333 | if ($like === TRUE) |
334 | 334 | { |
335 | - $str = str_replace( array('%', '_', $this->_like_escape_chr), |
|
335 | + $str = str_replace(array('%', '_', $this->_like_escape_chr), |
|
336 | 336 | array($this->_like_escape_chr.'%', $this->_like_escape_chr.'_', $this->_like_escape_chr.$this->_like_escape_chr), |
337 | 337 | $str); |
338 | 338 | } |
@@ -361,18 +361,18 @@ discard block |
||
361 | 361 | * @access public |
362 | 362 | * @return integer |
363 | 363 | */ |
364 | - function insert_id($name=NULL) |
|
364 | + function insert_id($name = NULL) |
|
365 | 365 | { |
366 | 366 | //Convenience method for postgres insertid |
367 | 367 | if (strpos($this->hostname, 'pgsql') !== FALSE) |
368 | 368 | { |
369 | 369 | $v = $this->_version(); |
370 | 370 | |
371 | - $table = func_num_args() > 0 ? func_get_arg(0) : NULL; |
|
371 | + $table = func_num_args() > 0 ? func_get_arg(0) : NULL; |
|
372 | 372 | |
373 | 373 | if ($table == NULL && $v >= '8.1') |
374 | 374 | { |
375 | - $sql='SELECT LASTVAL() as ins_id'; |
|
375 | + $sql = 'SELECT LASTVAL() as ins_id'; |
|
376 | 376 | } |
377 | 377 | $query = $this->query($sql); |
378 | 378 | $row = $query->row(); |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | return 0; |
404 | 404 | } |
405 | 405 | |
406 | - $query = $this->query($this->_count_string . $this->_protect_identifiers('numrows') . " FROM " . $this->_protect_identifiers($table, TRUE, NULL, FALSE)); |
|
406 | + $query = $this->query($this->_count_string.$this->_protect_identifiers('numrows')." FROM ".$this->_protect_identifiers($table, TRUE, NULL, FALSE)); |
|
407 | 407 | |
408 | 408 | if ($query->num_rows() == 0) |
409 | 409 | { |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | |
413 | 413 | $row = $query->row(); |
414 | 414 | $this->_reset_select(); |
415 | - return (int) $row->numrows; |
|
415 | + return (int)$row->numrows; |
|
416 | 416 | } |
417 | 417 | |
418 | 418 | // -------------------------------------------------------------------- |
@@ -520,7 +520,7 @@ discard block |
||
520 | 520 | { |
521 | 521 | if (strpos($item, '.'.$id) !== FALSE) |
522 | 522 | { |
523 | - $str = $this->_escape_char. str_replace('.', $this->_escape_char.'.', $item); |
|
523 | + $str = $this->_escape_char.str_replace('.', $this->_escape_char.'.', $item); |
|
524 | 524 | |
525 | 525 | // remove duplicates if the user already included the escape |
526 | 526 | return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); |
@@ -623,11 +623,11 @@ discard block |
||
623 | 623 | |
624 | 624 | $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; |
625 | 625 | |
626 | - $orderby = (count($orderby) >= 1)?' ORDER BY '.implode(", ", $orderby):''; |
|
626 | + $orderby = (count($orderby) >= 1) ? ' ORDER BY '.implode(", ", $orderby) : ''; |
|
627 | 627 | |
628 | 628 | $sql = "UPDATE ".$table." SET ".implode(', ', $valstr); |
629 | 629 | |
630 | - $sql .= ($where != '' AND count($where) >=1) ? " WHERE ".implode(" ", $where) : ''; |
|
630 | + $sql .= ($where != '' AND count($where) >= 1) ? " WHERE ".implode(" ", $where) : ''; |
|
631 | 631 | |
632 | 632 | $sql .= $orderby.$limit; |
633 | 633 | |
@@ -650,7 +650,7 @@ discard block |
||
650 | 650 | function _update_batch($table, $values, $index, $where = NULL) |
651 | 651 | { |
652 | 652 | $ids = array(); |
653 | - $where = ($where != '' AND count($where) >=1) ? implode(" ", $where).' AND ' : ''; |
|
653 | + $where = ($where != '' AND count($where) >= 1) ? implode(" ", $where).' AND ' : ''; |
|
654 | 654 | |
655 | 655 | foreach ($values as $key => $val) |
656 | 656 | { |
@@ -660,7 +660,7 @@ discard block |
||
660 | 660 | { |
661 | 661 | if ($field != $index) |
662 | 662 | { |
663 | - $final[$field][] = 'WHEN '.$index.' = '.$val[$index].' THEN '.$val[$field]; |
|
663 | + $final[$field][] = 'WHEN '.$index.' = '.$val[$index].' THEN '.$val[$field]; |
|
664 | 664 | } |
665 | 665 | } |
666 | 666 | } |
@@ -85,7 +85,7 @@ |
||
85 | 85 | |
86 | 86 | try |
87 | 87 | { |
88 | - for($i = 0; $i < $this->num_fields(); $i++) |
|
88 | + for ($i = 0; $i < $this->num_fields(); $i++) |
|
89 | 89 | { |
90 | 90 | $data[] = $this->result_id->getColumnMeta($i); |
91 | 91 | } |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | { |
82 | 82 | $attributes = array_change_key_case($attributes, CASE_UPPER); |
83 | 83 | |
84 | - $sql .= "\n\t\"" . $this->db->_protect_identifiers($field) . "\""; |
|
84 | + $sql .= "\n\t\"".$this->db->_protect_identifiers($field)."\""; |
|
85 | 85 | |
86 | 86 | if (array_key_exists('NAME', $attributes)) |
87 | 87 | { |
@@ -185,11 +185,11 @@ discard block |
||
185 | 185 | // If there is a PK defined |
186 | 186 | if (count($primary_keys) > 0) |
187 | 187 | { |
188 | - $key_name = "pk_" . $table . "_" . |
|
188 | + $key_name = "pk_".$table."_". |
|
189 | 189 | $this->db->_protect_identifiers(implode('_', $primary_keys)); |
190 | 190 | |
191 | 191 | $primary_keys = $this->db->_protect_identifiers($primary_keys); |
192 | - $sql .= ",\n\tCONSTRAINT " . $key_name . " PRIMARY KEY(" . implode(', ', $primary_keys) . ")"; |
|
192 | + $sql .= ",\n\tCONSTRAINT ".$key_name." PRIMARY KEY(".implode(', ', $primary_keys).")"; |
|
193 | 193 | } |
194 | 194 | |
195 | 195 | if (is_array($keys) && count($keys) > 0) |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | $key = array($key_name); |
208 | 208 | } |
209 | 209 | |
210 | - $sql .= ",\n\tKEY \"{$key_name}\" (" . implode(', ', $key) . ")"; |
|
210 | + $sql .= ",\n\tKEY \"{$key_name}\" (".implode(', ', $key).")"; |
|
211 | 211 | } |
212 | 212 | } |
213 | 213 | |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | |
259 | 259 | if ($after_field != '') |
260 | 260 | { |
261 | - $sql .= ' AFTER ' . $this->db->_protect_identifiers($after_field); |
|
261 | + $sql .= ' AFTER '.$this->db->_protect_identifiers($after_field); |
|
262 | 262 | } |
263 | 263 | |
264 | 264 | return $sql; |