From 07c1ac830b4e98aa40f48baef3dd05fb68c0a836 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Fri, 9 Mar 2012 17:03:37 +0000 Subject: Bumped CodeIgniter's PHP requirement to 5.2.4. Yes I know PHP 5.4 just came out, and yes I know PHP 5.3 has lovely features, but there are plenty of corporate systems running on CodeIgniter and PHP 5.3 still is not widely supported enough. CodeIgniter is great for distributed applications, and this is the highest we can reasonably go without breaking support. PHP 5.3 will most likely happen in another year or so. Fingers crossed on that one anyway... --- system/libraries/Javascript.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/libraries/Javascript.php') diff --git a/system/libraries/Javascript.php b/system/libraries/Javascript.php index 33df6007a..9ba93000b 100644 --- a/system/libraries/Javascript.php +++ b/system/libraries/Javascript.php @@ -2,7 +2,7 @@ /** * CodeIgniter * - * An open source application development framework for PHP 5.1.6 or newer + * An open source application development framework for PHP 5.2.4 or newer * * NOTICE OF LICENSE * -- cgit v1.2.3-24-g4f1b From 443bbd96382552e8a7aea0f9dc7f1c90efc9b4e8 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 3 Apr 2012 15:49:11 +0300 Subject: Minor cleanup and style fixes in the Log and Javascript libraries --- system/libraries/Javascript.php | 41 +++++++++++++++-------------------------- 1 file changed, 15 insertions(+), 26 deletions(-) (limited to 'system/libraries/Javascript.php') diff --git a/system/libraries/Javascript.php b/system/libraries/Javascript.php index 9ba93000b..baa044117 100644 --- a/system/libraries/Javascript.php +++ b/system/libraries/Javascript.php @@ -25,8 +25,6 @@ * @filesource */ -// ------------------------------------------------------------------------ - /** * Javascript Class * @@ -46,7 +44,7 @@ class CI_Javascript { foreach ($defaults as $key => $val) { - if (isset($params[$key]) && $params[$key] !== "") + if (isset($params[$key]) && $params[$key] !== '') { $defaults[$key] = $params[$key]; } @@ -61,7 +59,7 @@ class CI_Javascript { // make js to refer to current library $this->js =& $this->CI->$js_library_driver; - log_message('debug', "Javascript Class Initialized and loaded. Driver used: $js_library_driver"); + log_message('debug', 'Javascript Class Initialized and loaded. Driver used: '.$js_library_driver); } // -------------------------------------------------------------------- @@ -375,7 +373,6 @@ class CI_Javascript { // Effects // -------------------------------------------------------------------- - /** * Add Class * @@ -618,12 +615,9 @@ class CI_Javascript { { $this->_javascript_location = $external_file; } - else + elseif ($this->CI->config->item('javascript_location') != '') { - if ($this->CI->config->item('javascript_location') != '') - { - $this->_javascript_location = $this->CI->config->item('javascript_location'); - } + $this->_javascript_location = $this->CI->config->item('javascript_location'); } if ($relative === TRUE OR strncmp($external_file, 'http://', 7) === 0 OR strncmp($external_file, 'https://', 8) === 0) @@ -656,7 +650,7 @@ class CI_Javascript { public function inline($script, $cdata = TRUE) { return $this->_open_script() - . ($cdata ? "\n// \n" : "\n{$script}\n") + . ($cdata ? "\n// \n" : "\n".$script."\n") . $this->_close_script(); } @@ -673,7 +667,7 @@ class CI_Javascript { protected function _open_script($src = '') { return '$extra"; + return ''.$extra; } - - // -------------------------------------------------------------------- // -------------------------------------------------------------------- // AJAX-Y STUFF - still a testbed // -------------------------------------------------------------------- - // -------------------------------------------------------------------- /** * Update @@ -751,9 +742,9 @@ class CI_Javascript { $json = array(); $_is_assoc = TRUE; - if ( ! is_array($json_result) AND empty($json_result)) + if ( ! is_array($json_result) && empty($json_result)) { - show_error("Generate JSON Failed - Illegal key, value pair."); + show_error('Generate JSON Failed - Illegal key, value pair.'); } elseif ($match_array_type) { @@ -774,7 +765,7 @@ class CI_Javascript { $json = implode(',', $json); - return $_is_assoc ? "{".$json."}" : "[".$json."]"; + return $_is_assoc ? '{'.$json.'}' : '['.$json.']'; } @@ -785,8 +776,8 @@ class CI_Javascript { * * Checks for an associative array * - * @param type - * @return type + * @param array + * @return bool */ protected function _is_associative_array($arr) { @@ -808,8 +799,8 @@ class CI_Javascript { * * Ensures a standard json value and escapes values * - * @param type - * @return type + * @param mixed + * @return string */ protected function _prep_args($result, $is_key = FALSE) { @@ -831,9 +822,7 @@ class CI_Javascript { } } - // -------------------------------------------------------------------- } -// END Javascript Class /* End of file Javascript.php */ -/* Location: ./system/libraries/Javascript.php */ +/* Location: ./system/libraries/Javascript.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 1b815532378bd444347d1bc741771e13108147b6 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 3 Apr 2012 16:06:03 +0300 Subject: Minor cleanup and style fixes in the Unit_test and Image_lib libraries --- system/libraries/Javascript.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/libraries/Javascript.php') diff --git a/system/libraries/Javascript.php b/system/libraries/Javascript.php index baa044117..629a3adfe 100644 --- a/system/libraries/Javascript.php +++ b/system/libraries/Javascript.php @@ -105,7 +105,7 @@ class CI_Javascript { * * @param string The element to attach the event to * @param string The code to execute - * @param boolean whether or not to return false + * @param bool whether or not to return false * @return string */ public function click($element = 'this', $js = '', $ret_false = TRUE) @@ -644,7 +644,7 @@ class CI_Javascript { * Outputs a