-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit f4a12e2
Showing
75 changed files
with
5,835 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
TOKEN=geFromApp | ||
CRYPT_TOKEN=genFromApp | ||
|
||
# Database | ||
DB_HOST=127.0.0.1 | ||
DB_PORT=3306 | ||
DB_NAME=app | ||
DB_USERNAME=root | ||
DB_PASSWORD= | ||
|
||
MAIL_HOST=smtp.gmail.com | ||
MAIL_PORT=465 | ||
MAIL_USERNAME=[email protected] | ||
MAIL_PASSWORD=ex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# apantos |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\Captcha; | ||
|
||
use App\Http\Controllers\Controller; | ||
use System\Security\Security; | ||
|
||
class CaptchaController extends Controller | ||
{ | ||
public function get() | ||
{ | ||
return Security::buildCaptcha(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
|
||
class Controller{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\File; | ||
|
||
use App\Http\Controllers\Controller; | ||
use App\Http\Services\ImageUpload; | ||
|
||
class ImageController extends Controller | ||
{ | ||
|
||
public function upload() | ||
{ | ||
$image = ImageUpload::dateFormatUploadEditor("file"); | ||
echo json_encode(['location' => asset($image)]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\Home; | ||
|
||
use App\Http\Controllers\Controller; | ||
|
||
class HomeController extends Controller | ||
{ | ||
|
||
public function index() | ||
{ | ||
echo "aaa"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!-- cerate --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
namespace App\Http\Services; | ||
|
||
use Ramsey\Uuid\Uuid; | ||
use System\Request\Request; | ||
|
||
class ImageUpload | ||
{ | ||
public static function dateFormatUploadAndFit($fileName, $dir, $width, $height) | ||
{ | ||
$request = new Request(); | ||
$dirSep = DIRECTORY_SEPARATOR; | ||
$path = "images{$dirSep}{$dir}{$dirSep}" . date("Y{$dirSep}M{$dirSep}d"); | ||
$uuid = Uuid::uuid4()->toString(); | ||
$name = date("Y_m_d_M_i_s_") . $uuid; | ||
return $request->uploadImage($fileName, $path, $name, [$width, $height]); | ||
} | ||
|
||
public static function uploadAndFit($fileName, $dir, $width, $height) | ||
{ | ||
$request = new Request(); | ||
$dirSep = DIRECTORY_SEPARATOR; | ||
$path = "images{$dirSep}{$dir}{$dirSep}"; | ||
$uuid = Uuid::uuid4()->toString(); | ||
$name = date("Y_m_d_M_i_s_") . $uuid; | ||
return $request->uploadImage($fileName, $path, $name, [$width, $height]); | ||
} | ||
|
||
public static function dateFormatUploadEditor($fileName) | ||
{ | ||
$request = new Request(); | ||
$dirSep = DIRECTORY_SEPARATOR; | ||
$path = "editor{$dirSep}" . date("Y{$dirSep}M{$dirSep}d"); | ||
$uuid = Uuid::uuid4()->toString(); | ||
$name = date("Y_m_d_M_i_s_") . $uuid; | ||
return $request->uploadImage($fileName, $path, $name); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<?php | ||
|
||
namespace App\Http\Services; | ||
|
||
use System\Config\Config; | ||
use System\Notify\Notify; | ||
|
||
class Mail | ||
{ | ||
// ex | ||
public static function sendTemplateMail($to, $link, $title, $subtitle, $img) | ||
{ | ||
$template = ' | ||
<!DOCTYPE html> | ||
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:o="urn:schemas-microsoft-com:office:office"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width,initial-scale=1"> | ||
<meta name="x-apple-disable-message-reformatting"> | ||
<title></title> | ||
<!--[if mso]> | ||
<noscript> | ||
<xml> | ||
<o:OfficeDocumentSettings> | ||
<o:PixelsPerInch>96</o:PixelsPerInch> | ||
</o:OfficeDocumentSettings> | ||
</xml> | ||
</noscript> | ||
<![endif]--> | ||
<style> | ||
* { | ||
direction: rtl; | ||
text-align: right; | ||
word-wrap: break-word; | ||
margin: 0 auto; | ||
font-family: Roboto; | ||
} | ||
</style> | ||
</head> | ||
<body style="margin:0;padding:0;" dir="rtl"> | ||
<table role="presentation" style="width:100%;border-collapse:collapse;border:0;border-spacing:0;background:#ffffff;"> | ||
<tr> | ||
<td align="center" style="padding:0;"> | ||
<table role="presentation" style="width:602px;border-collapse:collapse;border:1px solid #cccccc;border-spacing:0;text-align:left;"> | ||
<tr> | ||
<td align="center" style="background:#70bbd9; background-image: url('. asset($img) .');height: 250px;width: 100%;background-position: center;background-size: cover;background-repeat: no-repeat;"> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td style="padding:36px 30px 42px 30px;"> | ||
<table role="presentation" style="width:100%;border-collapse:collapse;border:0;border-spacing:0;"> | ||
<tr> | ||
<td style="padding:0 0 36px 0;color:#153643;"> | ||
<h1 style="font-size:24px;margin:0 0 20px 0;">'. $title .'</h1> | ||
<p style="margin:0 0 12px 0;font-size:14.5px;line-height:24px;">'. $subtitle .'</p> | ||
<p style="margin:0;font-size:14.5px;line-height:24px;"><a href="' . $link . '" style="color:#ee4c50;text-decoration:underline;">فعالسازی اکانت کاربری</a></p> | ||
</td> | ||
</tr> | ||
</table> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td style="padding:30px;background:#333;"> | ||
<table role="presentation" style="width:100%;border-collapse:collapse;border:0;border-spacing:0;font-size:9px;"> | ||
<tr> | ||
<td style="padding:0;width:50%;" align="left"> | ||
<p style="margin:0;font-size:14px;line-height:14.5px;color:#ffffff;text-align:center;"> | ||
' . Config::get("app.APP_TITLE") . ' | ||
</p> | ||
</td> | ||
</tr> | ||
</table> | ||
</td> | ||
</tr> | ||
</table> | ||
</td> | ||
</tr> | ||
</table> | ||
</body> | ||
</html> | ||
'; | ||
|
||
Notify::sendMail($to, $title . "-" . Config::get("app.APP_TITLE"), $template); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace App\Providers; | ||
|
||
use App\Ads; | ||
use App\News; | ||
use App\User; | ||
use System\View\Composer; | ||
|
||
class AppServiceProvider extends Provider | ||
{ | ||
public function boot() | ||
{ | ||
return Composer::view("app.index", function () { | ||
// | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
namespace App\Providers; | ||
|
||
abstract class Provider{ | ||
abstract public function boot(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace App\Providers; | ||
|
||
class SessionServiceProvider extends Provider | ||
{ | ||
private function clearSetSessionService($mainSessionName, $tmpSessionName) | ||
{ | ||
if (isset($_SESSION[$tmpSessionName])) unset($_SESSION[$tmpSessionName]); | ||
if (isset($_SESSION[$mainSessionName])) { | ||
$_SESSION[$tmpSessionName] = $_SESSION[$mainSessionName]; | ||
unset($_SESSION[$mainSessionName]); | ||
}; | ||
} | ||
|
||
private function initialOldSession() | ||
{ | ||
$tmp = []; | ||
$tmp = !isset($_GET) ? $tmp : array_merge($tmp, $_GET); | ||
$tmp = !isset($_POST) ? $tmp : array_merge($tmp, $_POST); | ||
$_SESSION["old"] = $tmp; | ||
unset($tmp); | ||
} | ||
|
||
public function boot() | ||
{ | ||
session_start(); | ||
$this->clearSetSessionService("old", "tmp_old"); | ||
$this->clearSetSessionService("flash", "tmp_flash"); | ||
$this->clearSetSessionService("error", "tmp_error"); | ||
$this->initialOldSession(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace Bootstrap; | ||
|
||
class Bootstrap | ||
{ | ||
public function __construct() | ||
{ | ||
new \System\Application\Application(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"autoload": { | ||
"psr-4": { | ||
"App\\": "app/", | ||
"System\\": "system/" | ||
} | ||
}, | ||
"require": { | ||
"symfony/var-dumper": "^5.3", | ||
"ramsey/uuid": "^4.2", | ||
"intervention/image": "^2.6", | ||
"firebase/php-jwt": "^5.4", | ||
"vlucas/phpdotenv": "^5.3", | ||
"defuse/php-encryption": "^2.3", | ||
"symfony/polyfill": "^1.23", | ||
"phpmailer/phpmailer": "^6.5", | ||
"gregwar/captcha": "^1.1", | ||
"morilog/jalali": "^3.2" | ||
} | ||
} |
Oops, something went wrong.