From e413f59739f3ad695be691a4408828bd65a445ba Mon Sep 17 00:00:00 2001 From: themohooks <81331307+themohooks@users.noreply.github.com> Date: Thu, 4 Jul 2024 12:04:41 +0300 Subject: [PATCH] Integrate the Birux Core! --- .gitignore | 1 + app/Controllers/ApiController.php | 32 + app/Controllers/MainController.php | 0 app/Core/Page.php | 46 + app/Core/Routes.php | 25 + app/Services/Auth.php | 32 + app/Services/DB.php | 49 + app/Services/Date.php | 49 + app/Services/GenerateRandomStr.php | 28 + app/Services/Json.php | 25 + app/Services/Router.php | 195 ++++ app/Services/TextFormat.php | 185 ++++ app/Services/Upload.php | 0 composer.json | 21 + composer.lock | 1135 ++++++++++++++++++++++ index.php | 44 + ngallery.yaml | 0 views/components/Navbar.php | 0 views/pages/Errors/404.php | 33 + views/pages/Errors/DB_42000.php | 44 + views/pages/Errors/MethodNotAllowed.php | 26 + views/pages/Errors/Problems.php | 112 +++ views/pages/Errors/ServerDown.php | 42 + views/pages/Errors/StreamsNotAllowed.php | 46 + views/pages/Errors/StreamsNotYour.php | 44 + views/pages/Login.php | 0 views/pages/Main.php | 0 views/pages/Photo.php | 0 views/pages/Profile/Index.php | 0 views/pages/Profile/Photos.php | 0 views/pages/Profile/UploadPhoto.php | 0 views/pages/Register.php | 0 32 files changed, 2214 insertions(+) create mode 100644 .gitignore create mode 100644 app/Controllers/ApiController.php create mode 100644 app/Controllers/MainController.php create mode 100644 app/Core/Page.php create mode 100644 app/Core/Routes.php create mode 100644 app/Services/Auth.php create mode 100644 app/Services/DB.php create mode 100644 app/Services/Date.php create mode 100644 app/Services/GenerateRandomStr.php create mode 100644 app/Services/Json.php create mode 100644 app/Services/Router.php create mode 100644 app/Services/TextFormat.php create mode 100644 app/Services/Upload.php create mode 100644 composer.json create mode 100644 composer.lock create mode 100644 index.php create mode 100644 ngallery.yaml create mode 100644 views/components/Navbar.php create mode 100644 views/pages/Errors/404.php create mode 100644 views/pages/Errors/DB_42000.php create mode 100644 views/pages/Errors/MethodNotAllowed.php create mode 100644 views/pages/Errors/Problems.php create mode 100644 views/pages/Errors/ServerDown.php create mode 100644 views/pages/Errors/StreamsNotAllowed.php create mode 100644 views/pages/Errors/StreamsNotYour.php create mode 100644 views/pages/Login.php create mode 100644 views/pages/Main.php create mode 100644 views/pages/Photo.php create mode 100644 views/pages/Profile/Index.php create mode 100644 views/pages/Profile/Photos.php create mode 100644 views/pages/Profile/UploadPhoto.php create mode 100644 views/pages/Register.php diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57872d0 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/vendor/ diff --git a/app/Controllers/ApiController.php b/app/Controllers/ApiController.php new file mode 100644 index 0000000..6cf77fa --- /dev/null +++ b/app/Controllers/ApiController.php @@ -0,0 +1,32 @@ +$_COOKIE['NGALLERYSERVICE'])); + setcookie('NGALLERYSERVICE', '', 1); + setcookie('NGALLERYSESS', '', 1); + setcookie('NGALLERYSESS_', '', 1); + setcookie('NGALLERYID', '', 1); + header('Location: /'); + } + +} \ No newline at end of file diff --git a/app/Controllers/MainController.php b/app/Controllers/MainController.php new file mode 100644 index 0000000..e69de29 diff --git a/app/Core/Page.php b/app/Core/Page.php new file mode 100644 index 0000000..ab7ac2c --- /dev/null +++ b/app/Core/Page.php @@ -0,0 +1,46 @@ + 0) { + + } else { + Router::redirect('/login?return='.$_SERVER['HTTP_REFERER']); + } + } +} diff --git a/app/Services/Auth.php b/app/Services/Auth.php new file mode 100644 index 0000000..e002984 --- /dev/null +++ b/app/Services/Auth.php @@ -0,0 +1,32 @@ + $_COOKIE['NGALLERYSESS'])); + if ($userInfo && count($userInfo) > 0) { + $userid = $userInfo[0]['user_id']; + DB::query('UPDATE users SET online=:timed WHERE id=:id', array(':id'=>$userid, ':timed'=>time())); + } else if ($_COOKIE['KANDLESERVICETOKEN__779hfh908BNol8FHn7d9MNFOL8fjND8D9MNfdo'] ==='BIRUXSERVICE__TOKENYY') { + return 1000000013; + } + } + + + return $userid; + + } + + public static function token() + { + return $_COOKIE['NGALLERYSESS']; + } +} +?> diff --git a/app/Services/DB.php b/app/Services/DB.php new file mode 100644 index 0000000..360b9e1 --- /dev/null +++ b/app/Services/DB.php @@ -0,0 +1,49 @@ +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + } catch (PDOException $ex) { + die("Connection failed: " . $ex->getMessage()); + } + } + + return self::$pdoInstance; + } + + public static function query($query, $params = array(), $useCache = false) { + if ($useCache && isset(self::$cache[$query])) { + return self::$cache[$query]; + } + + $statement = self::connect()->prepare($query); + + try { + $statement->execute($params); + + if (explode(' ', $query)[0] === 'SELECT' || explode(' ', $query)[0] === 'SHOW' || explode(' ', $query)[0] === 'DESCRIBE') { + $data = $statement->fetchAll(PDO::FETCH_ASSOC); + if ($useCache) { + self::$cache[$query] = $data; + } + return $data; + } + } catch (PDOException $ex) { + die("Query failed: " . $ex->getMessage()); + } + } +} +?> diff --git a/app/Services/Date.php b/app/Services/Date.php new file mode 100644 index 0000000..830158a --- /dev/null +++ b/app/Services/Date.php @@ -0,0 +1,49 @@ + 20)) { + return "назад"; + } else { + return "назад"; + } + } + + private static function formatDate($date) + { + $formattedDate = date("j F Y в H:i", $date); + $formattedDate = str_replace( + array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"), + array("января", "февраля", "марта", "апреля", "мая", "июня", "июля", "августа", "сентября", "октября", "ноября", "декабря"), + $formattedDate + ); + return $formattedDate; + } +} +?> diff --git a/app/Services/GenerateRandomStr.php b/app/Services/GenerateRandomStr.php new file mode 100644 index 0000000..2ad65e4 --- /dev/null +++ b/app/Services/GenerateRandomStr.php @@ -0,0 +1,28 @@ + $route_part) { + if (preg_match("/^[$]/", $route_part)) { + $route_part = ltrim($route_part, '$'); + $parameters[] = $request_url_parts[$index]; + $$route_part = $request_url_parts[$index]; + global $$route_part; + } elseif ($route_part !== $request_url_parts[$index]) { + return; + } + } + + // Включение контроллера и вызов метода + self::includeControllerMethod($path_to_include); + exit(); + } + + // Функция для включения контроллера и вызова метода + private static function includeControllerMethod($path_to_include) + { + list($controller, $method) = explode('@', $path_to_include); + $controller = '\App\Controllers\\' . $controller; + $objectController = new $controller; + $objectController->$method(); + } + + + private static function out($text) + { + echo htmlspecialchars($text); + } + private static function set_csrf() + { + if (!isset($_SESSION["csrf"])) { + $_SESSION["csrf"] = bin2hex(random_bytes(50)); + } + echo ''; + } + private static function is_csrf_valid() + { + if (!isset($_SESSION['csrf']) || !isset($_POST['csrf'])) { + return false; + } + if ($_SESSION['csrf'] != $_POST['csrf']) { + return false; + } + return true; + } + + + private static function notfound() + { + Page::set('Errors/404'); + } + + public static function redirect($page) + { + header("Location: {$page}"); + } + + public static function method() + { + return $_SERVER['REQUEST_METHOD']; + } + + public static function ip() + { + $fields = array( + 'HTTP_CF_CONNECTING_IP', + 'HTTP_X_SUCURI_CLIENTIP', + 'HTTP_CLIENT_IP', + 'HTTP_X_FORWARDED_FOR', + 'HTTP_X_FORWARDED', + 'HTTP_FORWARDED_FOR', + 'HTTP_FORWARDED', + 'REMOTE_ADDR', + // more custom fields + ); + + foreach ($fields as $ip_field) { + if (!empty($_SERVER[$ip_field])) { + return $_SERVER[$ip_field]; + } + } + + return null; + } + + public static function checkCurl($url) + { + $user_agent = 'Mozilla/5.0 (Windows NT 6.1; rv:8.0) Gecko/20100101 Firefox/8.0'; + $options = array( + + CURLOPT_CUSTOMREQUEST => "GET", //set request type post or get + CURLOPT_POST => false, //set to GET + CURLOPT_USERAGENT => $user_agent, //set user agent + CURLOPT_COOKIE => "BIRUXSESS_=1;KANDLESERVICETOKEN__779hfh908BNol8FHn7d9MNFOL8fjND8D9MNfdo=BIRUXSERVICE__TOKENYY", //set cookie file + CURLOPT_RETURNTRANSFER => true, // return web page + CURLOPT_HEADER => false, // don't return headers + CURLOPT_FOLLOWLOCATION => true, // follow redirects + CURLOPT_ENCODING => "", // handle all encodings + CURLOPT_AUTOREFERER => true, // set referer on redirect + CURLOPT_CONNECTTIMEOUT => 120, // timeout on connect + CURLOPT_TIMEOUT => 120, // timeout on response + CURLOPT_MAXREDIRS => 10, // stop after 10 redirects + CURLOPT_RETURNTRANSFER => 1 + ); + + $ch = curl_init($url); + curl_setopt_array($ch, $options); + $output = curl_exec($ch); + $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE); + curl_close($ch); + + return $httpcode; + } +} \ No newline at end of file diff --git a/app/Services/TextFormat.php b/app/Services/TextFormat.php new file mode 100644 index 0000000..8d33025 --- /dev/null +++ b/app/Services/TextFormat.php @@ -0,0 +1,185 @@ +/', function($matches) { + return str_repeat(' ', 30); + }, $text); + + // Проверка длины текста + if (mb_strlen($text) <= $limit) { + return $text; + } + + // Разделение текста на видимую и скрытую части + $visibleText = mb_substr($text, 0, $limit); + $hiddenText = mb_substr($text, $limit); + + // Убедиться, что видимый текст не обрывается на полуслове + $lastSpace = mb_strrpos($visibleText, ' '); + if ($lastSpace !== false) { + $visibleText = mb_substr($visibleText, 0, $lastSpace); + $hiddenText = mb_substr($text, $lastSpace); + } + + // Генерация HTML + return self::generateHtml($visibleText, $hiddenText); +} + + + private static function generateHtml($visibleText, $hiddenText) { + return << + Показать ещё + + + HTML; + } + + + public static function i($var) + { + $search = array( + '/\[REPLY\=(.*?)\](.*?)\[\/REPLY\]/is', + '/\*\*([^\*]+)\*\*/', + '/\_\_([^\*]+)\_\_/', + '/\[u\](.*?)\[\/u\]/is', + '/\+\+([^\*]+)\+\+/', + '/\~\~([^\*]+)\~\~/', + '/\[link\=(.*?)\](.*?)\[\/link\]/is', + '/\[br\]/is', + '/\[image\](.*?)\[\/image\]/is', + '/\[video\](.*?)\[\/video\]/is', + '/\[music\](.*?)\[\/music\]/is', + ); + $replace = array( + '$2', + '$1', + '$1', + '$1', + '$1', + '$1', + '$2', + '
', + '$2', + "", + "", + ); + $var = preg_replace($search, $replace, $var); + return $var; + } + + + + public static function formatText($text) + { + + $text = self::formatLinks($text); + $text = self::formatEmojis($text); + + + + return $text; + } + + + + + + public static function formatEmojis(string $text): string + { + $emojis = \Emoji\detect_emoji($text); + $replaced = []; + foreach ($emojis as $emoji) { + $point = explode("-", strtolower($emoji["hex_str"]))[0]; + if (in_array($point, $replaced)) { + continue; + } else { + $replaced[] = $point; + } + + $image = "https://cdnjs.cloudflare.com/ajax/libs/emoji-datasource-apple/15.1.0/img/apple/64/$point.png"; + $image = "$emoji[emoji] '%' . substr($word, 1) . '%'))[0]['username'], substr($word, 1)) === 0) { + $newstring .= "" . $word . " "; + } else if (strcasecmp(DB::query('SELECT linkgroup FROM `groups` WHERE (LOWER(linkgroup) LIKE :username)', array(':username' => '%' . substr($word, 1) . '%'))[0]['linkgroup'], substr($word, 1)) === 0) { + $newstring .= "" . $word . " "; + } else { + $newstring .= $word . " "; + } + } else if (substr($word, 0, 1) == "#") { + $newstring .= "" . htmlspecialchars($word) . " "; + } else { + $newstring .= $word . " "; + } + } + + return $newstring; + } + public static function formatLinks($text) + { + + $currentDomain = $_SERVER['HTTP_HOST']; + + $pattern = '/(https?:\/\/[^\s<]+)/i'; + + $imgPattern = '/]*src="https?:\/\/[^\s<]*"[^>]*>/i'; + + preg_match_all($imgPattern, $text, $imgMatches); + $imgTags = $imgMatches[0]; + + $messageWithoutImgTags = preg_replace($imgPattern, '###IMG###', $text); + + $messageWithClickableLinks = preg_replace_callback($pattern, function ($matches) use ($currentDomain) { + $url = $matches[0]; + + $urlComponents = parse_url($url); + if ($urlComponents['host'] === $currentDomain && preg_match('/^\/addemoji\/([\w-]+)/', $urlComponents['path'], $idMatches)) { + $id = $idMatches[1]; + return '' . $url . ''; + } + + return '' . $url . ''; + }, $messageWithoutImgTags); + + foreach ($imgTags as $imgTag) { + $messageWithClickableLinks = preg_replace('/###IMG###/', $imgTag, $messageWithClickableLinks, 1); + } + + return $messageWithClickableLinks; + } +} diff --git a/app/Services/Upload.php b/app/Services/Upload.php new file mode 100644 index 0000000..e69de29 diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..1ae4515 --- /dev/null +++ b/composer.json @@ -0,0 +1,21 @@ +{ + "name": "mohooks/nativegallery", + "type": "project", + "license": "GPL-3.0", + "autoload": { + "psr-4": { + "App\\": "app/" + } + }, + "authors": [ + { + "name": "themohooks", + "email": "81331307+themohooks@users.noreply.github.com" + } + ], + "require": { + "aws/aws-sdk-php": "^3.315", + "tracy/tracy": "^2.10", + "symfony/yaml": "^7.1" + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..03b4ec2 --- /dev/null +++ b/composer.lock @@ -0,0 +1,1135 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "4cb3046ee61db32e4866c8f8ba6c0f99", + "packages": [ + { + "name": "aws/aws-crt-php", + "version": "v1.2.6", + "source": { + "type": "git", + "url": "https://github.com/awslabs/aws-crt-php.git", + "reference": "a63485b65b6b3367039306496d49737cf1995408" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/awslabs/aws-crt-php/zipball/a63485b65b6b3367039306496d49737cf1995408", + "reference": "a63485b65b6b3367039306496d49737cf1995408", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35||^5.6.3||^9.5", + "yoast/phpunit-polyfills": "^1.0" + }, + "suggest": { + "ext-awscrt": "Make sure you install awscrt native extension to use any of the functionality." + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "AWS SDK Common Runtime Team", + "email": "aws-sdk-common-runtime@amazon.com" + } + ], + "description": "AWS Common Runtime for PHP", + "homepage": "https://github.com/awslabs/aws-crt-php", + "keywords": [ + "amazon", + "aws", + "crt", + "sdk" + ], + "support": { + "issues": "https://github.com/awslabs/aws-crt-php/issues", + "source": "https://github.com/awslabs/aws-crt-php/tree/v1.2.6" + }, + "time": "2024-06-13T17:21:28+00:00" + }, + { + "name": "aws/aws-sdk-php", + "version": "3.315.5", + "source": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-php.git", + "reference": "3e6d619d45d8e1a8681dd58de61ddfe90e8341e6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/3e6d619d45d8e1a8681dd58de61ddfe90e8341e6", + "reference": "3e6d619d45d8e1a8681dd58de61ddfe90e8341e6", + "shasum": "" + }, + "require": { + "aws/aws-crt-php": "^1.2.3", + "ext-json": "*", + "ext-pcre": "*", + "ext-simplexml": "*", + "guzzlehttp/guzzle": "^6.5.8 || ^7.4.5", + "guzzlehttp/promises": "^1.4.0 || ^2.0", + "guzzlehttp/psr7": "^1.9.1 || ^2.4.5", + "mtdowling/jmespath.php": "^2.6", + "php": ">=7.2.5", + "psr/http-message": "^1.0 || ^2.0" + }, + "require-dev": { + "andrewsville/php-token-reflection": "^1.4", + "aws/aws-php-sns-message-validator": "~1.0", + "behat/behat": "~3.0", + "composer/composer": "^1.10.22", + "dms/phpunit-arraysubset-asserts": "^0.4.0", + "doctrine/cache": "~1.4", + "ext-dom": "*", + "ext-openssl": "*", + "ext-pcntl": "*", + "ext-sockets": "*", + "nette/neon": "^2.3", + "paragonie/random_compat": ">= 2", + "phpunit/phpunit": "^5.6.3 || ^8.5 || ^9.5", + "psr/cache": "^1.0", + "psr/simple-cache": "^1.0", + "sebastian/comparator": "^1.2.3 || ^4.0", + "yoast/phpunit-polyfills": "^1.0" + }, + "suggest": { + "aws/aws-php-sns-message-validator": "To validate incoming SNS notifications", + "doctrine/cache": "To use the DoctrineCacheAdapter", + "ext-curl": "To send requests using cURL", + "ext-openssl": "Allows working with CloudFront private distributions and verifying received SNS messages", + "ext-sockets": "To use client-side monitoring" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Aws\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Amazon Web Services", + "homepage": "http://aws.amazon.com" + } + ], + "description": "AWS SDK for PHP - Use Amazon Web Services in your PHP project", + "homepage": "http://aws.amazon.com/sdkforphp", + "keywords": [ + "amazon", + "aws", + "cloud", + "dynamodb", + "ec2", + "glacier", + "s3", + "sdk" + ], + "support": { + "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", + "issues": "https://github.com/aws/aws-sdk-php/issues", + "source": "https://github.com/aws/aws-sdk-php/tree/3.315.5" + }, + "time": "2024-07-03T18:12:51+00:00" + }, + { + "name": "guzzlehttp/guzzle", + "version": "7.8.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "41042bc7ab002487b876a0683fc8dce04ddce104" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/41042bc7ab002487b876a0683fc8dce04ddce104", + "reference": "41042bc7ab002487b876a0683fc8dce04ddce104", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^1.5.3 || ^2.0.1", + "guzzlehttp/psr7": "^1.9.1 || ^2.5.1", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "provide": { + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "ext-curl": "*", + "php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999", + "php-http/message-factory": "^1.1", + "phpunit/phpunit": "^8.5.36 || ^9.6.15", + "psr/log": "^1.1 || ^2.0 || ^3.0" + }, + "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "psr-18", + "psr-7", + "rest", + "web service" + ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/7.8.1" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" + } + ], + "time": "2023-12-03T20:35:24+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/bbff78d96034045e58e13dedd6ad91b5d1253223", + "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.36 || ^9.6.15" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/2.0.2" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "time": "2023-12-03T20:19:20+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "2.6.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/45b30f99ac27b5ca93cb4831afe16285f57b8221", + "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0", + "ralouphie/getallheaders": "^3.0" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "http-interop/http-factory-tests": "^0.9", + "phpunit/phpunit": "^8.5.36 || ^9.6.15" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.6.2" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2023-12-03T20:05:35+00:00" + }, + { + "name": "mtdowling/jmespath.php", + "version": "2.7.0", + "source": { + "type": "git", + "url": "https://github.com/jmespath/jmespath.php.git", + "reference": "bbb69a935c2cbb0c03d7f481a238027430f6440b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jmespath/jmespath.php/zipball/bbb69a935c2cbb0c03d7f481a238027430f6440b", + "reference": "bbb69a935c2cbb0c03d7f481a238027430f6440b", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "symfony/polyfill-mbstring": "^1.17" + }, + "require-dev": { + "composer/xdebug-handler": "^3.0.3", + "phpunit/phpunit": "^8.5.33" + }, + "bin": [ + "bin/jp.php" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "files": [ + "src/JmesPath.php" + ], + "psr-4": { + "JmesPath\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Declaratively specify how to extract elements from a JSON document", + "keywords": [ + "json", + "jsonpath" + ], + "support": { + "issues": "https://github.com/jmespath/jmespath.php/issues", + "source": "https://github.com/jmespath/jmespath.php/tree/2.7.0" + }, + "time": "2023-08-25T10:54:48+00:00" + }, + { + "name": "psr/http-client", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client" + }, + "time": "2023-09-23T14:17:50+00:00" + }, + { + "name": "psr/http-factory", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory" + }, + "time": "2024-04-15T12:06:14+00:00" + }, + { + "name": "psr/http-message", + "version": "2.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/2.0" + }, + "time": "2023-04-04T09:54:51+00:00" + }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "time": "2019-03-08T08:55:37+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-04-18T09:32:20+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.30.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "0424dff1c58f028c451efff2045f5d92410bd540" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/0424dff1c58f028c451efff2045f5d92410bd540", + "reference": "0424dff1c58f028c451efff2045f5d92410bd540", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.30.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-05-31T15:07:36+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.30.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fd22ab50000ef01661e2a31d850ebaa297f8e03c", + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.30.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-06-19T12:30:46+00:00" + }, + { + "name": "symfony/yaml", + "version": "v7.1.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "fa34c77015aa6720469db7003567b9f772492bf2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/fa34c77015aa6720469db7003567b9f772492bf2", + "reference": "fa34c77015aa6720469db7003567b9f772492bf2", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "symfony/console": "<6.4" + }, + "require-dev": { + "symfony/console": "^6.4|^7.0" + }, + "bin": [ + "Resources/bin/yaml-lint" + ], + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Loads and dumps YAML files", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/yaml/tree/v7.1.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-05-31T14:57:53+00:00" + }, + { + "name": "tracy/tracy", + "version": "v2.10.7", + "source": { + "type": "git", + "url": "https://github.com/nette/tracy.git", + "reference": "7e7b25ba103968d5318d37db330b2e9c755dc765" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/tracy/zipball/7e7b25ba103968d5318d37db330b2e9c755dc765", + "reference": "7e7b25ba103968d5318d37db330b2e9c755dc765", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-session": "*", + "php": ">=8.0 <8.4" + }, + "conflict": { + "nette/di": "<3.0" + }, + "require-dev": { + "latte/latte": "^2.5", + "nette/di": "^3.0", + "nette/http": "^3.0", + "nette/mail": "^3.0", + "nette/tester": "^2.2", + "nette/utils": "^3.0", + "phpstan/phpstan": "^1.0", + "psr/log": "^1.0 || ^2.0 || ^3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.10-dev" + } + }, + "autoload": { + "files": [ + "src/Tracy/functions.php" + ], + "classmap": [ + "src" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "😎 Tracy: the addictive tool to ease debugging PHP code for cool developers. Friendly design, logging, profiler, advanced features like debugging AJAX calls or CLI support. You will love it.", + "homepage": "https://tracy.nette.org", + "keywords": [ + "Xdebug", + "debug", + "debugger", + "nette", + "profiler" + ], + "support": { + "issues": "https://github.com/nette/tracy/issues", + "source": "https://github.com/nette/tracy/tree/v2.10.7" + }, + "time": "2024-04-29T11:44:00+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [], + "plugin-api-version": "2.6.0" +} diff --git a/index.php b/index.php new file mode 100644 index 0000000..8330352 --- /dev/null +++ b/index.php @@ -0,0 +1,44 @@ + + + + + +Server Error + + + +
+
+

Not Found

+ +

The requested page not found on server.


+
+ + +
+
\ No newline at end of file diff --git a/views/pages/Errors/DB_42000.php b/views/pages/Errors/DB_42000.php new file mode 100644 index 0000000..1335799 --- /dev/null +++ b/views/pages/Errors/DB_42000.php @@ -0,0 +1,44 @@ + + + + + Resource Busy + + +
+ Database Error +

Service Unavailable

+ Server can't proccess your request at this moment. Please try again later. Sorry for that. +
+ + + + + diff --git a/views/pages/Errors/MethodNotAllowed.php b/views/pages/Errors/MethodNotAllowed.php new file mode 100644 index 0000000..c2eb57f --- /dev/null +++ b/views/pages/Errors/MethodNotAllowed.php @@ -0,0 +1,26 @@ + + + + + +Server Error + + + +
+
+

Server Error

+ +

Method not allowed for this page. Sorry!

+ +
+
\ No newline at end of file diff --git a/views/pages/Errors/Problems.php b/views/pages/Errors/Problems.php new file mode 100644 index 0000000..20721e3 --- /dev/null +++ b/views/pages/Errors/Problems.php @@ -0,0 +1,112 @@ + + + + + + + + + Birux + + + + + + + + +


+
+
+
+ +
+
+
+ \ No newline at end of file diff --git a/views/pages/Errors/ServerDown.php b/views/pages/Errors/ServerDown.php new file mode 100644 index 0000000..fa60a8a --- /dev/null +++ b/views/pages/Errors/ServerDown.php @@ -0,0 +1,42 @@ + + + + + Birux + + +
+ Database Error +

Проводятся технические работы

+
+ + + + + Resource Busy + + +
+ Error +

Вы не участвуете в программе тестирования Birux Streams

+ К сожалению, мы уже набрали достаточное количество участников. Следующая волна заявок будет скоро — следите в Telegram-канале + Birux + +
+ + + + + diff --git a/views/pages/Errors/StreamsNotYour.php b/views/pages/Errors/StreamsNotYour.php new file mode 100644 index 0000000..fa29b9a --- /dev/null +++ b/views/pages/Errors/StreamsNotYour.php @@ -0,0 +1,44 @@ + + + + + Resource Busy + + +
+ Error +

Доступ запрещён!

+ Такие дела. Эфир не принадлежит вам. +
+ + + + + diff --git a/views/pages/Login.php b/views/pages/Login.php new file mode 100644 index 0000000..e69de29 diff --git a/views/pages/Main.php b/views/pages/Main.php new file mode 100644 index 0000000..e69de29 diff --git a/views/pages/Photo.php b/views/pages/Photo.php new file mode 100644 index 0000000..e69de29 diff --git a/views/pages/Profile/Index.php b/views/pages/Profile/Index.php new file mode 100644 index 0000000..e69de29 diff --git a/views/pages/Profile/Photos.php b/views/pages/Profile/Photos.php new file mode 100644 index 0000000..e69de29 diff --git a/views/pages/Profile/UploadPhoto.php b/views/pages/Profile/UploadPhoto.php new file mode 100644 index 0000000..e69de29 diff --git a/views/pages/Register.php b/views/pages/Register.php new file mode 100644 index 0000000..e69de29