Skip to content

Commit cf49abe

Browse files
Hanisch-ITchriskacerguis
authored andcommitted
Codeigniter Composer Ready (#832)
* First steps for composer ready. Try to load Config/Language from this library if not existing in CI project * Add backward compatibility for Format * Add backward compatibility for Format * Add backward compatibility for Format * Update Readme Remove namespace for backward capability * Update Readme * Update readme - add language / config section
1 parent 944c1f3 commit cf49abe

File tree

4 files changed

+159
-92
lines changed

4 files changed

+159
-92
lines changed

README.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,19 @@ Please note that version 4.0.0 is in the works, and is considered a breaking cha
1818

1919
Take a look at the "development" branch to see what's up.
2020

21-
## Installation
21+
## Installation & loading
2222

23-
Drag and drop the **application/libraries/Format.php** and **application/libraries/REST_Controller.php** files into your application's directories. To use `require_once` it at the top of your controllers to load it into the scope. Additionally, copy the **rest.php** file from **application/config** in your application's configuration directory.
23+
CodeIgniter Rest Server is available on [Packagist](https://packagist.org/packages/hanischit/kraken-api) (using semantic versioning), and installation via composer is the recommended way to install Kraken-api. Just add this line to your `composer.json` file:
24+
25+
```json
26+
"chriskacerguis/codeigniter-restserver": "^3.0"
27+
```
28+
29+
or run
30+
31+
```sh
32+
composer require chriskacerguis/codeigniter-restserver
33+
```
2434

2535
## Handling Requests
2636

@@ -118,6 +128,16 @@ If you don't specify a response code, and the data you respond with `== FALSE` (
118128
$this->response([]); // HTTP 404 Not Found
119129
```
120130

131+
## Configuration
132+
133+
You can overwrite all default configurations by creating a rest.php file in your config folder with your configs.
134+
All given configurations will overwrite the default ones.
135+
136+
## Language
137+
138+
You can overwrite all default language files. Just add a rest_controller_lang.php to your language and overwrite the what you want.
139+
140+
121141
## Multilingual Support
122142

123143
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:

application/libraries/Format.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ public function to_csv($data = NULL, $delimiter = ',', $enclosure = '"')
378378

379379
// Close the handle
380380
fclose($handle);
381-
381+
382382
// Convert UTF-8 encoding to UTF-16LE which is supported by MS Excel
383383
$csv = mb_convert_encoding($csv, 'UTF-16LE', 'UTF-8');
384384

0 commit comments

Comments
 (0)