Skip to content

Commit d0f772b

Browse files
committed
update docs
1 parent 0bd4067 commit d0f772b

File tree

3 files changed

+33
-17
lines changed

3 files changed

+33
-17
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
[![codecov](https://codecov.io/gh/ezSQL/ezSQL/branch/v4/graph/badge.svg)](https://codecov.io/gh/ezSQL/ezSQL)
66
[![Maintainability](https://api.codeclimate.com/v1/badges/0071eb99ab4f5ac5b1f2/maintainability)](https://codeclimate.com/github/ezSQL/ezSQL/maintainability)
77

8-
***Class to make it very easy to deal with database connections.***
8+
***A class to make it very easy to deal with database connections.***
99

1010
This is [__version 4__](https://github.com/ezSQL/ezSQL/tree/v4) that has many modern programming practices in which will break users of version 3.
1111

1212
[__Version 3__](https://github.com/ezSQL/ezSQL/tree/v3) broke version 2.1.7 in one major way, it required *PHP 5.6*. Which drop mysql extension support, other than that, nothing as far using the library was changed, only additional features.
1313

14-
This library has an `Database` class, a combination of the [Factory](https://en.wikipedia.org/wiki/Factory_method_pattern) pattern with an [Dependency Injection](https://en.wikipedia.org/wiki/Dependency_injection) container hosting. The library is following many OOP principles, one in which, properties public access has been removed.
14+
This library has an `Database` class, an combination of the [Factory](https://en.wikipedia.org/wiki/Factory_method_pattern) pattern with an [Dependency Injection](https://en.wikipedia.org/wiki/Dependency_injection) container hosting. This library now is following many OOP principles, one in which, the methods properties public access has been removed. This library also following PSR-2, PSR-4, and PSR-11 conventions.
1515

1616
* More Todo...
1717

@@ -40,4 +40,6 @@ $setting = new Config('****', [$dsn_path_user, $password, $database, $other_sett
4040
$db = new ez_****($settings);
4141
```
4242

43+
$db->query_prepared($query_string, $param_array);
44+
4345
**For** **[Authors/Contributors](https://github.com/ezsql/ezsql/CONTRIBUTORS.md)**

WIKI.md

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -161,32 +161,38 @@ This version further break things introduced in version 3 that broke version 2.1
161161
____Installation and Usage____
162162
---
163163

164-
Note: __****__ is one of '**mysqli**, **pgsql**, **sqlsrv**, **sqlite3**, or **Pdo**'.
165164

166165
Either: ***for version 3.x***
167166

168-
composer require ezsql/ezsql=^3.1.0
169-
require 'vendor/autoload.php';
170-
---------
171-
// Manually download https://github.com/ezSQL/ezSQL/archive/v3.zip and extract.
172-
require 'ez_sql_loader.php';
173-
---------
167+
composer require ezsql/ezsql=^3.1.2
174168

175-
$db = new ezSQL_****(user, password, database, or, other settings);
169+
```php
170+
require 'vendor/autoload.php';
171+
```
172+
```php
173+
// Manually download https://github.com/ezSQL/ezSQL/archive/v3.zip and extract.
174+
require 'ez_sql_loader.php';
175+
```
176+
```php
177+
$db = new ezSQL_****(user, password, database, or, other settings);
178+
```
176179

177180
Or: ***for version 4.x***
178181

179182
// composer is required for version 4
180183
composer require ezsql/ezsql
181-
require 'vendor/autoload.php';
182-
---------
183184

184-
$db = Database::initialize('****', [user, password, database, or, other settings], **optional storage tag);
185+
```php
186+
require 'vendor/autoload.php';
187+
188+
$db = Database::initialize('****', [user, password, database, other settings], **optional tag);
185189

186-
Is same as:
190+
// Is same as:
191+
$setting = new Config('****', [user, password, database, other settings]);
192+
$db = new ez_****($settings);
193+
```
187194

188-
$setting = new Config('****', [user, password, database, or, other settings]);
189-
$db = new ez_****($settings);
195+
>Note: __****__ is one of **mysqli**, **pgsql**, **sqlsrv**, **sqlite3**, or **Pdo**.
190196
191197
**ezsql** functions
192198
---

lib/DatabaseInterface.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,15 @@ public function escape(string $str);
5454
public function sysDate();
5555

5656
/**
57-
* Creates a prepared query, binds the given parameters and returns the result of the executed
57+
* Creates a prepared query, binds the given parameters and returns the result of the executed.
58+
*
59+
* Supplying the the whole query string, and placing '?' within,
60+
* then the same number of arguments in an array.
61+
*
62+
* Example:
63+
* `query_prepared('INSERT INTO unit_test(id, test_key) VALUES(1, ?)', ['test 1']);`
64+
*
65+
* - It will determine arguments type, execute, and return results.
5866
*
5967
* @param string $query
6068
* @param array $param

0 commit comments

Comments
 (0)