Skip to content

Commit

Permalink
update upgrade notes for 6.x
Browse files Browse the repository at this point in the history
  • Loading branch information
harikt committed Jan 22, 2025
1 parent 7f94cab commit 2a7385b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ Whereas the native _PDO_ connects on instantiation, _ExtendedPdo_ does not
connect immediately. Instead, it connects only when you call a method that
actually needs the connection to the database; e.g., on `query()`.

If you want to force a connection, call the `establishConnection()` method.
If you want to force a connection, call the `lazyConnect()` method.

> Previous `connect()` method has been deprecated due to the introduction of
> ```PDO::connect()``` in [PHP 8.4](https://www.php.net/releases/8.4/en.php#pdo_driver_specific_subclasses),
> so we encourage users to use `establishConnection()` instead.
> Previous `connect()` method has been deprecated due to the introduction of
> ```PDO::connect()``` in [PHP 8.4](https://www.php.net/releases/8.4/en.php#pdo_driver_specific_subclasses),
> so we encourage users to use `lazyConnect()` instead.
```php
// does not connect to the database
Expand All @@ -46,7 +46,7 @@ $pdo = new ExtendedPdo(
$pdo->exec('SELECT * FROM test');

// explicitly forces a connection
$pdo->establishConnection();
$pdo->lazyConnect();
```

If you want to explicitly force a disconnect, call the `disconnect()` method.
Expand Down
4 changes: 2 additions & 2 deletions docs/upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ $pdo->exec('SELECT * FROM test');
// explicitly forces a connection
$pdo->connect();
```
... and now needs to be changed to `ExtendedPdo::establishConnection()`
... and now needs to be changed to `ExtendedPdo::lazyConnect()`

```php
// does not connect to the database
Expand All @@ -36,7 +36,7 @@ $pdo = new ExtendedPdo(
$pdo->exec('SELECT * FROM test');

// explicitly forces a connection
$pdo->establishConnection();
$pdo->lazyConnect();
```

# 3.x Upgrade Notes
Expand Down
4 changes: 2 additions & 2 deletions src/ExtendedPdo.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function __construct(
*
* Connects to the database.
*
* @deprecated use establishConnection() as future versions will be using establishConnection()
* @deprecated use lazyConnect() as future versions will be using lazyConnect()
*
* @return void
*/
Expand Down Expand Up @@ -117,7 +117,7 @@ public function connect(): void
*
* @return void
*/
public function establishConnection(): void
public function lazyConnect(): void
{
$this->connect();
}
Expand Down

0 comments on commit 2a7385b

Please sign in to comment.