Skip to content

Commit 68e18b8

Browse files
committed
updates/corrections, and added feature - call methods without table name
- `selecting`, and new `inserting` methods, can be called without table name, only the other necessary parameters: - The Table *name* with *prefix*, can be preset/stored with methods `tableSetup(name, prefix), or setTable(name), setPrefix(append)`, if called without presetting, `false` is returned. - This **feature** will be added to **all** database access methods, each method name will have an `ing` ending added. In reference to #198
1 parent 08b0e6c commit 68e18b8

File tree

13 files changed

+750
-316
lines changed

13 files changed

+750
-316
lines changed

README.md

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,27 @@
1010

1111
***A class to make it very easy to deal with database connections.***
1212

13-
This is a [WIP] of [__version 5__](https://github.com/ezSQL/ezsql/tree/v5) which will break users of **version 4**, mainly by the use of `namespace` in the `global` functions **ezFunctions.php** file.
14-
15-
Usage of the **global** functions will require the user to begin a `.php` file something like:
16-
17-
```php
18-
use function ezsql\functions\where;
19-
// Or
20-
use function ezsql\functions\{
21-
getInstance,
22-
select,
23-
insert,
24-
};
25-
```
13+
This is a [WIP] of [__version 5__](https://github.com/ezSQL/ezsql/tree/v5) which will break users of **version 4**.
14+
15+
Mainly by:
16+
- The use of `namespace` in the `global` functions **ezFunctions.php** file.
17+
Usage of the **global** functions will require the user to begin a `.php` file something like:
18+
19+
```php
20+
use function ezsql\functions\where;
21+
// Or
22+
use function ezsql\functions\{
23+
getInstance,
24+
selecting,
25+
inserting,
26+
};
27+
```
28+
- Class properties that was accessible by magic methods `get/set`, now PSR 1 camelCase.
29+
- Renamed `select` of `ez_mysqli` to `dbSelect`.
30+
- Renamed class method and behavior of `selecting` to `select`.
31+
- `selecting`, and new `inserting` methods, can be called without table name, only the other necessary parameters:
32+
- The Table *name* with *prefix*, can be preset/stored with methods `tableSetup(name, prefix), or setTable(name), setPrefix(append)`, if called without presetting, `false` is returned.
33+
- This **feature** will be added to **all** database access methods, each method name will have an `ing` ending added.
2634

2735
[__version 4__](https://github.com/ezSQL/ezsql/tree/v4) has many modern programming practices in which will break users of version 3.
2836

lib/Config.php

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,6 @@
88
use ezsql\ConfigAbstract;
99
use ezsql\ConfigInterface;
1010

11-
/**
12-
* @method void setDriver($args);
13-
* @method void setDsn($args);
14-
* @method void setUser($args);
15-
* @method void setPassword($args);
16-
* @method void setName($args);
17-
* @method void setHost($args);
18-
* @method void setPort($args);
19-
* @method void setCharset($args);
20-
* @method void setOptions($args);
21-
* @method void setIsFile($args);
22-
* @method void setToMssql($args);
23-
* @method void setPath($args);
24-
*
25-
* @method string getDriver();
26-
* @method string getDsn();
27-
* @method string getUser();
28-
* @method string getPassword()
29-
* @method string getName();
30-
* @method string getHost();
31-
* @method string getPort();
32-
* @method string getCharset();
33-
* @method string getOptions();
34-
* @method bool getIsFile();
35-
* @method bool getToMssql();
36-
* @method string getPath();
37-
*/
3811
class Config extends ConfigAbstract implements ConfigInterface
3912
{
4013
public function __construct(string $driver = '', array $arguments = null)

lib/Database/ez_pdo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ public function query(string $query, bool $use_prepare = false)
450450

451451
if ($this->processQuery($query, $param) === false) {
452452
if ($this->isTransactional)
453-
throw new \PDOException($this->getLast_Error());
453+
throw new \PDOException($this->getLastError());
454454

455455
return false;
456456
}

lib/Database/ez_pgsql.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ public function query(string $query, bool $use_prepare = false)
312312

313313
if ($this->processQueryResult($query) === false) {
314314
if ($this->isTransactional)
315-
throw new \Exception($this->getLast_Error());
315+
throw new \Exception($this->getLastError());
316316

317317
return false;
318318
}

lib/Database/ez_sqlite3.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public function query_prepared(string $query, array $param = null)
147147
$stmt = $this->dbh->prepare($query);
148148
if (!$stmt instanceof \SQLite3Stmt) {
149149
if ($this->isTransactional)
150-
throw new \Exception($this->getLast_Error());
150+
throw new \Exception($this->getLastError());
151151

152152
return false;
153153
}
@@ -289,7 +289,7 @@ public function query(string $query, bool $use_prepare = false)
289289

290290
if ($this->processQueryResult($query) === false) {
291291
if ($this->isTransactional)
292-
throw new \Exception($this->getLast_Error());
292+
throw new \Exception($this->getLastError());
293293

294294
return false;
295295
}

lib/Database/ez_sqlsrv.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ public function query(string $query, bool $use_prepare = false)
314314

315315
if ($this->processQueryResult($query) === false) {
316316
if ($this->isTransactional)
317-
throw new \Exception($this->getLast_Error());
317+
throw new \Exception($this->getLastError());
318318

319319
return false;
320320
}

0 commit comments

Comments
 (0)