Skip to content

Commit f272a48

Browse files
committed
Explicit variable name for SYBASE
1 parent 65314dc commit f272a48

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,11 @@ The file is usualy found in **/etc/freetds/freetds.conf**. Set the configuration
9797
```
9898

9999
## Configuring the charset between the database and the application
100-
To configure the charset between the database and the application, add the fields `DATABASE_CHARSET` and `APPLICATION_CHARSET` in `.env` file, see the following example:
100+
To configure the charset between the database and the application, add the fields `SYBASE_DATABASE_CHARSET` and `SYBASE_APPLICATION_CHARSET` in `.env` file, see the following example:
101101

102102
```env
103-
DATABASE_CHARSET=CP850
104-
APPLICATION_CHARSET=UTF8
103+
SYBASE_DATABASE_CHARSET=CP850
104+
SYBASE_APPLICATION_CHARSET=UTF8
105105
```
106106
## Configuring the cache
107107
As the library consults table information whenever it receives a request, caching can be used to avoid excessive queries

src/Database/Connection.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,8 @@ private function compileNewQuery($query, $bindings)
361361
$newQuery = join(array_map(fn($k1, $k2) => $k1.$k2, $partQuery, $bindings));
362362
$newQuery = str_replace('[]', '', $newQuery);
363363

364-
$db_charset = env('DATABASE_CHARSET');
365-
$app_charset = env('APPLICATION_CHARSET');
364+
$db_charset = env('SYBASE_DATABASE_CHARSET');
365+
$app_charset = env('SYBASE_APPLICATION_CHARSET');
366366

367367
if($db_charset && $app_charset) {
368368
$newQuery = mb_convert_encoding($newQuery, $db_charset, $app_charset);
@@ -397,8 +397,8 @@ public function select($query, $bindings = [], $useReadPdo = true)
397397

398398
$result = $statement->fetchAll($this->getFetchMode());
399399

400-
$db_charset = env('DATABASE_CHARSET');
401-
$app_charset = env('APPLICATION_CHARSET');
400+
$db_charset = env('SYBASE_DATABASE_CHARSET');
401+
$app_charset = env('SYBASE_APPLICATION_CHARSET');
402402

403403
if($db_charset && $app_charset) {
404404
foreach($result as &$r) {

0 commit comments

Comments
 (0)