Skip to content

Commit 5d277d6

Browse files
committed
sql dumper project file create
1 parent e519542 commit 5d277d6

File tree

11 files changed

+122
-173
lines changed

11 files changed

+122
-173
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
github: :vendor_name
1+
github: FurkiFor

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
blank_issues_enabled: false
22
contact_links:
33
- name: Ask a question
4-
url: https://github.com/:vendor_name/:package_name/discussions/new?category=q-a
4+
url: https://github.com/FurkiFor/sql-dumper/discussions/new?category=q-a
55
about: Ask the community for help
66
- name: Request a feature
7-
url: https://github.com/:vendor_name/:package_name/discussions/new?category=ideas
7+
url: https://github.com/FurkiFor/sql-dumper/discussions/new?category=ideas
88
about: Share ideas for new features
99
- name: Report a bug
10-
url: https://github.com/:vendor_name/:package_name/issues/new
10+
url: https://github.com/FurkiFor/sql-dumper/issues/new
1111
about: Report a reproducable bug

.github/SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Security Policy
22

3-
If you discover any security related issues, please email author@domain.com instead of using the issue tracker.
3+
If you discover any security related issues, please email furkan.unsal@teksenbilisim.com instead of using the issue tracker.

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Changelog
22

3-
All notable changes to `:package_name` will be documented in this file.
3+
All notable changes to `sql-dumper` will be documented in this file.
44

55
## 1.0.0 - 202X-XX-XX
66

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) :vendor_name <author@domain.com>
3+
Copyright (c) FurkiFor <furkan.unsal@teksenbilisim.com>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# :package_description
1+
# This is my package SqlDumper
22

3-
[![Latest Version on Packagist](https://img.shields.io/packagist/v/vendor_slug/package_slug.svg?style=flat-square)](https://packagist.org/packages/vendor_slug/package_slug)
4-
[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/vendor_slug/package_slug/run-tests?label=tests)](https://github.com/vendor_slug/package_slug/actions?query=workflow%3ATests+branch%3Amaster)
5-
[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/vendor_slug/package_slug/Check%20&%20fix%20styling?label=code%20style)](https://github.com/vendor_slug/package_slug/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amaster)
6-
[![Total Downloads](https://img.shields.io/packagist/dt/vendor_slug/package_slug.svg?style=flat-square)](https://packagist.org/packages/vendor_slug/package_slug)
3+
[![Latest Version on Packagist](https://img.shields.io/packagist/v/furkifor/sql_dumper.svg?style=flat-square)](https://packagist.org/packages/furkifor/sql_dumper)
4+
[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/furkifor/sql_dumper/run-tests?label=tests)](https://github.com/furkifor/sql_dumper/actions?query=workflow%3ATests+branch%3Amaster)
5+
[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/furkifor/sql_dumper/Check%20&%20fix%20styling?label=code%20style)](https://github.com/furkifor/sql_dumper/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amaster)
6+
[![Total Downloads](https://img.shields.io/packagist/dt/furkifor/sql_dumper.svg?style=flat-square)](https://packagist.org/packages/furkifor/sql_dumper)
77

88
---
99
This package can be used as to scaffold a Laravel package. Follow these steps to get started:
1010

11-
1. Press the "Use template" button at the top of this repo to create a new repo with the contents of this skeleton
11+
1. Press the "Use template" button at the top of this repo to create a new repo with the contents of this sql_dumper
1212
2. Run "./configure.sh" to run a script that will replace all placeholders throughout all the files
1313
3. Have fun creating your package.
1414
4. If you need help creating a package, consider picking up our <a href="https://laravelpackage.training">Laravel Package Training</a> video course.
@@ -18,7 +18,7 @@ This is where your description should go. Try and limit it to a paragraph or two
1818

1919
## Support us
2020

21-
[<img src="https://github-ads.s3.eu-central-1.amazonaws.com/:package_name.jpg?t=1" width="419px" />](https://spatie.be/github-ad-click/:package_name)
21+
[<img src="https://github-ads.s3.eu-central-1.amazonaws.com/sql-dumper.jpg?t=1" width="419px" />](https://spatie.be/github-ad-click/sql-dumper)
2222

2323
We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).
2424

@@ -29,14 +29,14 @@ We highly appreciate you sending us a postcard from your hometown, mentioning wh
2929
You can install the package via composer:
3030

3131
```bash
32-
composer require vendor_slug/package_slug
32+
composer require furkifor/sql_dumper
3333
```
3434

3535
## Usage
3636

3737
```php
38-
$skeleton = new VendorName\Skeleton();
39-
echo $skeleton->echoPhrase('Hello, VendorName!');
38+
$sql_dumper = new Furkifor\SqlDumper();
39+
echo $sql_dumper->echoPhrase('Hello, Furkifor!');
4040
```
4141

4242
## Testing
@@ -59,7 +59,7 @@ Please review [our security policy](../../security/policy) on how to report secu
5959

6060
## Credits
6161

62-
- [:author_name](https://github.com/:author_username)
62+
- [furkan](https://github.com/FurkiFor)
6363
- [All Contributors](../../contributors)
6464

6565
## License

composer.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
{
2-
"name": "vendor_slug/package_slug",
3-
"description": ":package_description",
2+
"name": "furkifor/sql_dumper",
3+
"description": "This is my package SqlDumper",
44
"keywords": [
5-
":vendor_name",
6-
"package_slug"
5+
"FurkiFor",
6+
"sql_dumper"
77
],
8-
"homepage": "https://github.com/vendor_slug/package_slug",
8+
"homepage": "https://github.com/furkifor/sql_dumper",
99
"license": "MIT",
1010
"authors": [
1111
{
12-
"name": ":author_name",
13-
"email": "author@domain.com",
12+
"name": "furkan",
13+
"email": "furkan.unsal@teksenbilisim.com",
1414
"role": "Developer"
1515
}
1616
],
1717
"require": {
18-
"php": "^8.0"
18+
"php": "^7.2"
1919
},
2020
"require-dev": {
2121
"friendsofphp/php-cs-fixer": "^2.17",
@@ -25,12 +25,12 @@
2525
},
2626
"autoload": {
2727
"psr-4": {
28-
"VendorName\\Skeleton\\": "src"
28+
"Furkifor\\SqlDumper\\": "src"
2929
}
3030
},
3131
"autoload-dev": {
3232
"psr-4": {
33-
"VendorName\\Skeleton\\Tests\\": "tests"
33+
"Furkifor\\SqlDumper\\Tests\\": "tests"
3434
}
3535
},
3636
"scripts": {

configure-skeleton.sh

Lines changed: 0 additions & 136 deletions
This file was deleted.

src/SkeletonClass.php

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/SqlDumperClass.php

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<?php
2+
3+
namespace Furkifor\SqlDumper;
4+
5+
6+
use Furkifor\SqlDumper\SqlQuery;
7+
8+
9+
class SqlDumperClass
10+
{
11+
public $query;
12+
public $table;
13+
public $FirstWhere;
14+
public $where;
15+
public $orderBy;
16+
public $limit;
17+
public $select;
18+
public $whereCount;
19+
public $with;
20+
21+
function __construct($table)
22+
{
23+
24+
$this->table = $table;
25+
$this->query = '';
26+
$this->select = '';
27+
$this->FirstWhere = '';
28+
$this->where = '';
29+
$this->orderBy = '';
30+
$this->limit = '';
31+
$this->with = '';
32+
$this->whereCount = 0;
33+
34+
}
35+
36+
37+
public function select(string $select = '*')
38+
{
39+
$this->select = "SELECT $select FROM ";
40+
return $this;
41+
}
42+
43+
44+
public function orderBy($variable, $type)
45+
{
46+
$this->orderBy .= " ORDER BY $variable $type ";
47+
return $this;
48+
}
49+
50+
public function where($where)
51+
{
52+
53+
if ($this->whereCount == 0) {
54+
55+
$this->where .= " WHERE $where ";
56+
$this->whereCount = 1;
57+
58+
} else {
59+
60+
$this->where .= " and $where ";
61+
62+
}
63+
64+
return $this;
65+
}
66+
67+
public function with($with, $sql)
68+
{
69+
70+
$this->with .= preg_replace('/this/i', $this->table, ' ' . $with . ' JOIN ' . $sql);
71+
return $this;
72+
73+
}
74+
75+
76+
public function limit($count)
77+
{
78+
$this->limit .= " LIMIT $count ";
79+
return $this;
80+
}
81+
82+
public function get()
83+
{
84+
return print_r(@$this->select . @$this->table . @$this->with . @$this->where . @$this->orderBy . @$this->limit)[0];
85+
86+
87+
}
88+
89+
90+
}
91+

0 commit comments

Comments
 (0)