@@ -48,7 +48,7 @@ |
||
| 48 | 48 | function __get($key) |
| 49 | 49 | { |
| 50 | 50 | // echo $key; |
| 51 | - $CI =& get_instance(); |
|
| 51 | + $CI = & get_instance(); |
|
| 52 | 52 | return $CI->$key; |
| 53 | 53 | } |
| 54 | 54 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | * @var array |
| 35 | 35 | * @access public |
| 36 | 36 | */ |
| 37 | - var $keyval = array(); |
|
| 37 | + var $keyval = array(); |
|
| 38 | 38 | /** |
| 39 | 39 | * Current uri string |
| 40 | 40 | * |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | * @var array |
| 49 | 49 | * @access public |
| 50 | 50 | */ |
| 51 | - var $segments = array(); |
|
| 51 | + var $segments = array(); |
|
| 52 | 52 | /** |
| 53 | 53 | * Re-indexed list of uri segments |
| 54 | 54 | * Starts at 1 instead of 0 |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | * @var array |
| 57 | 57 | * @access public |
| 58 | 58 | */ |
| 59 | - var $rsegments = array(); |
|
| 59 | + var $rsegments = array(); |
|
| 60 | 60 | |
| 61 | 61 | /** |
| 62 | 62 | * Constructor |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | function __construct() |
| 71 | 71 | { |
| 72 | - $this->config =& load_class('Config', 'core'); |
|
| 72 | + $this->config = & load_class('Config', 'core'); |
|
| 73 | 73 | log_message('debug', "URI Class Initialized"); |
| 74 | 74 | } |
| 75 | 75 | |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | // No PATH_INFO?... What about QUERY_STRING? |
| 113 | - $path = (isset($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : @getenv('QUERY_STRING'); |
|
| 113 | + $path = (isset($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : @getenv('QUERY_STRING'); |
|
| 114 | 114 | if (trim($path, '/') != '') |
| 115 | 115 | { |
| 116 | 116 | $this->_set_uri_string($path); |
@@ -161,9 +161,9 @@ discard block |
||
| 161 | 161 | $str = remove_invisible_characters($str, FALSE); |
| 162 | 162 | //================ITPL======================= |
| 163 | 163 | $pos = strpos($str, "_json"); |
| 164 | - if($pos > 0 && !isset($_SERVER['HTTP_X_REQUESTED_WITH'])){ |
|
| 164 | + if ($pos > 0 && ! isset($_SERVER['HTTP_X_REQUESTED_WITH'])) { |
|
| 165 | 165 | $this->uri_string = str_replace('_json', '', trim($str, '/')); |
| 166 | - }else{ |
|
| 166 | + } else { |
|
| 167 | 167 | // If the URI contains only a slash we'll kill it |
| 168 | 168 | $this->uri_string = ($str == '/') ? '' : $str; |
| 169 | 169 | } |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | { |
| 243 | 243 | $args = array_slice($_SERVER['argv'], 1); |
| 244 | 244 | |
| 245 | - return $args ? '/' . implode('/', $args) : ''; |
|
| 245 | + return $args ? '/'.implode('/', $args) : ''; |
|
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | // -------------------------------------------------------------------- |
@@ -267,8 +267,8 @@ discard block |
||
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | // Convert programatic characters to entities |
| 270 | - $bad = array('$', '(', ')', '%28', '%29'); |
|
| 271 | - $good = array('$', '(', ')', '(', ')'); |
|
| 270 | + $bad = array('$', '(', ')', '%28', '%29'); |
|
| 271 | + $good = array('$', '(', ')', '(', ')'); |
|
| 272 | 272 | |
| 273 | 273 | return str_replace($bad, $good, $str); |
| 274 | 274 | } |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | */ |
| 284 | 284 | function _remove_url_suffix() |
| 285 | 285 | { |
| 286 | - if ($this->config->item('url_suffix') != "") |
|
| 286 | + if ($this->config->item('url_suffix') != "") |
|
| 287 | 287 | { |
| 288 | 288 | $this->uri_string = preg_replace("|".preg_quote($this->config->item('url_suffix'))."$|", "", $this->uri_string); |
| 289 | 289 | } |
@@ -559,16 +559,16 @@ discard block |
||
| 559 | 559 | */ |
| 560 | 560 | function _slash_segment($n, $where = 'trailing', $which = 'segment') |
| 561 | 561 | { |
| 562 | - $leading = '/'; |
|
| 563 | - $trailing = '/'; |
|
| 562 | + $leading = '/'; |
|
| 563 | + $trailing = '/'; |
|
| 564 | 564 | |
| 565 | 565 | if ($where == 'trailing') |
| 566 | 566 | { |
| 567 | - $leading = ''; |
|
| 567 | + $leading = ''; |
|
| 568 | 568 | } |
| 569 | 569 | elseif ($where == 'leading') |
| 570 | 570 | { |
| 571 | - $trailing = ''; |
|
| 571 | + $trailing = ''; |
|
| 572 | 572 | } |
| 573 | 573 | |
| 574 | 574 | return $leading.$this->$which($n).$trailing; |
@@ -42,28 +42,28 @@ discard block |
||
| 42 | 42 | * @var array |
| 43 | 43 | * @access protected |
| 44 | 44 | */ |
| 45 | - protected $_ci_view_paths = array(); |
|
| 45 | + protected $_ci_view_paths = array(); |
|
| 46 | 46 | /** |
| 47 | 47 | * List of paths to load libraries from |
| 48 | 48 | * |
| 49 | 49 | * @var array |
| 50 | 50 | * @access protected |
| 51 | 51 | */ |
| 52 | - protected $_ci_library_paths = array(); |
|
| 52 | + protected $_ci_library_paths = array(); |
|
| 53 | 53 | /** |
| 54 | 54 | * List of paths to load models from |
| 55 | 55 | * |
| 56 | 56 | * @var array |
| 57 | 57 | * @access protected |
| 58 | 58 | */ |
| 59 | - protected $_ci_model_paths = array(); |
|
| 59 | + protected $_ci_model_paths = array(); |
|
| 60 | 60 | /** |
| 61 | 61 | * List of paths to load helpers from |
| 62 | 62 | * |
| 63 | 63 | * @var array |
| 64 | 64 | * @access protected |
| 65 | 65 | */ |
| 66 | - protected $_ci_helper_paths = array(); |
|
| 66 | + protected $_ci_helper_paths = array(); |
|
| 67 | 67 | /** |
| 68 | 68 | * List of loaded base classes |
| 69 | 69 | * Set by the controller class |
@@ -71,49 +71,49 @@ discard block |
||
| 71 | 71 | * @var array |
| 72 | 72 | * @access protected |
| 73 | 73 | */ |
| 74 | - protected $_base_classes = array(); // Set by the controller class |
|
| 74 | + protected $_base_classes = array(); // Set by the controller class |
|
| 75 | 75 | /** |
| 76 | 76 | * List of cached variables |
| 77 | 77 | * |
| 78 | 78 | * @var array |
| 79 | 79 | * @access protected |
| 80 | 80 | */ |
| 81 | - protected $_ci_cached_vars = array(); |
|
| 81 | + protected $_ci_cached_vars = array(); |
|
| 82 | 82 | /** |
| 83 | 83 | * List of loaded classes |
| 84 | 84 | * |
| 85 | 85 | * @var array |
| 86 | 86 | * @access protected |
| 87 | 87 | */ |
| 88 | - protected $_ci_classes = array(); |
|
| 88 | + protected $_ci_classes = array(); |
|
| 89 | 89 | /** |
| 90 | 90 | * List of loaded files |
| 91 | 91 | * |
| 92 | 92 | * @var array |
| 93 | 93 | * @access protected |
| 94 | 94 | */ |
| 95 | - protected $_ci_loaded_files = array(); |
|
| 95 | + protected $_ci_loaded_files = array(); |
|
| 96 | 96 | /** |
| 97 | 97 | * List of loaded models |
| 98 | 98 | * |
| 99 | 99 | * @var array |
| 100 | 100 | * @access protected |
| 101 | 101 | */ |
| 102 | - protected $_ci_models = array(); |
|
| 102 | + protected $_ci_models = array(); |
|
| 103 | 103 | /** |
| 104 | 104 | * List of loaded helpers |
| 105 | 105 | * |
| 106 | 106 | * @var array |
| 107 | 107 | * @access protected |
| 108 | 108 | */ |
| 109 | - protected $_ci_helpers = array(); |
|
| 109 | + protected $_ci_helpers = array(); |
|
| 110 | 110 | /** |
| 111 | 111 | * List of class name mappings |
| 112 | 112 | * |
| 113 | 113 | * @var array |
| 114 | 114 | * @access protected |
| 115 | 115 | */ |
| 116 | - protected $_ci_varmap = array('unit_test' => 'unit', |
|
| 116 | + protected $_ci_varmap = array('unit_test' => 'unit', |
|
| 117 | 117 | 'user_agent' => 'agent'); |
| 118 | 118 | |
| 119 | 119 | /** |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | */ |
| 124 | 124 | public function __construct() |
| 125 | 125 | { |
| 126 | - $this->_ci_ob_level = ob_get_level(); |
|
| 126 | + $this->_ci_ob_level = ob_get_level(); |
|
| 127 | 127 | $this->_ci_library_paths = array(APPPATH, BASEPATH); |
| 128 | 128 | $this->_ci_helper_paths = array(APPPATH, BASEPATH); |
| 129 | 129 | $this->_ci_model_paths = array(APPPATH); |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | $this->_ci_classes = array(); |
| 148 | 148 | $this->_ci_loaded_files = array(); |
| 149 | 149 | $this->_ci_models = array(); |
| 150 | - $this->_base_classes =& is_loaded(); |
|
| 150 | + $this->_base_classes = & is_loaded(); |
|
| 151 | 151 | |
| 152 | 152 | $this->_ci_autoloader(); |
| 153 | 153 | |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | return; |
| 267 | 267 | } |
| 268 | 268 | |
| 269 | - $CI =& get_instance(); |
|
| 269 | + $CI = & get_instance(); |
|
| 270 | 270 | if (isset($CI->$name)) |
| 271 | 271 | { |
| 272 | 272 | show_error('The model name you are loading is the name of a resource that is already being used: '.$name); |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | public function database($params = '', $return = FALSE, $active_record = NULL) |
| 324 | 324 | { |
| 325 | 325 | // Grab the super object |
| 326 | - $CI =& get_instance(); |
|
| 326 | + $CI = & get_instance(); |
|
| 327 | 327 | |
| 328 | 328 | // Do we even need to load the database class? |
| 329 | 329 | if (class_exists('CI_DB') AND $return == FALSE AND $active_record == NULL AND isset($CI->db) AND is_object($CI->db)) |
@@ -343,7 +343,7 @@ discard block |
||
| 343 | 343 | $CI->db = ''; |
| 344 | 344 | |
| 345 | 345 | // Load the DB class |
| 346 | - $CI->db =& DB($params, $active_record); |
|
| 346 | + $CI->db = & DB($params, $active_record); |
|
| 347 | 347 | } |
| 348 | 348 | |
| 349 | 349 | // -------------------------------------------------------------------- |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | $this->database(); |
| 361 | 361 | } |
| 362 | 362 | |
| 363 | - $CI =& get_instance(); |
|
| 363 | + $CI = & get_instance(); |
|
| 364 | 364 | |
| 365 | 365 | // for backwards compatibility, load dbforge so we can extend dbutils off it |
| 366 | 366 | // this use is deprecated and strongly discouraged |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | $this->database(); |
| 388 | 388 | } |
| 389 | 389 | |
| 390 | - $CI =& get_instance(); |
|
| 390 | + $CI = & get_instance(); |
|
| 391 | 391 | |
| 392 | 392 | require_once(BASEPATH.'database/DB_forge.php'); |
| 393 | 393 | require_once(BASEPATH.'database/drivers/'.$CI->db->dbdriver.'/'.$CI->db->dbdriver.'_forge.php'); |
@@ -567,7 +567,7 @@ discard block |
||
| 567 | 567 | */ |
| 568 | 568 | public function language($file = array(), $lang = '') |
| 569 | 569 | { |
| 570 | - $CI =& get_instance(); |
|
| 570 | + $CI = & get_instance(); |
|
| 571 | 571 | |
| 572 | 572 | if ( ! is_array($file)) |
| 573 | 573 | { |
@@ -592,7 +592,7 @@ discard block |
||
| 592 | 592 | */ |
| 593 | 593 | public function config($file = '', $use_sections = FALSE, $fail_gracefully = FALSE) |
| 594 | 594 | { |
| 595 | - $CI =& get_instance(); |
|
| 595 | + $CI = & get_instance(); |
|
| 596 | 596 | $CI->config->load($file, $use_sections, $fail_gracefully); |
| 597 | 597 | } |
| 598 | 598 | |
@@ -642,7 +642,7 @@ discard block |
||
| 642 | 642 | * @param boolean |
| 643 | 643 | * @return void |
| 644 | 644 | */ |
| 645 | - public function add_package_path($path, $view_cascade=TRUE) |
|
| 645 | + public function add_package_path($path, $view_cascade = TRUE) |
|
| 646 | 646 | { |
| 647 | 647 | $path = rtrim($path, '/').'/'; |
| 648 | 648 | |
@@ -653,7 +653,7 @@ discard block |
||
| 653 | 653 | $this->_ci_view_paths = array($path.'views/' => $view_cascade) + $this->_ci_view_paths; |
| 654 | 654 | |
| 655 | 655 | // Add config file path |
| 656 | - $config =& $this->_ci_get_component('config'); |
|
| 656 | + $config = & $this->_ci_get_component('config'); |
|
| 657 | 657 | array_unshift($config->_config_paths, $path); |
| 658 | 658 | } |
| 659 | 659 | |
@@ -686,7 +686,7 @@ discard block |
||
| 686 | 686 | */ |
| 687 | 687 | public function remove_package_path($path = '', $remove_config_path = TRUE) |
| 688 | 688 | { |
| 689 | - $config =& $this->_ci_get_component('config'); |
|
| 689 | + $config = & $this->_ci_get_component('config'); |
|
| 690 | 690 | |
| 691 | 691 | if ($path == '') |
| 692 | 692 | { |
@@ -783,12 +783,12 @@ discard block |
||
| 783 | 783 | // This allows anything loaded using $this->load (views, files, etc.) |
| 784 | 784 | // to become accessible from within the Controller and Model functions. |
| 785 | 785 | |
| 786 | - $_ci_CI =& get_instance(); |
|
| 786 | + $_ci_CI = & get_instance(); |
|
| 787 | 787 | foreach (get_object_vars($_ci_CI) as $_ci_key => $_ci_var) |
| 788 | 788 | { |
| 789 | 789 | if ( ! isset($this->$_ci_key)) |
| 790 | 790 | { |
| 791 | - $this->$_ci_key =& $_ci_CI->$_ci_key; |
|
| 791 | + $this->$_ci_key = & $_ci_CI->$_ci_key; |
|
| 792 | 792 | } |
| 793 | 793 | } |
| 794 | 794 | |
@@ -824,7 +824,7 @@ discard block |
||
| 824 | 824 | // do a little string replacement, changing the short tags |
| 825 | 825 | // to standard PHP echo statements. |
| 826 | 826 | |
| 827 | - if ((bool) @ini_get('short_open_tag') === FALSE AND config_item('rewrite_short_tags') == TRUE) |
|
| 827 | + if ((bool)@ini_get('short_open_tag') === FALSE AND config_item('rewrite_short_tags') == TRUE) |
|
| 828 | 828 | { |
| 829 | 829 | echo eval('?>'.preg_replace("/;*\s*\?>/", "; ?>", str_replace('<?=', '<?php echo ', file_get_contents($_ci_path)))); |
| 830 | 830 | } |
@@ -919,7 +919,7 @@ discard block |
||
| 919 | 919 | // return a new instance of the object |
| 920 | 920 | if ( ! is_null($object_name)) |
| 921 | 921 | { |
| 922 | - $CI =& get_instance(); |
|
| 922 | + $CI = & get_instance(); |
|
| 923 | 923 | if ( ! isset($CI->$object_name)) |
| 924 | 924 | { |
| 925 | 925 | return $this->_ci_init_class($class, config_item('subclass_prefix'), $params, $object_name); |
@@ -958,7 +958,7 @@ discard block |
||
| 958 | 958 | // return a new instance of the object |
| 959 | 959 | if ( ! is_null($object_name)) |
| 960 | 960 | { |
| 961 | - $CI =& get_instance(); |
|
| 961 | + $CI = & get_instance(); |
|
| 962 | 962 | if ( ! isset($CI->$object_name)) |
| 963 | 963 | { |
| 964 | 964 | return $this->_ci_init_class($class, '', $params, $object_name); |
@@ -1021,24 +1021,24 @@ discard block |
||
| 1021 | 1021 | // We test for both uppercase and lowercase, for servers that |
| 1022 | 1022 | // are case-sensitive with regard to file names. Check for environment |
| 1023 | 1023 | // first, global next |
| 1024 | - if (defined('ENVIRONMENT') AND file_exists($path .'config/'.ENVIRONMENT.'/'.strtolower($class).'.php')) |
|
| 1024 | + if (defined('ENVIRONMENT') AND file_exists($path.'config/'.ENVIRONMENT.'/'.strtolower($class).'.php')) |
|
| 1025 | 1025 | { |
| 1026 | - include($path .'config/'.ENVIRONMENT.'/'.strtolower($class).'.php'); |
|
| 1026 | + include($path.'config/'.ENVIRONMENT.'/'.strtolower($class).'.php'); |
|
| 1027 | 1027 | break; |
| 1028 | 1028 | } |
| 1029 | - elseif (defined('ENVIRONMENT') AND file_exists($path .'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php')) |
|
| 1029 | + elseif (defined('ENVIRONMENT') AND file_exists($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php')) |
|
| 1030 | 1030 | { |
| 1031 | - include($path .'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php'); |
|
| 1031 | + include($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php'); |
|
| 1032 | 1032 | break; |
| 1033 | 1033 | } |
| 1034 | - elseif (file_exists($path .'config/'.strtolower($class).'.php')) |
|
| 1034 | + elseif (file_exists($path.'config/'.strtolower($class).'.php')) |
|
| 1035 | 1035 | { |
| 1036 | - include($path .'config/'.strtolower($class).'.php'); |
|
| 1036 | + include($path.'config/'.strtolower($class).'.php'); |
|
| 1037 | 1037 | break; |
| 1038 | 1038 | } |
| 1039 | - elseif (file_exists($path .'config/'.ucfirst(strtolower($class)).'.php')) |
|
| 1039 | + elseif (file_exists($path.'config/'.ucfirst(strtolower($class)).'.php')) |
|
| 1040 | 1040 | { |
| 1041 | - include($path .'config/'.ucfirst(strtolower($class)).'.php'); |
|
| 1041 | + include($path.'config/'.ucfirst(strtolower($class)).'.php'); |
|
| 1042 | 1042 | break; |
| 1043 | 1043 | } |
| 1044 | 1044 | } |
@@ -1089,7 +1089,7 @@ discard block |
||
| 1089 | 1089 | $this->_ci_classes[$class] = $classvar; |
| 1090 | 1090 | |
| 1091 | 1091 | // Instantiate the class |
| 1092 | - $CI =& get_instance(); |
|
| 1092 | + $CI = & get_instance(); |
|
| 1093 | 1093 | if ($config !== NULL) |
| 1094 | 1094 | { |
| 1095 | 1095 | $CI->$classvar = new $name($config); |
@@ -1139,7 +1139,7 @@ discard block |
||
| 1139 | 1139 | // Load any custom config file |
| 1140 | 1140 | if (count($autoload['config']) > 0) |
| 1141 | 1141 | { |
| 1142 | - $CI =& get_instance(); |
|
| 1142 | + $CI = & get_instance(); |
|
| 1143 | 1143 | foreach ($autoload['config'] as $key => $val) |
| 1144 | 1144 | { |
| 1145 | 1145 | $CI->config->load($val); |
@@ -1211,7 +1211,7 @@ discard block |
||
| 1211 | 1211 | */ |
| 1212 | 1212 | protected function &_ci_get_component($component) |
| 1213 | 1213 | { |
| 1214 | - $CI =& get_instance(); |
|
| 1214 | + $CI = & get_instance(); |
|
| 1215 | 1215 | return $CI->$component; |
| 1216 | 1216 | } |
| 1217 | 1217 | |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | { |
| 89 | 89 | $severity = ( ! isset($this->levels[$severity])) ? $severity : $this->levels[$severity]; |
| 90 | 90 | |
| 91 | - log_message('error', 'Severity: '.$severity.' --> '.$message. ' '.$filepath.' '.$line, TRUE); |
|
| 91 | + log_message('error', 'Severity: '.$severity.' --> '.$message.' '.$filepath.' '.$line, TRUE); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | // -------------------------------------------------------------------- |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | if (FALSE !== strpos($filepath, '/')) |
| 172 | 172 | { |
| 173 | 173 | $x = explode('/', $filepath); |
| 174 | - $filepath = $x[count($x)-2].'/'.end($x); |
|
| 174 | + $filepath = $x[count($x) - 2].'/'.end($x); |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | if (ob_get_level() > $this->ob_level + 1) |
@@ -36,17 +36,17 @@ |
||
| 36 | 36 | */ |
| 37 | 37 | public function __construct() |
| 38 | 38 | { |
| 39 | - self::$instance =& $this; |
|
| 39 | + self::$instance = & $this; |
|
| 40 | 40 | |
| 41 | 41 | // Assign all the class objects that were instantiated by the |
| 42 | 42 | // bootstrap file (CodeIgniter.php) to local class variables |
| 43 | 43 | // so that CI can run as one big super object. |
| 44 | 44 | foreach (is_loaded() as $var => $class) |
| 45 | 45 | { |
| 46 | - $this->$var =& load_class($class); |
|
| 46 | + $this->$var = & load_class($class); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - $this->load =& load_class('Loader', 'core'); |
|
| 49 | + $this->load = & load_class('Loader', 'core'); |
|
| 50 | 50 | |
| 51 | 51 | $this->load->initialize(); |
| 52 | 52 | |
@@ -32,38 +32,38 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | class CI_Xmlrpc { |
| 34 | 34 | |
| 35 | - var $debug = FALSE; // Debugging on or off |
|
| 36 | - var $xmlrpcI4 = 'i4'; |
|
| 37 | - var $xmlrpcInt = 'int'; |
|
| 38 | - var $xmlrpcBoolean = 'boolean'; |
|
| 35 | + var $debug = FALSE; // Debugging on or off |
|
| 36 | + var $xmlrpcI4 = 'i4'; |
|
| 37 | + var $xmlrpcInt = 'int'; |
|
| 38 | + var $xmlrpcBoolean = 'boolean'; |
|
| 39 | 39 | var $xmlrpcDouble = 'double'; |
| 40 | 40 | var $xmlrpcString = 'string'; |
| 41 | - var $xmlrpcDateTime = 'dateTime.iso8601'; |
|
| 41 | + var $xmlrpcDateTime = 'dateTime.iso8601'; |
|
| 42 | 42 | var $xmlrpcBase64 = 'base64'; |
| 43 | 43 | var $xmlrpcArray = 'array'; |
| 44 | 44 | var $xmlrpcStruct = 'struct'; |
| 45 | 45 | |
| 46 | 46 | var $xmlrpcTypes = array(); |
| 47 | - var $valid_parents = array(); |
|
| 48 | - var $xmlrpcerr = array(); // Response numbers |
|
| 49 | - var $xmlrpcstr = array(); // Response strings |
|
| 47 | + var $valid_parents = array(); |
|
| 48 | + var $xmlrpcerr = array(); // Response numbers |
|
| 49 | + var $xmlrpcstr = array(); // Response strings |
|
| 50 | 50 | |
| 51 | 51 | var $xmlrpc_defencoding = 'UTF-8'; |
| 52 | - var $xmlrpcName = 'XML-RPC for CodeIgniter'; |
|
| 52 | + var $xmlrpcName = 'XML-RPC for CodeIgniter'; |
|
| 53 | 53 | var $xmlrpcVersion = '1.1'; |
| 54 | 54 | var $xmlrpcerruser = 800; // Start of user errors |
| 55 | - var $xmlrpcerrxml = 100; // Start of XML Parse errors |
|
| 56 | - var $xmlrpc_backslash = ''; // formulate backslashes for escaping regexp |
|
| 55 | + var $xmlrpcerrxml = 100; // Start of XML Parse errors |
|
| 56 | + var $xmlrpc_backslash = ''; // formulate backslashes for escaping regexp |
|
| 57 | 57 | |
| 58 | 58 | var $client; |
| 59 | 59 | var $method; |
| 60 | 60 | var $data; |
| 61 | - var $message = ''; |
|
| 62 | - var $error = ''; // Error string for request |
|
| 61 | + var $message = ''; |
|
| 62 | + var $error = ''; // Error string for request |
|
| 63 | 63 | var $result; |
| 64 | - var $response = array(); // Response from remote server |
|
| 64 | + var $response = array(); // Response from remote server |
|
| 65 | 65 | |
| 66 | - var $xss_clean = TRUE; |
|
| 66 | + var $xss_clean = TRUE; |
|
| 67 | 67 | |
| 68 | 68 | //------------------------------------- |
| 69 | 69 | // VALUES THAT MULTIPLE CLASSES NEED |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | |
| 72 | 72 | public function __construct($config = array()) |
| 73 | 73 | { |
| 74 | - $this->xmlrpcName = $this->xmlrpcName; |
|
| 74 | + $this->xmlrpcName = $this->xmlrpcName; |
|
| 75 | 75 | $this->xmlrpc_backslash = chr(92).chr(92); |
| 76 | 76 | |
| 77 | 77 | // Types for info sent back and forth |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | $this->xmlrpcerr['http_error'] = '5'; |
| 121 | 121 | $this->xmlrpcstr['http_error'] = "Did not receive a '200 OK' response from remote server."; |
| 122 | 122 | $this->xmlrpcerr['no_data'] = '6'; |
| 123 | - $this->xmlrpcstr['no_data'] ='No data received from server.'; |
|
| 123 | + $this->xmlrpcstr['no_data'] = 'No data received from server.'; |
|
| 124 | 124 | |
| 125 | 125 | $this->initialize($config); |
| 126 | 126 | |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | // Take URL and parse it |
| 152 | 152 | //------------------------------------- |
| 153 | 153 | |
| 154 | - function server($url, $port=80) |
|
| 154 | + function server($url, $port = 80) |
|
| 155 | 155 | { |
| 156 | 156 | if (substr($url, 0, 4) != "http") |
| 157 | 157 | { |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | // Set Timeout |
| 176 | 176 | //------------------------------------- |
| 177 | 177 | |
| 178 | - function timeout($seconds=5) |
|
| 178 | + function timeout($seconds = 5) |
|
| 179 | 179 | { |
| 180 | 180 | if ( ! is_null($this->client) && is_int($seconds)) |
| 181 | 181 | { |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | |
| 274 | 274 | function send_request() |
| 275 | 275 | { |
| 276 | - $this->message = new XML_RPC_Message($this->method,$this->data); |
|
| 276 | + $this->message = new XML_RPC_Message($this->method, $this->data); |
|
| 277 | 277 | $this->message->debug = $this->debug; |
| 278 | 278 | |
| 279 | 279 | if ( ! $this->result = $this->client->send($this->message)) |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | |
| 320 | 320 | function send_error_message($number, $message) |
| 321 | 321 | { |
| 322 | - return new XML_RPC_Response('0',$number, $message); |
|
| 322 | + return new XML_RPC_Response('0', $number, $message); |
|
| 323 | 323 | } |
| 324 | 324 | // END |
| 325 | 325 | |
@@ -353,14 +353,14 @@ discard block |
||
| 353 | 353 | class XML_RPC_Client extends CI_Xmlrpc |
| 354 | 354 | { |
| 355 | 355 | var $path = ''; |
| 356 | - var $server = ''; |
|
| 356 | + var $server = ''; |
|
| 357 | 357 | var $port = 80; |
| 358 | - var $errno = ''; |
|
| 359 | - var $errstring = ''; |
|
| 360 | - var $timeout = 5; |
|
| 361 | - var $no_multicall = FALSE; |
|
| 358 | + var $errno = ''; |
|
| 359 | + var $errstring = ''; |
|
| 360 | + var $timeout = 5; |
|
| 361 | + var $no_multicall = FALSE; |
|
| 362 | 362 | |
| 363 | - public function __construct($path, $server, $port=80) |
|
| 363 | + public function __construct($path, $server, $port = 80) |
|
| 364 | 364 | { |
| 365 | 365 | parent::__construct(); |
| 366 | 366 | |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | if (is_array($msg)) |
| 375 | 375 | { |
| 376 | 376 | // Multi-call disabled |
| 377 | - $r = new XML_RPC_Response(0, $this->xmlrpcerr['multicall_recursion'],$this->xmlrpcstr['multicall_recursion']); |
|
| 377 | + $r = new XML_RPC_Response(0, $this->xmlrpcerr['multicall_recursion'], $this->xmlrpcstr['multicall_recursion']); |
|
| 378 | 378 | return $r; |
| 379 | 379 | } |
| 380 | 380 | |
@@ -383,12 +383,12 @@ discard block |
||
| 383 | 383 | |
| 384 | 384 | function sendPayload($msg) |
| 385 | 385 | { |
| 386 | - $fp = @fsockopen($this->server, $this->port,$this->errno, $this->errstr, $this->timeout); |
|
| 386 | + $fp = @fsockopen($this->server, $this->port, $this->errno, $this->errstr, $this->timeout); |
|
| 387 | 387 | |
| 388 | 388 | if ( ! is_resource($fp)) |
| 389 | 389 | { |
| 390 | 390 | error_log($this->xmlrpcstr['http_error']); |
| 391 | - $r = new XML_RPC_Response(0, $this->xmlrpcerr['http_error'],$this->xmlrpcstr['http_error']); |
|
| 391 | + $r = new XML_RPC_Response(0, $this->xmlrpcerr['http_error'], $this->xmlrpcstr['http_error']); |
|
| 392 | 392 | return $r; |
| 393 | 393 | } |
| 394 | 394 | |
@@ -403,7 +403,7 @@ discard block |
||
| 403 | 403 | $op .= "Host: {$this->server}$r"; |
| 404 | 404 | $op .= "Content-Type: text/xml$r"; |
| 405 | 405 | $op .= "User-Agent: {$this->xmlrpcName}$r"; |
| 406 | - $op .= "Content-Length: ".strlen($msg->payload). "$r$r"; |
|
| 406 | + $op .= "Content-Length: ".strlen($msg->payload)."$r$r"; |
|
| 407 | 407 | $op .= $msg->payload; |
| 408 | 408 | |
| 409 | 409 | |
@@ -447,7 +447,7 @@ discard block |
||
| 447 | 447 | else if ( ! is_object($val)) |
| 448 | 448 | { |
| 449 | 449 | // programmer error, not an object |
| 450 | - error_log("Invalid type '" . gettype($val) . "' (value: $val) passed to XML_RPC_Response. Defaulting to empty value."); |
|
| 450 | + error_log("Invalid type '".gettype($val)."' (value: $val) passed to XML_RPC_Response. Defaulting to empty value."); |
|
| 451 | 451 | $this->val = new XML_RPC_Values(); |
| 452 | 452 | } |
| 453 | 453 | else |
@@ -481,11 +481,11 @@ discard block |
||
| 481 | 481 | <struct> |
| 482 | 482 | <member> |
| 483 | 483 | <name>faultCode</name> |
| 484 | - <value><int>' . $this->errno . '</int></value> |
|
| 484 | + <value><int>' . $this->errno.'</int></value> |
|
| 485 | 485 | </member> |
| 486 | 486 | <member> |
| 487 | 487 | <name>faultString</name> |
| 488 | - <value><string>' . $this->errstr . '</string></value> |
|
| 488 | + <value><string>' . $this->errstr.'</string></value> |
|
| 489 | 489 | </member> |
| 490 | 490 | </struct> |
| 491 | 491 | </value> |
@@ -493,17 +493,17 @@ discard block |
||
| 493 | 493 | } |
| 494 | 494 | else |
| 495 | 495 | { |
| 496 | - $result .= "<params>\n<param>\n" . |
|
| 497 | - $this->val->serialize_class() . |
|
| 496 | + $result .= "<params>\n<param>\n". |
|
| 497 | + $this->val->serialize_class(). |
|
| 498 | 498 | "</param>\n</params>"; |
| 499 | 499 | } |
| 500 | 500 | $result .= "\n</methodResponse>"; |
| 501 | 501 | return $result; |
| 502 | 502 | } |
| 503 | 503 | |
| 504 | - function decode($array=FALSE) |
|
| 504 | + function decode($array = FALSE) |
|
| 505 | 505 | { |
| 506 | - $CI =& get_instance(); |
|
| 506 | + $CI = & get_instance(); |
|
| 507 | 507 | |
| 508 | 508 | if ($array !== FALSE && is_array($array)) |
| 509 | 509 | { |
@@ -555,7 +555,7 @@ discard block |
||
| 555 | 555 | elseif ($kind == 'array') |
| 556 | 556 | { |
| 557 | 557 | reset($xmlrpc_val->me); |
| 558 | - list($a,$b) = each($xmlrpc_val->me); |
|
| 558 | + list($a, $b) = each($xmlrpc_val->me); |
|
| 559 | 559 | $size = count($b); |
| 560 | 560 | |
| 561 | 561 | $arr = array(); |
@@ -571,7 +571,7 @@ discard block |
||
| 571 | 571 | reset($xmlrpc_val->me['struct']); |
| 572 | 572 | $arr = array(); |
| 573 | 573 | |
| 574 | - while (list($key,$value) = each($xmlrpc_val->me['struct'])) |
|
| 574 | + while (list($key, $value) = each($xmlrpc_val->me['struct'])) |
|
| 575 | 575 | { |
| 576 | 576 | $arr[$key] = $this->xmlrpc_decoder($value); |
| 577 | 577 | } |
@@ -584,7 +584,7 @@ discard block |
||
| 584 | 584 | // ISO-8601 time to server or UTC time |
| 585 | 585 | //------------------------------------- |
| 586 | 586 | |
| 587 | - function iso8601_decode($time, $utc=0) |
|
| 587 | + function iso8601_decode($time, $utc = 0) |
|
| 588 | 588 | { |
| 589 | 589 | // return a timet in the localtime, or UTC |
| 590 | 590 | $t = 0; |
@@ -611,17 +611,17 @@ discard block |
||
| 611 | 611 | { |
| 612 | 612 | var $payload; |
| 613 | 613 | var $method_name; |
| 614 | - var $params = array(); |
|
| 615 | - var $xh = array(); |
|
| 614 | + var $params = array(); |
|
| 615 | + var $xh = array(); |
|
| 616 | 616 | |
| 617 | - public function __construct($method, $pars=0) |
|
| 617 | + public function __construct($method, $pars = 0) |
|
| 618 | 618 | { |
| 619 | 619 | parent::__construct(); |
| 620 | 620 | |
| 621 | 621 | $this->method_name = $method; |
| 622 | 622 | if (is_array($pars) && count($pars) > 0) |
| 623 | 623 | { |
| 624 | - for ($i=0; $i<count($pars); $i++) |
|
| 624 | + for ($i = 0; $i < count($pars); $i++) |
|
| 625 | 625 | { |
| 626 | 626 | // $pars[$i] = XML_RPC_Values |
| 627 | 627 | $this->params[] = $pars[$i]; |
@@ -636,10 +636,10 @@ discard block |
||
| 636 | 636 | function createPayload() |
| 637 | 637 | { |
| 638 | 638 | $this->payload = "<?xml version=\"1.0\"?".">\r\n<methodCall>\r\n"; |
| 639 | - $this->payload .= '<methodName>' . $this->method_name . "</methodName>\r\n"; |
|
| 639 | + $this->payload .= '<methodName>'.$this->method_name."</methodName>\r\n"; |
|
| 640 | 640 | $this->payload .= "<params>\r\n"; |
| 641 | 641 | |
| 642 | - for ($i=0; $i<count($this->params); $i++) |
|
| 642 | + for ($i = 0; $i < count($this->params); $i++) |
|
| 643 | 643 | { |
| 644 | 644 | // $p = XML_RPC_Values |
| 645 | 645 | $p = $this->params[$i]; |
@@ -669,7 +669,7 @@ discard block |
||
| 669 | 669 | if ($this->debug === TRUE) |
| 670 | 670 | { |
| 671 | 671 | echo "<pre>"; |
| 672 | - echo "---DATA---\n" . htmlspecialchars($data) . "\n---END DATA---\n\n"; |
|
| 672 | + echo "---DATA---\n".htmlspecialchars($data)."\n---END DATA---\n\n"; |
|
| 673 | 673 | echo "</pre>"; |
| 674 | 674 | } |
| 675 | 675 | |
@@ -691,8 +691,8 @@ discard block |
||
| 691 | 691 | |
| 692 | 692 | if (strncmp($data, 'HTTP', 4) == 0 && ! preg_match('/^HTTP\/[0-9\.]+ 200 /', $data)) |
| 693 | 693 | { |
| 694 | - $errstr= substr($data, 0, strpos($data, "\n")-1); |
|
| 695 | - $r = new XML_RPC_Response(0, $this->xmlrpcerr['http_error'], $this->xmlrpcstr['http_error']. ' (' . $errstr . ')'); |
|
| 694 | + $errstr = substr($data, 0, strpos($data, "\n") - 1); |
|
| 695 | + $r = new XML_RPC_Response(0, $this->xmlrpcerr['http_error'], $this->xmlrpcstr['http_error'].' ('.$errstr.')'); |
|
| 696 | 696 | return $r; |
| 697 | 697 | } |
| 698 | 698 | |
@@ -702,11 +702,11 @@ discard block |
||
| 702 | 702 | |
| 703 | 703 | $parser = xml_parser_create($this->xmlrpc_defencoding); |
| 704 | 704 | |
| 705 | - $this->xh[$parser] = array(); |
|
| 706 | - $this->xh[$parser]['isf'] = 0; |
|
| 707 | - $this->xh[$parser]['ac'] = ''; |
|
| 708 | - $this->xh[$parser]['headers'] = array(); |
|
| 709 | - $this->xh[$parser]['stack'] = array(); |
|
| 705 | + $this->xh[$parser] = array(); |
|
| 706 | + $this->xh[$parser]['isf'] = 0; |
|
| 707 | + $this->xh[$parser]['ac'] = ''; |
|
| 708 | + $this->xh[$parser]['headers'] = array(); |
|
| 709 | + $this->xh[$parser]['stack'] = array(); |
|
| 710 | 710 | $this->xh[$parser]['valuestack'] = array(); |
| 711 | 711 | $this->xh[$parser]['isf_reason'] = 0; |
| 712 | 712 | |
@@ -762,12 +762,12 @@ discard block |
||
| 762 | 762 | echo "---Invalid Return---\n\n"; |
| 763 | 763 | } |
| 764 | 764 | |
| 765 | - $r = new XML_RPC_Response(0, $this->xmlrpcerr['invalid_return'],$this->xmlrpcstr['invalid_return'].' '.$this->xh[$parser]['isf_reason']); |
|
| 765 | + $r = new XML_RPC_Response(0, $this->xmlrpcerr['invalid_return'], $this->xmlrpcstr['invalid_return'].' '.$this->xh[$parser]['isf_reason']); |
|
| 766 | 766 | return $r; |
| 767 | 767 | } |
| 768 | 768 | elseif ( ! is_object($this->xh[$parser]['value'])) |
| 769 | 769 | { |
| 770 | - $r = new XML_RPC_Response(0, $this->xmlrpcerr['invalid_return'],$this->xmlrpcstr['invalid_return'].' '.$this->xh[$parser]['isf_reason']); |
|
| 770 | + $r = new XML_RPC_Response(0, $this->xmlrpcerr['invalid_return'], $this->xmlrpcstr['invalid_return'].' '.$this->xh[$parser]['isf_reason']); |
|
| 771 | 771 | return $r; |
| 772 | 772 | } |
| 773 | 773 | |
@@ -789,9 +789,9 @@ discard block |
||
| 789 | 789 | echo "---END HEADERS---\n\n"; |
| 790 | 790 | } |
| 791 | 791 | |
| 792 | - echo "---DATA---\n" . htmlspecialchars($data) . "\n---END DATA---\n\n"; |
|
| 792 | + echo "---DATA---\n".htmlspecialchars($data)."\n---END DATA---\n\n"; |
|
| 793 | 793 | |
| 794 | - echo "---PARSED---\n" ; |
|
| 794 | + echo "---PARSED---\n"; |
|
| 795 | 795 | var_dump($this->xh[$parser]['value']); |
| 796 | 796 | echo "\n---END PARSED---</pre>"; |
| 797 | 797 | } |
@@ -870,7 +870,7 @@ discard block |
||
| 870 | 870 | } |
| 871 | 871 | } |
| 872 | 872 | |
| 873 | - switch($name) |
|
| 873 | + switch ($name) |
|
| 874 | 874 | { |
| 875 | 875 | case 'STRUCT': |
| 876 | 876 | case 'ARRAY': |
@@ -956,13 +956,13 @@ discard block |
||
| 956 | 956 | |
| 957 | 957 | $curr_elem = array_shift($this->xh[$the_parser]['stack']); |
| 958 | 958 | |
| 959 | - switch($name) |
|
| 959 | + switch ($name) |
|
| 960 | 960 | { |
| 961 | 961 | case 'STRUCT': |
| 962 | 962 | case 'ARRAY': |
| 963 | 963 | $cur_val = array_shift($this->xh[$the_parser]['valuestack']); |
| 964 | 964 | $this->xh[$the_parser]['value'] = ( ! isset($cur_val['values'])) ? array() : $cur_val['values']; |
| 965 | - $this->xh[$the_parser]['vt'] = strtolower($name); |
|
| 965 | + $this->xh[$the_parser]['vt'] = strtolower($name); |
|
| 966 | 966 | break; |
| 967 | 967 | case 'NAME': |
| 968 | 968 | $this->xh[$the_parser]['valuestack'][0]['name'] = $this->xh[$the_parser]['ac']; |
@@ -980,16 +980,16 @@ discard block |
||
| 980 | 980 | { |
| 981 | 981 | $this->xh[$the_parser]['value'] = $this->xh[$the_parser]['ac']; |
| 982 | 982 | } |
| 983 | - elseif ($name=='DATETIME.ISO8601') |
|
| 983 | + elseif ($name == 'DATETIME.ISO8601') |
|
| 984 | 984 | { |
| 985 | - $this->xh[$the_parser]['vt'] = $this->xmlrpcDateTime; |
|
| 985 | + $this->xh[$the_parser]['vt'] = $this->xmlrpcDateTime; |
|
| 986 | 986 | $this->xh[$the_parser]['value'] = $this->xh[$the_parser]['ac']; |
| 987 | 987 | } |
| 988 | - elseif ($name=='BASE64') |
|
| 988 | + elseif ($name == 'BASE64') |
|
| 989 | 989 | { |
| 990 | 990 | $this->xh[$the_parser]['value'] = base64_decode($this->xh[$the_parser]['ac']); |
| 991 | 991 | } |
| 992 | - elseif ($name=='BOOLEAN') |
|
| 992 | + elseif ($name == 'BOOLEAN') |
|
| 993 | 993 | { |
| 994 | 994 | // Translated BOOLEAN values to TRUE AND FALSE |
| 995 | 995 | if ($this->xh[$the_parser]['ac'] == '1') |
@@ -1001,7 +1001,7 @@ discard block |
||
| 1001 | 1001 | $this->xh[$the_parser]['value'] = FALSE; |
| 1002 | 1002 | } |
| 1003 | 1003 | } |
| 1004 | - elseif ($name=='DOUBLE') |
|
| 1004 | + elseif ($name == 'DOUBLE') |
|
| 1005 | 1005 | { |
| 1006 | 1006 | // we have a DOUBLE |
| 1007 | 1007 | // we must check that only 0123456789-.<space> are characters here |
@@ -1032,10 +1032,10 @@ discard block |
||
| 1032 | 1032 | break; |
| 1033 | 1033 | case 'VALUE': |
| 1034 | 1034 | // This if() detects if no scalar was inside <VALUE></VALUE> |
| 1035 | - if ($this->xh[$the_parser]['vt']=='value') |
|
| 1035 | + if ($this->xh[$the_parser]['vt'] == 'value') |
|
| 1036 | 1036 | { |
| 1037 | - $this->xh[$the_parser]['value'] = $this->xh[$the_parser]['ac']; |
|
| 1038 | - $this->xh[$the_parser]['vt'] = $this->xmlrpcString; |
|
| 1037 | + $this->xh[$the_parser]['value'] = $this->xh[$the_parser]['ac']; |
|
| 1038 | + $this->xh[$the_parser]['vt'] = $this->xmlrpcString; |
|
| 1039 | 1039 | } |
| 1040 | 1040 | |
| 1041 | 1041 | // build the XML-RPC value out of the data received, and substitute it |
@@ -1053,7 +1053,7 @@ discard block |
||
| 1053 | 1053 | } |
| 1054 | 1054 | break; |
| 1055 | 1055 | case 'MEMBER': |
| 1056 | - $this->xh[$the_parser]['ac']=''; |
|
| 1056 | + $this->xh[$the_parser]['ac'] = ''; |
|
| 1057 | 1057 | |
| 1058 | 1058 | // If value add to array in the stack for the last element built |
| 1059 | 1059 | if ($this->xh[$the_parser]['value']) |
@@ -1062,7 +1062,7 @@ discard block |
||
| 1062 | 1062 | } |
| 1063 | 1063 | break; |
| 1064 | 1064 | case 'DATA': |
| 1065 | - $this->xh[$the_parser]['ac']=''; |
|
| 1065 | + $this->xh[$the_parser]['ac'] = ''; |
|
| 1066 | 1066 | break; |
| 1067 | 1067 | case 'PARAM': |
| 1068 | 1068 | if ($this->xh[$the_parser]['value']) |
@@ -1111,11 +1111,11 @@ discard block |
||
| 1111 | 1111 | } |
| 1112 | 1112 | |
| 1113 | 1113 | |
| 1114 | - function addParam($par) { $this->params[]=$par; } |
|
| 1114 | + function addParam($par) { $this->params[] = $par; } |
|
| 1115 | 1115 | |
| 1116 | - function output_parameters($array=FALSE) |
|
| 1116 | + function output_parameters($array = FALSE) |
|
| 1117 | 1117 | { |
| 1118 | - $CI =& get_instance(); |
|
| 1118 | + $CI = & get_instance(); |
|
| 1119 | 1119 | |
| 1120 | 1120 | if ($array !== FALSE && is_array($array)) |
| 1121 | 1121 | { |
@@ -1169,11 +1169,11 @@ discard block |
||
| 1169 | 1169 | elseif ($kind == 'array') |
| 1170 | 1170 | { |
| 1171 | 1171 | reset($param->me); |
| 1172 | - list($a,$b) = each($param->me); |
|
| 1172 | + list($a, $b) = each($param->me); |
|
| 1173 | 1173 | |
| 1174 | 1174 | $arr = array(); |
| 1175 | 1175 | |
| 1176 | - for($i = 0; $i < count($b); $i++) |
|
| 1176 | + for ($i = 0; $i < count($b); $i++) |
|
| 1177 | 1177 | { |
| 1178 | 1178 | $arr[] = $this->decode_message($param->me['array'][$i]); |
| 1179 | 1179 | } |
@@ -1186,7 +1186,7 @@ discard block |
||
| 1186 | 1186 | |
| 1187 | 1187 | $arr = array(); |
| 1188 | 1188 | |
| 1189 | - while (list($key,$value) = each($param->me['struct'])) |
|
| 1189 | + while (list($key, $value) = each($param->me['struct'])) |
|
| 1190 | 1190 | { |
| 1191 | 1191 | $arr[$key] = $this->decode_message($value); |
| 1192 | 1192 | } |
@@ -1208,10 +1208,10 @@ discard block |
||
| 1208 | 1208 | */ |
| 1209 | 1209 | class XML_RPC_Values extends CI_Xmlrpc |
| 1210 | 1210 | { |
| 1211 | - var $me = array(); |
|
| 1212 | - var $mytype = 0; |
|
| 1211 | + var $me = array(); |
|
| 1212 | + var $mytype = 0; |
|
| 1213 | 1213 | |
| 1214 | - public function __construct($val=-1, $type='') |
|
| 1214 | + public function __construct($val = -1, $type = '') |
|
| 1215 | 1215 | { |
| 1216 | 1216 | parent::__construct(); |
| 1217 | 1217 | |
@@ -1221,7 +1221,7 @@ discard block |
||
| 1221 | 1221 | |
| 1222 | 1222 | if ($this->xmlrpcTypes[$type] == 1) |
| 1223 | 1223 | { |
| 1224 | - $this->addScalar($val,$type); |
|
| 1224 | + $this->addScalar($val, $type); |
|
| 1225 | 1225 | } |
| 1226 | 1226 | elseif ($this->xmlrpcTypes[$type] == 2) |
| 1227 | 1227 | { |
@@ -1234,11 +1234,11 @@ discard block |
||
| 1234 | 1234 | } |
| 1235 | 1235 | } |
| 1236 | 1236 | |
| 1237 | - function addScalar($val, $type='string') |
|
| 1237 | + function addScalar($val, $type = 'string') |
|
| 1238 | 1238 | { |
| 1239 | 1239 | $typeof = $this->xmlrpcTypes[$type]; |
| 1240 | 1240 | |
| 1241 | - if ($this->mytype==1) |
|
| 1241 | + if ($this->mytype == 1) |
|
| 1242 | 1242 | { |
| 1243 | 1243 | echo '<strong>XML_RPC_Values</strong>: scalar can have only one value<br />'; |
| 1244 | 1244 | return 0; |
@@ -1252,13 +1252,13 @@ discard block |
||
| 1252 | 1252 | |
| 1253 | 1253 | if ($type == $this->xmlrpcBoolean) |
| 1254 | 1254 | { |
| 1255 | - if (strcasecmp($val,'true')==0 OR $val==1 OR ($val==true && strcasecmp($val,'false'))) |
|
| 1255 | + if (strcasecmp($val, 'true') == 0 OR $val == 1 OR ($val == true && strcasecmp($val, 'false'))) |
|
| 1256 | 1256 | { |
| 1257 | 1257 | $val = 1; |
| 1258 | 1258 | } |
| 1259 | 1259 | else |
| 1260 | 1260 | { |
| 1261 | - $val=0; |
|
| 1261 | + $val = 0; |
|
| 1262 | 1262 | } |
| 1263 | 1263 | } |
| 1264 | 1264 | |
@@ -1282,7 +1282,7 @@ discard block |
||
| 1282 | 1282 | { |
| 1283 | 1283 | if ($this->mytype != 0) |
| 1284 | 1284 | { |
| 1285 | - echo '<strong>XML_RPC_Values</strong>: already initialized as a [' . $this->kindOf() . ']<br />'; |
|
| 1285 | + echo '<strong>XML_RPC_Values</strong>: already initialized as a ['.$this->kindOf().']<br />'; |
|
| 1286 | 1286 | return 0; |
| 1287 | 1287 | } |
| 1288 | 1288 | |
@@ -1295,7 +1295,7 @@ discard block |
||
| 1295 | 1295 | { |
| 1296 | 1296 | if ($this->mytype != 0) |
| 1297 | 1297 | { |
| 1298 | - echo '<strong>XML_RPC_Values</strong>: already initialized as a [' . $this->kindOf() . ']<br />'; |
|
| 1298 | + echo '<strong>XML_RPC_Values</strong>: already initialized as a ['.$this->kindOf().']<br />'; |
|
| 1299 | 1299 | return 0; |
| 1300 | 1300 | } |
| 1301 | 1301 | $this->mytype = $this->xmlrpcTypes['struct']; |
@@ -1305,7 +1305,7 @@ discard block |
||
| 1305 | 1305 | |
| 1306 | 1306 | function kindOf() |
| 1307 | 1307 | { |
| 1308 | - switch($this->mytype) |
|
| 1308 | + switch ($this->mytype) |
|
| 1309 | 1309 | { |
| 1310 | 1310 | case 3: |
| 1311 | 1311 | return 'struct'; |
@@ -1325,7 +1325,7 @@ discard block |
||
| 1325 | 1325 | { |
| 1326 | 1326 | $rs = ''; |
| 1327 | 1327 | |
| 1328 | - switch($this->xmlrpcTypes[$typ]) |
|
| 1328 | + switch ($this->xmlrpcTypes[$typ]) |
|
| 1329 | 1329 | { |
| 1330 | 1330 | case 3: |
| 1331 | 1331 | // struct |
@@ -1342,24 +1342,24 @@ discard block |
||
| 1342 | 1342 | case 2: |
| 1343 | 1343 | // array |
| 1344 | 1344 | $rs .= "<array>\n<data>\n"; |
| 1345 | - for($i=0; $i < count($val); $i++) |
|
| 1345 | + for ($i = 0; $i < count($val); $i++) |
|
| 1346 | 1346 | { |
| 1347 | 1347 | $rs .= $this->serializeval($val[$i]); |
| 1348 | 1348 | } |
| 1349 | - $rs.="</data>\n</array>\n"; |
|
| 1349 | + $rs .= "</data>\n</array>\n"; |
|
| 1350 | 1350 | break; |
| 1351 | 1351 | case 1: |
| 1352 | 1352 | // others |
| 1353 | 1353 | switch ($typ) |
| 1354 | 1354 | { |
| 1355 | 1355 | case $this->xmlrpcBase64: |
| 1356 | - $rs .= "<{$typ}>" . base64_encode((string)$val) . "</{$typ}>\n"; |
|
| 1356 | + $rs .= "<{$typ}>".base64_encode((string)$val)."</{$typ}>\n"; |
|
| 1357 | 1357 | break; |
| 1358 | 1358 | case $this->xmlrpcBoolean: |
| 1359 | - $rs .= "<{$typ}>" . ((bool)$val ? '1' : '0') . "</{$typ}>\n"; |
|
| 1359 | + $rs .= "<{$typ}>".((bool)$val ? '1' : '0')."</{$typ}>\n"; |
|
| 1360 | 1360 | break; |
| 1361 | 1361 | case $this->xmlrpcString: |
| 1362 | - $rs .= "<{$typ}>" . htmlspecialchars((string)$val). "</{$typ}>\n"; |
|
| 1362 | + $rs .= "<{$typ}>".htmlspecialchars((string)$val)."</{$typ}>\n"; |
|
| 1363 | 1363 | break; |
| 1364 | 1364 | default: |
| 1365 | 1365 | $rs .= "<{$typ}>{$val}</{$typ}>\n"; |
@@ -1389,7 +1389,7 @@ discard block |
||
| 1389 | 1389 | function scalarval() |
| 1390 | 1390 | { |
| 1391 | 1391 | reset($this->me); |
| 1392 | - list($a,$b) = each($this->me); |
|
| 1392 | + list($a, $b) = each($this->me); |
|
| 1393 | 1393 | return $b; |
| 1394 | 1394 | } |
| 1395 | 1395 | |
@@ -1400,7 +1400,7 @@ discard block |
||
| 1400 | 1400 | |
| 1401 | 1401 | // Useful for sending time in XML-RPC |
| 1402 | 1402 | |
| 1403 | - function iso8601_encode($time, $utc=0) |
|
| 1403 | + function iso8601_encode($time, $utc = 0) |
|
| 1404 | 1404 | { |
| 1405 | 1405 | if ($utc == 1) |
| 1406 | 1406 | { |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | public function parse($template, $data, $return = FALSE) |
| 46 | 46 | { |
| 47 | - $CI =& get_instance(); |
|
| 47 | + $CI = & get_instance(); |
|
| 48 | 48 | $template = $CI->load->view($template, $data, TRUE); |
| 49 | 49 | |
| 50 | 50 | return $this->_parse($template, $data, $return); |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | |
| 105 | 105 | if ($return == FALSE) |
| 106 | 106 | { |
| 107 | - $CI =& get_instance(); |
|
| 107 | + $CI = & get_instance(); |
|
| 108 | 108 | $CI->output->append_output($template); |
| 109 | 109 | } |
| 110 | 110 | |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | */ |
| 198 | 198 | function _match_pair($string, $variable) |
| 199 | 199 | { |
| 200 | - if ( ! preg_match("|" . preg_quote($this->l_delim) . $variable . preg_quote($this->r_delim) . "(.+?)". preg_quote($this->l_delim) . '/' . $variable . preg_quote($this->r_delim) . "|s", $string, $match)) |
|
| 200 | + if ( ! preg_match("|".preg_quote($this->l_delim).$variable.preg_quote($this->r_delim)."(.+?)".preg_quote($this->l_delim).'/'.$variable.preg_quote($this->r_delim)."|s", $string, $match)) |
|
| 201 | 201 | { |
| 202 | 202 | return FALSE; |
| 203 | 203 | } |
@@ -26,12 +26,12 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | class CI_Cache extends CI_Driver_Library { |
| 28 | 28 | |
| 29 | - protected $valid_drivers = array( |
|
| 29 | + protected $valid_drivers = array( |
|
| 30 | 30 | 'cache_apc', 'cache_file', 'cache_memcached', 'cache_dummy' |
| 31 | 31 | ); |
| 32 | 32 | |
| 33 | - protected $_cache_path = NULL; // Path of cache files (if file-based cache) |
|
| 34 | - protected $_adapter = 'dummy'; |
|
| 33 | + protected $_cache_path = NULL; // Path of cache files (if file-based cache) |
|
| 34 | + protected $_adapter = 'dummy'; |
|
| 35 | 35 | protected $_backup_driver; |
| 36 | 36 | |
| 37 | 37 | // ------------------------------------------------------------------------ |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | public function __construct() |
| 36 | 36 | { |
| 37 | - $CI =& get_instance(); |
|
| 37 | + $CI = & get_instance(); |
|
| 38 | 38 | $CI->load->helper('file'); |
| 39 | 39 | |
| 40 | 40 | $path = $CI->config->item('cache_path'); |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | $data = read_file($this->_cache_path.$id); |
| 61 | 61 | $data = unserialize($data); |
| 62 | 62 | |
| 63 | - if (time() > $data['time'] + $data['ttl']) |
|
| 63 | + if (time() > $data['time'] + $data['ttl']) |
|
| 64 | 64 | { |
| 65 | 65 | unlink($this->_cache_path.$id); |
| 66 | 66 | return FALSE; |