Skip to content

Commit 233650c

Browse files
committed
composer.json update
1 parent 35d4bf3 commit 233650c

File tree

15 files changed

+492
-453
lines changed

15 files changed

+492
-453
lines changed

README.md

Lines changed: 59 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,29 @@
1-
# php-mysql-connectors
1+
# Slvler - php-mysql-connectors
22

3+
Mysql driver development that can be used on the php side
34

4-
PHP Mysql Connectors
55

6+
## Installation
7+
8+
To install this package tou can use composer:
9+
10+
```bash
11+
composer require slvler/mysql-connectors
12+
```
13+
14+
## Usage
615

7-
Initialize
8-
------------
916
```php
10-
<?php
11-
define('DBHost', 'localhost');
12-
define('DBName', 'northwind');
13-
define('DBUser', 'root');
14-
define('DBPassword', '');
15-
define("connection","connection");
16-
$db = new DatabaseController(DBHost, DBName, DBUser, DBPassword,connection);
17-
18-
?>
17+
18+
use slvler\mysqlconnectors\Constant;
19+
use slvler\mysqlconnectors\Config\Method;
20+
use slvler\mysqlconnectors\Database\DatabaseController;
21+
22+
23+
$Constant = new Constant();
24+
25+
$db = new DatabaseController($Constant->showDBHost(), $Constant->showDBName(), $Constant->showDBUser(), $Constant->showDBPassword(), $Constant->showConnection());
26+
1927
```
2028

2129

@@ -51,19 +59,17 @@ $data = Array
5159
);
5260
```
5361

54-
```php
55-
Insert Method
56-
<?php
57-
$methodInsert = $method->Insert($tableName,$data);
58-
?>
59-
```
6062

63+
### Insert Method
6164

6265

66+
```php
6367

64-
#### Update Method (TableName, Id = array() , Data = array()):
68+
$methodInsert = $method->Insert($tableName,$data);
6569

70+
```
6671

72+
#### Update Method (TableName, Id = array() , Data = array()):
6773

6874
TableName, Id , Data:
6975

@@ -82,19 +88,15 @@ $data = Array
8288
);
8389
```
8490

85-
```php
86-
Update Method
87-
<?php
88-
$methodUpdate = $method->Update($tableName', $id, $data);
89-
?>
90-
```
91-
92-
91+
### Update Method
9392

93+
```php
9494

95+
$methodUpdate = $method->Update($tableName', $id, $data);
9596

97+
```
9698

97-
#### Delete Method (TableName, Id = array()):
99+
### Delete Method (TableName, Id = array()):
98100

99101
TableName, Id:
100102

@@ -107,34 +109,36 @@ $Id = array(
107109

108110
```
109111

112+
### Delete Method
113+
110114
```php
111-
Delete Method
112-
<?php
115+
113116
$methodDelete = $method->Delete($tableName,$id);
114-
?>
117+
115118
```
116119

117120

118121

119-
#### Select_all Method (TableName):
122+
### Select_all Method (TableName):
120123

121124
TableName:
122125

123126
```php
124127
$tableName = "Orders";
125128
```
126129

130+
### Select_all Method
131+
127132
```php
128-
Select_all Method
129-
<?php
133+
130134
$methodSelectAll = $method->Select_all($tableName);
131-
?>
135+
132136
```
133137

134138

135139

136140

137-
#### Select_ch Method (TableName, Data = array()):
141+
### Select_ch Method (TableName, Data = array()):
138142

139143
TableName, Data:
140144

@@ -148,11 +152,12 @@ $data = Array
148152

149153
```
150154

155+
### Select_ch Method
156+
151157
```php
152-
Select_ch Method
153-
<?php
158+
154159
$methodSelectCh = $method->Select_ch($tableName,$data);
155-
?>
160+
156161
```
157162

158163

@@ -180,17 +185,28 @@ $if = Array
180185

181186
```
182187

188+
189+
### Select_wh Method
190+
183191
```php
184-
Select_wh Method
185-
<?php
192+
186193
$methodSelectWh = $method->Select_wh($tableName, $data, $conn, $if);
187-
?>
194+
188195
```
189196

190197

191198

199+
### Testing
200+
201+
```bash
202+
vendor\bin\phpunit
203+
```
192204

205+
## Credits
193206

207+
- [slvler](https://github.com/slvler)
194208

195209

210+
## License
196211

212+
The MIT License (MIT). Please see [License File](https://github.com/slvler/slvler/blob/main/LICENSE.md) for more information.

composer.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "slvler/mysql-connectors",
3+
"license": "MIT",
4+
"description": "Mysql driver development that can be used on the php side",
5+
"type": "package",
6+
"authors": [
7+
{
8+
"name": "slvler",
9+
"email": "[email protected]"
10+
}
11+
],
12+
"autoload": {
13+
"psr-4": {
14+
"slvler\\mysqlconnectors\\": "src/"
15+
}
16+
},
17+
"autoload-dev": {
18+
"psr-4": {
19+
"slvler\\mysqlconnectors\\Tests\\": "tests/"
20+
}
21+
},
22+
"require": {},
23+
"require-dev": {
24+
"phpunit/phpunit": "^9.5"
25+
},
26+
"scripts": {
27+
"test": "vendor/bin/phpunit tests"
28+
},
29+
"minimum-stability": "dev",
30+
"prefer-stable": true
31+
}

example/index.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
require __DIR__ . '/../vendor/autoload.php';
4+
5+
6+
use slvler\mysqlconnectors\Constant;
7+
use slvler\mysqlconnectors\Config\Method;
8+
use slvler\mysqlconnectors\Database\DatabaseController;
9+
10+
11+
$Constant = new Constant();
12+
13+
$db = new DatabaseController($Constant->showDBHost(), $Constant->showDBName(), $Constant->showDBUser(), $Constant->showDBPassword(), $Constant->showConnection());
14+
15+
$connection = $db->MysqlConnection();
16+
$method = new Method($connection);
17+
18+
$example = $method->Select_all("orders");
19+
20+
21+
22+
$data = array(
23+
'ShipName' => "deneme",
24+
'ShipAddress' => "deneme",
25+
'ShipCity' => "deneme"
26+
);
27+
28+
$method = $method->Insert("orders",$data);
29+
30+
?>

phpunit.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
4+
bootstrap="vendor/autoload.php"
5+
colors="true"
6+
>
7+
<testsuites>
8+
<testsuite name="Connection">
9+
<directory>tests</directory>
10+
</testsuite>
11+
</testsuites>
12+
</phpunit>
Lines changed: 43 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,44 @@
1-
<?php
2-
3-
namespace qwerty\Config;
4-
5-
class Method extends Sql {
6-
7-
public $connection;
8-
9-
10-
public function __construct($connection){
11-
parent::__construct($connection);
12-
}
13-
14-
public function Select_ch($table,$data = array())
15-
{
16-
return parent::Select_ch($table,$data);
17-
}
18-
19-
public function Select_all($table){
20-
return parent::Select_all($table);
21-
}
22-
23-
public function Select_wh($table, $data = array(),$con = array(), $if = array())
24-
{
25-
return parent::Select_wh($table, $data, $con, $if); // TODO: Change the autogenerated stub
26-
}
27-
28-
public function Insert($table, $data = array())
29-
{
30-
return parent::Insert($table, $data); // TODO: Change the autogenerated stub
31-
}
32-
33-
public function Update($table, $id = array(), $data = array())
34-
{
35-
return parent::Update($table, $id, $data); // TODO: Change the autogenerated stub
36-
}
37-
public function Delete($table, $id = array())
38-
{
39-
return parent::Delete($table, $id); // TODO: Change the autogenerated stub
40-
}
41-
42-
43-
}
44-
45-
1+
<?php
2+
3+
namespace slvler\mysqlconnectors\Config;
4+
5+
class Method extends Sql {
6+
7+
public $connection;
8+
9+
10+
public function __construct($connection){
11+
parent::__construct($connection);
12+
}
13+
14+
public function Select_ch($table,$data = array())
15+
{
16+
return parent::Select_ch($table,$data);
17+
}
18+
19+
public function Select_all($table){
20+
return parent::Select_all($table);
21+
}
22+
23+
public function Select_wh($table, $data = array(),$con = array(), $if = array())
24+
{
25+
return parent::Select_wh($table, $data, $con, $if); // TODO: Change the autogenerated stub
26+
}
27+
28+
public function Insert($table, $data = array())
29+
{
30+
return parent::Insert($table, $data); // TODO: Change the autogenerated stub
31+
}
32+
33+
public function Update($table, $id = array(), $data = array())
34+
{
35+
return parent::Update($table, $id, $data); // TODO: Change the autogenerated stub
36+
}
37+
public function Delete($table, $id = array())
38+
{
39+
return parent::Delete($table, $id); // TODO: Change the autogenerated stub
40+
}
41+
}
42+
43+
4644
?>

0 commit comments

Comments
 (0)