Skip to content

Commit 3e4e80d

Browse files
committed
Upgrade CodeIgniter Framework next-gen version v3.1.14-develop
1 parent 63dfca2 commit 3e4e80d

File tree

10 files changed

+36
-28
lines changed

10 files changed

+36
-28
lines changed

config/constants.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
defined('BASEPATH') or exit('No direct script access allowed');
23
/**
34
* Project codeigniter-framework
45
* Created by PhpStorm

config/doctypes.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
22
defined('BASEPATH') OR exit('No direct script access allowed');
3-
43
$_doctypes = array(
54
'xhtml11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "https://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">',
65
'xhtml1-strict' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">',

config/rest_server.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?php
2-
32
defined('BASEPATH') or exit('No direct script access allowed');
43

54
/*

custom/HungNG_CI_Base_Hooks_Log_Query.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
defined('BASEPATH') or exit('No direct script access allowed');
23
/**
34
* Project codeigniter-framework
45
* Created by PhpStorm

helpers/codeigniter_modular.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
defined('BASEPATH') or exit('No direct script access allowed');
23
/**
34
* Project codeigniter-framework
45
* Created by PhpStorm

system/core/Format.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class CI_Format
5555
*
5656
* @var mixed
5757
*/
58-
protected $_data = [];
58+
protected $_data = array();
5959

6060
/**
6161
* Type to convert from.
@@ -134,7 +134,7 @@ public function to_array($data = null)
134134
$data = (array) $data;
135135
}
136136

137-
$array = [];
137+
$array = array();
138138
foreach ((array) $data as $key => $value) {
139139
if (is_object($value) === true || is_array($value) === true) {
140140
$array[$key] = $this->to_array($value);
@@ -241,7 +241,7 @@ public function to_html($data = null)
241241
} else {
242242
// Single array
243243
$headings = array_keys($data);
244-
$data = [$data];
244+
$data = array($data);
245245
}
246246

247247
// Load the table library
@@ -308,7 +308,7 @@ public function to_csv($data = null, $delimiter = ',', $enclosure = '"')
308308
} else {
309309
// Single array
310310
$headings = array_keys($data);
311-
$data = [$data];
311+
$data = array($data);
312312
}
313313

314314
// Apply the headings

thirdParty/MX/Loader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ public function view($view, $vars = array(), $return = false)
509509
}
510510

511511
if ($path != false) {
512-
$this->_ci_view_paths = [$path => true] + $this->_ci_view_paths;
512+
$this->_ci_view_paths = array($path => true) + $this->_ci_view_paths;
513513
$view = $_view;
514514
}
515515

thirdParty/REST/Format.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class Format
7272
*
7373
* @var mixed
7474
*/
75-
protected $_data = [];
75+
protected $_data = array();
7676

7777
/**
7878
* Type to convert from.
@@ -151,7 +151,7 @@ public function to_array($data = null)
151151
$data = (array) $data;
152152
}
153153

154-
$array = [];
154+
$array = array();
155155
foreach ((array) $data as $key => $value) {
156156
if (is_object($value) === true || is_array($value) === true) {
157157
$array[$key] = $this->to_array($value);
@@ -258,7 +258,7 @@ public function to_html($data = null)
258258
} else {
259259
// Single array
260260
$headings = array_keys($data);
261-
$data = [$data];
261+
$data = array($data);
262262
}
263263

264264
// Load the table library
@@ -325,7 +325,7 @@ public function to_csv($data = null, $delimiter = ',', $enclosure = '"')
325325
} else {
326326
// Single array
327327
$headings = array_keys($data);
328-
$data = [$data];
328+
$data = array($data);
329329
}
330330

331331
// Apply the headings

thirdParty/REST/Request.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public function getBodyParams()
9999
// PHP has already parsed the body so we have all params in $_POST
100100
$this->_bodyParams = $_POST;
101101
} else {
102-
$this->_bodyParams = [];
102+
$this->_bodyParams = array();
103103
mb_parse_str($this->getRawBody(), $this->_bodyParams);
104104
}
105105
}

thirdParty/REST/Response.php

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
*/
1010

1111
namespace nguyenanhung\CodeIgniter\BaseREST;
12+
1213
use Exception;
14+
1315
/**
1416
* Response Component based on CI_Output
1517
*
@@ -40,13 +42,13 @@ class Response
4042
/**
4143
* @var array the formatters that are supported by default
4244
*/
43-
public $contentTypes = [
44-
self::FORMAT_RAW => 'text/plain;',
45-
self::FORMAT_HTML => 'text/html;',
46-
self::FORMAT_JSON => 'application/json;', // RFC 4627
45+
public $contentTypes = array(
46+
self::FORMAT_RAW => 'text/plain;',
47+
self::FORMAT_HTML => 'text/html;',
48+
self::FORMAT_JSON => 'application/json;', // RFC 4627
4749
self::FORMAT_JSONP => 'application/javascript;', // RFC 4329
48-
self::FORMAT_XML => 'application/xml;', // RFC 2376
49-
];
50+
self::FORMAT_XML => 'application/xml;', // RFC 2376
51+
);
5052
/**
5153
* @var string the response format. This determines how to convert [[data]] into [[content]]
5254
* when the latter is not set. The value of this property must be one of the keys declared in the [[formatters]] array.
@@ -77,7 +79,7 @@ class Response
7779
function __construct()
7880
{
7981
// CI_Controller initialization
80-
$this->ci = & get_instance();
82+
$this->ci = &get_instance();
8183
}
8284

8385
/**
@@ -90,8 +92,7 @@ public function setFormat($format)
9092
$this->_format = $format;
9193
// Use formatter content type if exists
9294
if (isset($this->contentTypes[$this->_format])) {
93-
$this->ci->output
94-
->set_content_type($this->contentTypes[$this->_format]);
95+
$this->ci->output->set_content_type($this->contentTypes[$this->_format]);
9596
}
9697

9798
return $this;
@@ -101,7 +102,9 @@ public function setFormat($format)
101102
* Set Response Data into CI_Output
102103
*
103104
* @todo Format data before send
105+
*
104106
* @param mixed Response data
107+
*
105108
* @return object self
106109
*/
107110
public function setData($data)
@@ -136,12 +139,14 @@ public function getStatusCode()
136139
/**
137140
* Sets the response status code.
138141
* This method will set the corresponding status text if `$text` is null.
139-
* @param int $code the status code
142+
*
143+
* @param int $code the status code
140144
* @param string $text HTTP status text base on PHP http_response_code().
145+
*
141146
* @throws Exception if the status code is invalid.
142147
* @return $this the response object itself
143148
*/
144-
public function setStatusCode($code, $text=null)
149+
public function setStatusCode($code, $text = null)
145150
{
146151
if ($code === null) {
147152
$code = 200;
@@ -150,7 +155,7 @@ public function setStatusCode($code, $text=null)
150155
$this->_statusCode = (int) $code;
151156
// Check status code
152157
if ($this->getIsInvalid()) {
153-
throw new Exception("The HTTP status code is invalid: ". $this->_statusCode);
158+
throw new Exception("The HTTP status code is invalid: " . $this->_statusCode);
154159
}
155160
// Set HTTP status code with options
156161
if ($text) {
@@ -186,6 +191,7 @@ public function send()
186191
*
187192
* @param array Pre-handle array data
188193
* @param string Format
194+
*
189195
* @return string Formatted data by specified formatter
190196
*/
191197
public function format($data, $format)
@@ -197,8 +203,7 @@ public function format($data, $format)
197203
if (method_exists($this, $formatFunc)) {
198204

199205
$data = $this->{$formatFunc}($data);
200-
}
201-
elseif (is_array($data)) {
206+
} elseif (is_array($data)) {
202207
// Use JSON while the Formatter not found and the data is array
203208
$data = $this->formatJson($data);
204209
}
@@ -210,6 +215,7 @@ public function format($data, $format)
210215
* Common format funciton by format types. {FORMAT}Format()
211216
*
212217
* @param array Pre-handle array data
218+
*
213219
* @return string Formatted data
214220
*/
215221
public static function formatJson($data)
@@ -226,7 +232,7 @@ public static function formatJson($data)
226232
* @return string Response body data
227233
* @throws \Exception
228234
*/
229-
public function json($data, $statusCode=null)
235+
public function json($data, $statusCode = null)
230236
{
231237
// Set Status Code
232238
if ($statusCode) {
@@ -251,8 +257,9 @@ public function json($data, $statusCode=null)
251257
*
252258
* PSR-7 standard
253259
*
254-
* @param string $name Case-insensitive header field name to add.
260+
* @param string $name Case-insensitive header field name to add.
255261
* @param string|string[] $value Header value(s).
262+
*
256263
* @return self
257264
*/
258265
public function withAddedHeader($name, $value)

0 commit comments

Comments
 (0)