|
3 | 3 | A fully RESTful server implementation for CodeIgniter using one library, one |
4 | 4 | config file and one controller. |
5 | 5 |
|
6 | | -## Sponsored by: Coding Futures |
7 | | - |
8 | 6 | ## Requirements |
9 | 7 |
|
10 | | -1. PHP 5.2+ |
| 8 | +1. PHP 5.2 or greater |
11 | 9 | 2. CodeIgniter 2.1.0 to 3.0-dev |
12 | 10 |
|
13 | 11 | _Note: for 1.7.x support download v2.2 from Downloads tab_ |
@@ -53,7 +51,7 @@ This means your URLs can look like this: |
53 | 51 | http://example.com/books.json |
54 | 52 | http://example.com/books?format=json |
55 | 53 |
|
56 | | -Alternatively (and recommend) is using the HTTP `Accept` header, which is built for this purpose: |
| 54 | +This can be flaky with URI segments, so the recommend approach is using the HTTP `Accept` header: |
57 | 55 |
|
58 | 56 | $ curl -H "Accept: application/json" http://example.com |
59 | 57 |
|
@@ -85,19 +83,19 @@ If you don't specify a response code, and the data you respond with `== FALSE` ( |
85 | 83 |
|
86 | 84 | ## Multilingual Support |
87 | 85 |
|
88 | | -If your application uses language files to support multiple locales, `REST_Controller` will automatically parse the HTTP `Accept-Language` header and provide the language(s) in your actions. This information can be found in the `$this->request->lang` object: |
| 86 | +If your application uses language files to support multiple locales, `REST_Controller` will automatically parse the HTTP `Accept-Language` header and provide the language(s) in your actions. This information can be found in the `$this->response->lang` object: |
89 | 87 |
|
90 | 88 | public function __construct() |
91 | 89 | { |
92 | 90 | parent::__construct(); |
93 | 91 |
|
94 | | - if (is_array($this->request->lang)) |
| 92 | + if (is_array($this->response->lang)) |
95 | 93 | { |
96 | | - $this->load->language('application', $this->request->lang[0]); |
| 94 | + $this->load->language('application', $this->response->lang[0]); |
97 | 95 | } |
98 | 96 | else |
99 | 97 | { |
100 | | - $this->load->language('application', $this->request->lang); |
| 98 | + $this->load->language('application', $this->response->lang); |
101 | 99 | } |
102 | 100 | } |
103 | 101 |
|
@@ -148,11 +146,27 @@ By default, the HTTP will be `X-API-KEY`. This can be configured in **config/res |
148 | 146 |
|
149 | 147 | ## Change Log |
150 | 148 |
|
| 149 | +### 2.6.2 |
| 150 | + |
| 151 | +* Update CodeIgniter files to 2.1.3 |
| 152 | +* Fixed issue #165 |
| 153 | + |
| 154 | +### 2.6.1 |
| 155 | + |
| 156 | +* Update CodeIgniter files to 2.1.2 |
| 157 | +* Log Table support for IPv6 & NULL parameters |
| 158 | +* Abstract out the processes of firing a controller method within _remap() to an separate method |
| 159 | +* Moved GET, POST, PUT, and DELETE parsing to separate methods, allowing them to be overridden as needed |
| 160 | +* Small bugfix for a PHP 5.3 strlen error |
| 161 | +* Fixed some PHP 5.4 warnings |
| 162 | +* Fix for bug in Format.php's to_html() which failed to detect if $data was really a multidimensional array. |
| 163 | +* Fix for empty node on XML output format, for false = 0, true = 1. |
| 164 | + |
151 | 165 | ### 2.6.0 |
152 | 166 |
|
153 | 167 | * Added loads of PHPDoc comments. |
154 | 168 | * Response where method doesn't exist is now "HTTP 405 Method Not Allowed", not "HTTP 404 Not Found". |
155 | | -* Compatable with PHP 5.4. |
| 169 | +* Compatible with PHP 5.4. |
156 | 170 | * Added support for gzip compression. |
157 | 171 | * Fix the apache\_request\_header function with CGI. |
158 | 172 | * Fixed up correctly .foo extensions to work when get arguments provided. |
@@ -198,7 +212,12 @@ By default, the HTTP will be `X-API-KEY`. This can be configured in **config/res |
198 | 212 | * key => FALSE can now be used to override the keys_enabled option for a specific method, and level is now optional. If no level is set it will assume the method has a level of 0. |
199 | 213 | * Fixed issue where calls to ->get('foo') would error is foo was not set. Reported by Paul Barto. |
200 | 214 |
|
201 | | -## Donations |
| 215 | +## Contributions |
| 216 | + |
| 217 | +This project has been funded and made possible through my clients kindly allowing me to |
| 218 | +open-source the functionality as I build it into their projects. I am no longer actively developing |
| 219 | +features for this as I no longer require it, but I will continue to maintain pull requests and try to |
| 220 | +fix issues as and when they are reported (within a week or two). |
202 | 221 |
|
203 | | -If my REST Server has helped you out, or you'd like me to do some custom work on it, [please sponsor me](http://pledgie.com/campaigns/8328) |
204 | | -so I can keep working on this and other CodeIgniter projects for you all. |
| 222 | +Pull Requests are the best way to fix bugs or add features. I know loads of you use this, so please |
| 223 | +contribute if you have improvements to be made and I'll keep releasing versions over time. |
0 commit comments