Skip to content

Commit a9e1a1e

Browse files
committed
IHF: Formatted.
1 parent 2d62ea8 commit a9e1a1e

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

README.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,35 @@ Provides Laravel-specific and pure PHP helper functions.
3434
- [Json](#json)
3535
- [is_json](#is_json)
3636
37+
## Db
38+
39+
#### `db_is_mysql()`
40+
41+
Checks if default database connection is `mysql` or not:
42+
```php
43+
if (db_is_mysql()) {
44+
// mysql-specific code here
45+
}
46+
```
47+
48+
#### `db_mysql_now()`
49+
50+
Returns database datetime, using `mysql` connection:
51+
```php
52+
$now = db_mysql_now();
53+
54+
// 2016-06-23 15:23:16
55+
```
56+
57+
#### `db_mysql_variable()`
58+
59+
Returns value of specified `mysql` variable, or `false` if variable doesn't exist:
60+
```php
61+
$hostname = db_mysql_variable('hostname');
62+
63+
// localhost
64+
```
65+
3766
## Dump
3867

3968
#### `get_dump()`
@@ -86,32 +115,3 @@ $decoded = is_json('{"foo":1,"bar":2,"baz":3}', true);
86115
87116
// ['foo' => 1, 'bar' => 2, 'baz' => 3]
88117
```
89-
90-
## Laravel
91-
92-
#### `db_is_mysql()`
93-
94-
Checks if default database connection is `mysql` or not:
95-
```php
96-
if (db_is_mysql()) {
97-
// mysql-specific code here
98-
}
99-
```
100-
101-
#### `db_mysql_now()`
102-
103-
Returns database datetime, using `mysql` connection:
104-
```php
105-
$now = db_mysql_now();
106-
107-
// 2016-06-23 15:23:16
108-
```
109-
110-
#### `db_mysql_variable()`
111-
112-
Returns value of specified `mysql` variable, or `false` if variable doesn't exist:
113-
```php
114-
$hostname = db_mysql_variable('hostname');
115-
116-
// localhost
117-
```

0 commit comments

Comments
 (0)