diff --git a/.docker/common/crontab b/.docker/common/crontab new file mode 100644 index 00000000..2f3a1298 --- /dev/null +++ b/.docker/common/crontab @@ -0,0 +1 @@ +* * * * * cd /var/www && php artisan schedule:run >> /dev/null 2>&1 diff --git a/.docker/common/wait-for-it.sh b/.docker/common/wait-for-it.sh deleted file mode 100644 index daca5469..00000000 --- a/.docker/common/wait-for-it.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh - -log() { - echo "[wait-for] [`date +'%Y%m%d%H%M%S'`] $@" -} - -usage() { - echo "Usage: `basename "$0"` [--timeout=15] : [:]" -} - -unknown_arg() { - log "[ERROR] unknown argument: '$@'" - usage - exit 2 -} - -wait_for() { - timeout=$1 && host=$2 && port=$3 - log "wait '$host':'$port' up to '$timeout'" - for i in `seq $timeout` ; do - if nc -z "$host" "$port" > /dev/null 2>&1 ; then - log "wait finish '$host:$port' [`expr $(date +%s) - $START`] seconds" - exit 0 - fi - log "wait attempt '${host}:${port}' [$i]" - sleep 1 - done - log "[ERROR] wait timeout of '$timeout' on '$host:$port'" - exit 1 -} - -trap 'kill $(jobs -p) &>/dev/null' EXIT - -START=$(date +%s) -timeout=15 -pids="" -for i in $@ ; do - case $i in - --timeout=*) timeout="${i#*=}" ;; - -t=*) timeout="${i#*=}" ;; - *:* ) - wait_for "$timeout" "${i%%:*}" "${i##*:}" & - pids="$pids $!" - ;; - *) unknown_arg "$i" ;; - esac -done - -status=0 -for pid in $pids; do - if ! wait $pid ; then - status=1 - fi -done - -log "wait done with status=$status" -exit $status diff --git a/.docker/develop/php/Dockerfile b/.docker/develop/php/Dockerfile index 1eabb77f..224a8a44 100644 --- a/.docker/develop/php/Dockerfile +++ b/.docker/develop/php/Dockerfile @@ -1,4 +1,8 @@ -FROM php:8-fpm-alpine +# Here we are going to install PHP extension requirements that did not come +# with the default PHP container. This will be necessary for Laravel and Swoole. +FROM php:8.0-cli-alpine3.13 as php-base + +WORKDIR /var/www RUN apk update && apk add --no-cache \ zip \ @@ -10,29 +14,56 @@ RUN apk update && apk add --no-cache \ bash \ tzdata \ nano \ - nodejs npm \ - && pecl install redis \ - && docker-php-ext-enable redis \ + nodejs npm + +RUN pecl install redis + +RUN docker-php-ext-enable redis \ && docker-php-ext-install zip pdo_mysql exif opcache pcntl \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --quit \ && npm --global install yarn \ && rm -rf /var/cache/apk/* /tmp/* /var/tmp/* -ENV TZ=Asia/Baku +RUN apk add --no-cache --virtual php_dependencies $PHPIZE_DEPS && \ + apk add --no-cache libstdc++ && \ + docker-php-ext-install bcmath ctype pdo_mysql pcntl && \ + pecl install swoole && \ + docker-php-ext-enable swoole && \ + apk del php_dependencies && \ + chown -R www-data:www-data /var/www -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +# This stage is so that we can build up everything that doesn't require Laravel +# so as to not bust the caching for those items. +FROM php-base as octane-base + # This really shouldn't be modified, so we aren't advertising the env variable. + # It allows us to globally install chokidar without modifying the Laravel package.json. +ENV NODE_PATH "/home/www-data/.npm-global/lib/node_modules" -RUN mv $PHP_INI_DIR/php.ini-development $PHP_INI_DIR/php.ini +RUN apk add --no-cache nodejs npm && \ + mkdir "/home/www-data/.npm-global/" && \ + npm config set prefix "/home/www-data/.npm-global/" && \ + npm install -g chokidar -#COPY ./.docker/develop/php/local.ini $PHP_INI_DIR/conf.d -#COPY ./.docker/develop/php/xlaravel.pool.conf /usr/local/etc/php-fpm.d/ +# This is our final container. We will copy over our built version of Laravel. +FROM octane-base -WORKDIR /var/www +USER www-data + +# Allow the user to specify Swoole options via ENV variables. +ENV SWOOLE_MAX_REQUESTS "500" +ENV SWOOLE_TASK_WORKERS "auto" +ENV SWOOLE_WATCH $true +ENV SWOOLE_WORKERS "auto" + +# Expose the ports that Octane is using. +EXPOSE 8000 -ARG PUID=1000 -ENV PUID ${PUID} -ARG PGID=1000 -ENV PGID ${PGID} +# Run Swoole +CMD if [[ -z $SWOOLE_WATCH ]] ; then \ + php artisan octane:start --server="swoole" --host="0.0.0.0" --workers=${SWOOLE_WORKERS} --task-workers=${SWOOLE_TASK_WORKERS} --max-requests=${SWOOLE_MAX_REQUESTS} ; \ +else \ + php artisan octane:start --server="swoole" --host="0.0.0.0" --workers=${SWOOLE_WORKERS} --task-workers=${SWOOLE_TASK_WORKERS} --max-requests=${SWOOLE_MAX_REQUESTS} --watch ; \ +fi -RUN groupmod -o -g ${PGID} www-data && \ - usermod -o -u ${PUID} -g www-data www-data +# Check the health status using the Octane status command. +HEALTHCHECK CMD php artisan octane:status --server="swoole" diff --git a/.docker/develop/php/supervisord.conf b/.docker/develop/php/supervisord.conf new file mode 100644 index 00000000..ddf3da83 --- /dev/null +++ b/.docker/develop/php/supervisord.conf @@ -0,0 +1,9 @@ +[supervisord] +nodaemon=true + +[program:octane] +command=php -d variables_order=EGPCS /var/www/artisan octane:start --server=roadrunner --host=0.0.0.0 --port=8080 +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 diff --git a/.dockerignore b/.dockerignore index d56c470a..cdf8b001 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,7 @@ .github .deploy readme.md +_ide_helper.php +.php_cs +.php_cs.cache +.php-cs-fixer.cache diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index d2eac0bb..ed54230d 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -4,6 +4,7 @@ use Illuminate\Console\Scheduling\Schedule; use Illuminate\Foundation\Console\Kernel as ConsoleKernel; +use Illuminate\Support\Facades\DB; class Kernel extends ConsoleKernel { @@ -25,7 +26,9 @@ class Kernel extends ConsoleKernel */ protected function schedule(Schedule $schedule) { - $schedule->command('cache:clear')->everyMinute(); + $schedule->call(function () { + DB::table('users')->update(['karma' => 0]); + })->lastDayOfMonth('00:01'); } /** diff --git a/app/Http/Controllers/Api/ArticleController.php b/app/Http/Controllers/Api/ArticleController.php index 5030a7df..2f73aab1 100644 --- a/app/Http/Controllers/Api/ArticleController.php +++ b/app/Http/Controllers/Api/ArticleController.php @@ -64,26 +64,38 @@ public function store(ArticleRequest $request): JsonResponse public function vote(VoteRequest $request): JsonResponse { $article = Article::findOrFail($request->id); - ($request->type === 'up') ? self::upOrDownVote($request->user(), $article) : self::upOrDownVote($request->user(), $article, 'down'); + ($request->type === 'up') + ? self::upOrDownVote($request->user(), $article) + : self::upOrDownVote( + $request->user(), + $article, + 'down' + ); return response()->json(['result' => 'true']); } public static function upOrDownVote(User $user, $target, string $type = 'up'): bool { - $hasVoted = $user->{'has'.ucfirst($type).'Voted'}($target); + $hasVoted = $user->{'has' . ucfirst($type) . 'Voted'}($target); DB::beginTransaction(); try { - $user->{$type.'Vote'}($target); + $user->{$type . 'Vote'}($target); if ($hasVoted) { $user->cancelVote($target); foreach ($target->hubs as $hub) { $type === 'up' ? $hub->rating-- : $hub->rating++; $hub->save(); } - $type === 'up' ? $target->creator->rating-- : $target->creator->rating++; - $target->author->save(); + if ($type === 'up') { + $target->creator->rating--; + $target->creator->karma--; + } else { + $target->creator->rating++; + $target->creator->karma++; + } + $target->creator->save(); DB::commit(); return false; @@ -92,8 +104,14 @@ public static function upOrDownVote(User $user, $target, string $type = 'up'): b $type === 'up' ? $hub->rating++ : $hub->rating--; $hub->save(); } - $type === 'up' ? $target->creator->rating++ : $target->creator->rating--; - $target->author->save(); + if ($type === 'up') { + $target->creator->rating++; + $target->creator->karma++; + } else { + $target->creator->rating--; + $target->creator->karma--; + } + $target->creator->save(); DB::commit(); } catch (Exception $e) { DB::rollback(); diff --git a/composer.json b/composer.json index 0ca82a49..5fa4cc1a 100644 --- a/composer.json +++ b/composer.json @@ -17,6 +17,7 @@ "jackiedo/dotenv-editor": "^1.2", "jcc/laravel-vote": "dev-master", "laravel/framework": "^8.12", + "laravel/octane": "^1.0", "laravel/passport": "^10.1", "laravel/socialite": "^5.1", "laravel/tinker": "^2.5", @@ -30,7 +31,8 @@ "qcod/laravel-gamify": "^1.0", "rennokki/laravel-eloquent-query-cache": "^2.6", "sentry/sentry-laravel": "^2.3", - "spatie/laravel-medialibrary": "^9.0.0" + "spatie/laravel-medialibrary": "^9.0.0", + "spiral/roadrunner": "^2.2" }, "require-dev": { "barryvdh/laravel-debugbar": "^3.5", diff --git a/composer.lock b/composer.lock index 0083326b..f6af6ca7 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "0cf226c5cee3011daa42a9917a418340", + "content-hash": "efdf73dfe5490a29510ba4ffe2a3d3e9", "packages": [ { "name": "asm89/stack-cors", @@ -2681,6 +2681,168 @@ }, "time": "2021-07-22T09:24:00+00:00" }, + { + "name": "laminas/laminas-diactoros", + "version": "2.5.1", + "source": { + "type": "git", + "url": "https://github.com/laminas/laminas-diactoros.git", + "reference": "53df7b7cd66e0905e6133970a4b90392a7a08075" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/53df7b7cd66e0905e6133970a4b90392a7a08075", + "reference": "53df7b7cd66e0905e6133970a4b90392a7a08075", + "shasum": "" + }, + "require": { + "laminas/laminas-zendframework-bridge": "^1.0", + "php": "^7.3 || ~8.0.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0" + }, + "conflict": { + "phpspec/prophecy": "<1.9.0" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "replace": { + "zendframework/zend-diactoros": "^2.2.1" + }, + "require-dev": { + "ext-curl": "*", + "ext-dom": "*", + "ext-gd": "*", + "ext-libxml": "*", + "http-interop/http-factory-tests": "^0.8.0", + "laminas/laminas-coding-standard": "~1.0.0", + "php-http/psr7-integration-tests": "^1.1", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.1" + }, + "type": "library", + "extra": { + "laminas": { + "config-provider": "Laminas\\Diactoros\\ConfigProvider", + "module": "Laminas\\Diactoros" + } + }, + "autoload": { + "files": [ + "src/functions/create_uploaded_file.php", + "src/functions/marshal_headers_from_sapi.php", + "src/functions/marshal_method_from_sapi.php", + "src/functions/marshal_protocol_version_from_sapi.php", + "src/functions/marshal_uri_from_sapi.php", + "src/functions/normalize_server.php", + "src/functions/normalize_uploaded_files.php", + "src/functions/parse_cookie_header.php", + "src/functions/create_uploaded_file.legacy.php", + "src/functions/marshal_headers_from_sapi.legacy.php", + "src/functions/marshal_method_from_sapi.legacy.php", + "src/functions/marshal_protocol_version_from_sapi.legacy.php", + "src/functions/marshal_uri_from_sapi.legacy.php", + "src/functions/normalize_server.legacy.php", + "src/functions/normalize_uploaded_files.legacy.php", + "src/functions/parse_cookie_header.legacy.php" + ], + "psr-4": { + "Laminas\\Diactoros\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "PSR HTTP Message implementations", + "homepage": "https://laminas.dev", + "keywords": [ + "http", + "laminas", + "psr", + "psr-17", + "psr-7" + ], + "support": { + "chat": "https://laminas.dev/chat", + "docs": "https://docs.laminas.dev/laminas-diactoros/", + "forum": "https://discourse.laminas.dev", + "issues": "https://github.com/laminas/laminas-diactoros/issues", + "rss": "https://github.com/laminas/laminas-diactoros/releases.atom", + "source": "https://github.com/laminas/laminas-diactoros" + }, + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2021-04-13T19:39:11+00:00" + }, + { + "name": "laminas/laminas-zendframework-bridge", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/laminas/laminas-zendframework-bridge.git", + "reference": "6cccbddfcfc742eb02158d6137ca5687d92cee32" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laminas/laminas-zendframework-bridge/zipball/6cccbddfcfc742eb02158d6137ca5687d92cee32", + "reference": "6cccbddfcfc742eb02158d6137ca5687d92cee32", + "shasum": "" + }, + "require": { + "php": "^7.3 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.1 || ^9.3", + "psalm/plugin-phpunit": "^0.15.1", + "squizlabs/php_codesniffer": "^3.5", + "vimeo/psalm": "^4.6" + }, + "type": "library", + "extra": { + "laminas": { + "module": "Laminas\\ZendFrameworkBridge" + } + }, + "autoload": { + "files": [ + "src/autoload.php" + ], + "psr-4": { + "Laminas\\ZendFrameworkBridge\\": "src//" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Alias legacy ZF class names to Laminas Project equivalents.", + "keywords": [ + "ZendFramework", + "autoloading", + "laminas", + "zf" + ], + "support": { + "forum": "https://discourse.laminas.dev/", + "issues": "https://github.com/laminas/laminas-zendframework-bridge/issues", + "rss": "https://github.com/laminas/laminas-zendframework-bridge/releases.atom", + "source": "https://github.com/laminas/laminas-zendframework-bridge" + }, + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2021-02-25T21:54:58+00:00" + }, { "name": "laravel/framework", "version": "v8.52.0", @@ -2849,6 +3011,82 @@ }, "time": "2021-07-27T13:03:29+00:00" }, + { + "name": "laravel/octane", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/laravel/octane.git", + "reference": "6dbd45ed76c81fd0fa25da875d36d986f7d2b72d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/octane/zipball/6dbd45ed76c81fd0fa25da875d36d986f7d2b72d", + "reference": "6dbd45ed76c81fd0fa25da875d36d986f7d2b72d", + "shasum": "" + }, + "require": { + "laminas/laminas-diactoros": "^2.5", + "laravel/framework": "^8.37", + "php": "^8.0", + "symfony/psr-http-message-bridge": "^2.0" + }, + "require-dev": { + "guzzlehttp/guzzle": "^7.2", + "mockery/mockery": "^1.4", + "nunomaduro/collision": "^5.3", + "orchestra/testbench": "^6.16", + "phpunit/phpunit": "^9.3", + "spatie/laravel-ray": "^1.14", + "spiral/roadrunner": "^2.0", + "swoole/ide-helper": "^4.6" + }, + "bin": [ + "bin/roadrunner-worker", + "bin/swoole-server" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "laravel": { + "providers": [ + "Laravel\\Octane\\OctaneServiceProvider" + ], + "aliases": { + "Octane": "Laravel\\Octane\\Facades\\Octane" + } + } + }, + "autoload": { + "psr-4": { + "Laravel\\Octane\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "Supercharge your Laravel application's performance.", + "keywords": [ + "laravel", + "octane", + "roadrunner", + "swoole" + ], + "support": { + "issues": "https://github.com/laravel/octane/issues", + "source": "https://github.com/laravel/octane" + }, + "time": "2021-05-11T18:30:50+00:00" + }, { "name": "laravel/passport", "version": "v10.1.3", @@ -6984,6 +7222,284 @@ ], "time": "2021-03-30T19:46:13+00:00" }, + { + "name": "spiral/goridge", + "version": "v3.0.1", + "source": { + "type": "git", + "url": "https://github.com/spiral/goridge-php.git", + "reference": "3258892afd1d0a9cb889eb21ddd353dd06ba774d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spiral/goridge-php/zipball/3258892afd1d0a9cb889eb21ddd353dd06ba774d", + "reference": "3258892afd1d0a9cb889eb21ddd353dd06ba774d", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-sockets": "*", + "php": ">=7.4" + }, + "require-dev": { + "phpstan/phpstan": "~0.12.34", + "phpunit/phpunit": "~8.0", + "rybakit/msgpack": "^0.7.1", + "spiral/code-style": "^1.0" + }, + "type": "goridge", + "autoload": { + "psr-4": { + "Spiral\\Goridge\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Anton Titov / Wolfy-J", + "email": "wolfy.jd@gmail.com" + } + ], + "description": "High-performance PHP-to-Golang RPC bridge", + "support": { + "issues": "https://github.com/spiral/goridge-php/issues", + "source": "https://github.com/spiral/goridge-php/tree/v3.0.1" + }, + "time": "2021-03-11T14:28:29+00:00" + }, + { + "name": "spiral/roadrunner", + "version": "v2.2.1", + "source": { + "type": "git", + "url": "https://github.com/spiral/roadrunner.git", + "reference": "e1ff9daead5033b537296ffb071e551b95af91ab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spiral/roadrunner/zipball/e1ff9daead5033b537296ffb071e551b95af91ab", + "reference": "e1ff9daead5033b537296ffb071e551b95af91ab", + "shasum": "" + }, + "require": { + "spiral/roadrunner-cli": "^2.0", + "spiral/roadrunner-http": "^2.0", + "spiral/roadrunner-worker": "^2.0" + }, + "type": "metapackage", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Anton Titov / Wolfy-J", + "email": "wolfy.jd@gmail.com" + }, + { + "name": "RoadRunner Community", + "homepage": "https://github.com/spiral/roadrunner/graphs/contributors" + } + ], + "description": "RoadRunner: High-performance PHP application server, load-balancer and process manager written in Golang", + "support": { + "issues": "https://github.com/spiral/roadrunner/issues", + "source": "https://github.com/spiral/roadrunner/tree/v2.2.1" + }, + "time": "2021-05-13T17:15:00+00:00" + }, + { + "name": "spiral/roadrunner-cli", + "version": "v2.0.4", + "source": { + "type": "git", + "url": "https://github.com/spiral/roadrunner-cli.git", + "reference": "81dcec5c2d94481dedace488c27d433414726654" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spiral/roadrunner-cli/zipball/81dcec5c2d94481dedace488c27d433414726654", + "reference": "81dcec5c2d94481dedace488c27d433414726654", + "shasum": "" + }, + "require": { + "composer/semver": "^3.2", + "ext-json": "*", + "php": ">=7.4", + "spiral/roadrunner-worker": ">=2.0.2", + "symfony/console": "^4.4|^5.0", + "symfony/http-client": "^4.4|^5.0", + "symfony/polyfill-php80": "^1.22" + }, + "require-dev": { + "jetbrains/phpstorm-attributes": "^1.0", + "symfony/var-dumper": "^4.4|^5.0", + "vimeo/psalm": "^4.4" + }, + "bin": [ + "bin/rr" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Spiral\\RoadRunner\\Console\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Anton Titov (wolfy-j)", + "email": "wolfy-j@spiralscout.com" + }, + { + "name": "RoadRunner Community", + "homepage": "https://github.com/spiral/roadrunner/graphs/contributors" + } + ], + "description": "RoadRunner: Command Line Interface", + "support": { + "issues": "https://github.com/spiral/roadrunner-cli/issues", + "source": "https://github.com/spiral/roadrunner-cli/tree/v2.0.4" + }, + "time": "2021-05-12T15:49:01+00:00" + }, + { + "name": "spiral/roadrunner-http", + "version": "v2.0.0", + "source": { + "type": "git", + "url": "https://github.com/spiral/roadrunner-http.git", + "reference": "0eb0bc93f16ff8130fd0aaf31f6d87000bf2a605" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spiral/roadrunner-http/zipball/0eb0bc93f16ff8130fd0aaf31f6d87000bf2a605", + "reference": "0eb0bc93f16ff8130fd0aaf31f6d87000bf2a605", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": ">=7.4", + "psr/http-factory": "^1.0.1", + "psr/http-message": "^1.0.1", + "spiral/roadrunner-worker": "^2.0" + }, + "require-dev": { + "jetbrains/phpstorm-attributes": "^1.0", + "nyholm/psr7": "^1.3", + "phpstan/phpstan": "~0.12", + "phpunit/phpunit": "~8.0", + "symfony/var-dumper": "^5.1", + "vimeo/psalm": "^4.4" + }, + "suggest": { + "spiral/roadrunner-cli": "Provides RoadRunner installation and management CLI tools" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Spiral\\RoadRunner\\Http\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Anton Titov / Wolfy-J", + "email": "wolfy.jd@gmail.com" + }, + { + "name": "RoadRunner Community", + "homepage": "https://github.com/spiral/roadrunner/graphs/contributors" + } + ], + "description": "RoadRunner: HTTP and PSR-7 worker", + "support": { + "issues": "https://github.com/spiral/roadrunner-http/issues", + "source": "https://github.com/spiral/roadrunner-http/tree/v2.0.0" + }, + "time": "2021-02-18T11:09:37+00:00" + }, + { + "name": "spiral/roadrunner-worker", + "version": "v2.0.3", + "source": { + "type": "git", + "url": "https://github.com/spiral/roadrunner-worker.git", + "reference": "1a10a7641ff045fff2570b5ec1a265713e5a1bd5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spiral/roadrunner-worker/zipball/1a10a7641ff045fff2570b5ec1a265713e5a1bd5", + "reference": "1a10a7641ff045fff2570b5ec1a265713e5a1bd5", + "shasum": "" + }, + "require": { + "composer-runtime-api": "^2.0", + "ext-json": "*", + "ext-sockets": "*", + "php": ">=7.4", + "psr/log": "^1.0", + "spiral/goridge": "^3.0" + }, + "require-dev": { + "jetbrains/phpstorm-attributes": "^1.0", + "symfony/var-dumper": "^5.1", + "vimeo/psalm": "^4.4" + }, + "suggest": { + "spiral/roadrunner-cli": "Provides RoadRunner installation and management CLI tools" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Spiral\\RoadRunner\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Anton Titov (wolfy-j)", + "email": "wolfy-j@spiralscout.com" + }, + { + "name": "RoadRunner Community", + "homepage": "https://github.com/spiral/roadrunner/graphs/contributors" + } + ], + "description": "RoadRunner: PHP worker", + "support": { + "issues": "https://github.com/spiral/roadrunner-worker/issues", + "source": "https://github.com/spiral/roadrunner-worker/tree/v2.0.3" + }, + "time": "2021-02-19T13:15:37+00:00" + }, { "name": "swiftmailer/swiftmailer", "version": "v6.2.7", @@ -7061,16 +7577,16 @@ }, { "name": "symfony/console", - "version": "v5.3.6", + "version": "v5.2.8", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "51b71afd6d2dc8f5063199357b9880cea8d8bfe2" + "reference": "864568fdc0208b3eba3638b6000b69d2386e6768" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/51b71afd6d2dc8f5063199357b9880cea8d8bfe2", - "reference": "51b71afd6d2dc8f5063199357b9880cea8d8bfe2", + "url": "https://api.github.com/repos/symfony/console/zipball/864568fdc0208b3eba3638b6000b69d2386e6768", + "reference": "864568fdc0208b3eba3638b6000b69d2386e6768", "shasum": "" }, "require": { @@ -7140,7 +7656,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.3.6" + "source": "https://github.com/symfony/console/tree/v5.2.8" }, "funding": [ { @@ -7156,7 +7672,7 @@ "type": "tidelift" } ], - "time": "2021-07-27T19:10:22+00:00" + "time": "2021-05-11T15:45:21+00:00" }, { "name": "symfony/css-selector", @@ -7293,16 +7809,16 @@ }, { "name": "symfony/error-handler", - "version": "v5.3.4", + "version": "v5.2.8", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "281f6c4660bcf5844bb0346fe3a4664722fe4c73" + "reference": "1416bc16317a8188aabde251afef7618bf4687ac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/281f6c4660bcf5844bb0346fe3a4664722fe4c73", - "reference": "281f6c4660bcf5844bb0346fe3a4664722fe4c73", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/1416bc16317a8188aabde251afef7618bf4687ac", + "reference": "1416bc16317a8188aabde251afef7618bf4687ac", "shasum": "" }, "require": { @@ -7341,7 +7857,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v5.3.4" + "source": "https://github.com/symfony/error-handler/tree/v5.2.8" }, "funding": [ { @@ -7357,7 +7873,7 @@ "type": "tidelift" } ], - "time": "2021-07-23T15:55:36+00:00" + "time": "2021-05-07T13:42:21+00:00" }, { "name": "symfony/event-dispatcher", @@ -7650,16 +8166,16 @@ }, { "name": "symfony/http-client", - "version": "v5.3.3", + "version": "v5.2.8", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "fde4bdb10bf197f932ebccfcb9982881d296fc4c" + "reference": "a2baf9c3c5b25e04740cece0e429f0a0013002f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/fde4bdb10bf197f932ebccfcb9982881d296fc4c", - "reference": "fde4bdb10bf197f932ebccfcb9982881d296fc4c", + "url": "https://api.github.com/repos/symfony/http-client/zipball/a2baf9c3c5b25e04740cece0e429f0a0013002f2", + "reference": "a2baf9c3c5b25e04740cece0e429f0a0013002f2", "shasum": "" }, "require": { @@ -7717,7 +8233,7 @@ "description": "Provides powerful methods to fetch HTTP resources synchronously or asynchronously", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-client/tree/v5.3.3" + "source": "https://github.com/symfony/http-client/tree/v5.2.8" }, "funding": [ { @@ -7733,7 +8249,7 @@ "type": "tidelift" } ], - "time": "2021-06-24T08:13:00+00:00" + "time": "2021-05-10T14:39:23+00:00" }, { "name": "symfony/http-client-contracts", @@ -7888,16 +8404,16 @@ }, { "name": "symfony/http-kernel", - "version": "v5.3.6", + "version": "v5.2.8", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "60030f209018356b3b553b9dbd84ad2071c1b7e0" + "reference": "c3cb71ee7e2d3eae5fe1001f81780d6a49b37937" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/60030f209018356b3b553b9dbd84ad2071c1b7e0", - "reference": "60030f209018356b3b553b9dbd84ad2071c1b7e0", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/c3cb71ee7e2d3eae5fe1001f81780d6a49b37937", + "reference": "c3cb71ee7e2d3eae5fe1001f81780d6a49b37937", "shasum": "" }, "require": { @@ -7980,7 +8496,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v5.3.6" + "source": "https://github.com/symfony/http-kernel/tree/v5.2.8" }, "funding": [ { @@ -7996,7 +8512,7 @@ "type": "tidelift" } ], - "time": "2021-07-29T07:06:27+00:00" + "time": "2021-05-12T13:27:53+00:00" }, { "name": "symfony/mime", @@ -9535,16 +10051,16 @@ }, { "name": "symfony/var-dumper", - "version": "v5.3.6", + "version": "v5.2.8", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "3dd8ddd1e260e58ecc61bb78da3b6584b3bfcba0" + "reference": "d693200a73fae179d27f8f1b16b4faf3e8569eba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/3dd8ddd1e260e58ecc61bb78da3b6584b3bfcba0", - "reference": "3dd8ddd1e260e58ecc61bb78da3b6584b3bfcba0", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/d693200a73fae179d27f8f1b16b4faf3e8569eba", + "reference": "d693200a73fae179d27f8f1b16b4faf3e8569eba", "shasum": "" }, "require": { @@ -9603,7 +10119,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v5.3.6" + "source": "https://github.com/symfony/var-dumper/tree/v5.2.8" }, "funding": [ { @@ -9619,7 +10135,7 @@ "type": "tidelift" } ], - "time": "2021-07-27T01:56:02+00:00" + "time": "2021-05-07T13:42:21+00:00" }, { "name": "tijsverkoyen/css-to-inline-styles", @@ -10056,16 +10572,16 @@ }, { "name": "barryvdh/laravel-debugbar", - "version": "v3.6.2", + "version": "v3.5.7", "source": { "type": "git", "url": "https://github.com/barryvdh/laravel-debugbar.git", - "reference": "70b89754913fd89fef16d0170a91dbc2a5cd633a" + "reference": "88fd9cfa144b06b2549e9d487fdaec68265e791e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/70b89754913fd89fef16d0170a91dbc2a5cd633a", - "reference": "70b89754913fd89fef16d0170a91dbc2a5cd633a", + "url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/88fd9cfa144b06b2549e9d487fdaec68265e791e", + "reference": "88fd9cfa144b06b2549e9d487fdaec68265e791e", "shasum": "" }, "require": { @@ -10125,7 +10641,7 @@ ], "support": { "issues": "https://github.com/barryvdh/laravel-debugbar/issues", - "source": "https://github.com/barryvdh/laravel-debugbar/tree/v3.6.2" + "source": "https://github.com/barryvdh/laravel-debugbar/tree/v3.5.7" }, "funding": [ { @@ -10137,7 +10653,7 @@ "type": "github" } ], - "time": "2021-06-14T14:29:26+00:00" + "time": "2021-05-13T20:18:35+00:00" }, { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -11494,12 +12010,12 @@ "source": { "type": "git", "url": "https://github.com/nunomaduro/phpinsights.git", - "reference": "d4f92e93a2a5ddf90664eb6a4cb9d159440abbcf" + "reference": "85a5670ab2492cfe489eff23b5a14d4c9364ac3f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nunomaduro/phpinsights/zipball/d4f92e93a2a5ddf90664eb6a4cb9d159440abbcf", - "reference": "d4f92e93a2a5ddf90664eb6a4cb9d159440abbcf", + "url": "https://api.github.com/repos/nunomaduro/phpinsights/zipball/85a5670ab2492cfe489eff23b5a14d4c9364ac3f", + "reference": "85a5670ab2492cfe489eff23b5a14d4c9364ac3f", "shasum": "" }, "require": { @@ -11596,7 +12112,7 @@ "type": "patreon" } ], - "time": "2021-04-29T06:43:47+00:00" + "time": "2021-05-13T17:16:42+00:00" }, { "name": "openlss/lib-array2xml", @@ -12261,16 +12777,16 @@ }, { "name": "phpstan/phpstan", - "version": "0.12.94", + "version": "0.12.87", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "3d0ba4c198a24e3c3fc489f3ec6ac9612c4be5d6" + "reference": "d464e00776afb711f419faffa96826dc02e4d145" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/3d0ba4c198a24e3c3fc489f3ec6ac9612c4be5d6", - "reference": "3d0ba4c198a24e3c3fc489f3ec6ac9612c4be5d6", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/d464e00776afb711f419faffa96826dc02e4d145", + "reference": "d464e00776afb711f419faffa96826dc02e4d145", "shasum": "" }, "require": { @@ -12301,7 +12817,7 @@ "description": "PHPStan - PHP Static Analysis Tool", "support": { "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/0.12.94" + "source": "https://github.com/phpstan/phpstan/tree/0.12.87" }, "funding": [ { @@ -12321,7 +12837,7 @@ "type": "tidelift" } ], - "time": "2021-07-30T09:05:27+00:00" + "time": "2021-05-12T15:17:52+00:00" }, { "name": "phpunit/php-code-coverage", @@ -12864,12 +13380,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "07314cf15422b2e162d591fe8ef2b850612b808f" + "reference": "5ffdb87f627ff16cc392e30515a1fe069cddc3e2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/07314cf15422b2e162d591fe8ef2b850612b808f", - "reference": "07314cf15422b2e162d591fe8ef2b850612b808f", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/5ffdb87f627ff16cc392e30515a1fe069cddc3e2", + "reference": "5ffdb87f627ff16cc392e30515a1fe069cddc3e2", "shasum": "" }, "conflict": { @@ -12917,8 +13433,8 @@ "doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1|>=2.8.3,<2.8.4", "dolibarr/dolibarr": "<11.0.4", "dompdf/dompdf": ">=0.6,<0.6.2", - "drupal/core": ">=7,<7.74|>=8,<8.8.11|>=8.9,<8.9.9|>=9,<9.0.8", - "drupal/drupal": ">=7,<7.74|>=8,<8.8.11|>=8.9,<8.9.9|>=9,<9.0.8", + "drupal/core": ">=7,<7.80|>=8,<8.9.14|>=9,<9.0.12|>=9.1,<9.1.7", + "drupal/drupal": ">=7,<7.80|>=8,<8.9.14|>=9,<9.0.12|>=9.1,<9.1.7", "dweeves/magmi": "<=0.7.24", "endroid/qr-code-bundle": "<3.4.2", "enshrined/svg-sanitize": "<0.13.1", @@ -12977,6 +13493,7 @@ "laravel/framework": "<6.20.26|>=7,<8.40", "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10", "league/commonmark": "<0.18.3", + "lexik/jwt-authentication-bundle": ">=2,<2.10.7|>=2.11,<2.11.3", "librenms/librenms": "<21.1", "livewire/livewire": ">2.2.4,<2.2.6", "magento/community-edition": ">=2,<2.2.10|>=2.3,<2.3.3", @@ -13097,20 +13614,21 @@ "symfony/http-foundation": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8|>=4.4,<4.4.7|>=5,<5.0.7", "symfony/http-kernel": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.4.13|>=5,<5.1.5", "symfony/intl": ">=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", + "symfony/maker-bundle": ">=1.27,<1.31.1", "symfony/mime": ">=4.3,<4.3.8", "symfony/phpunit-bridge": ">=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", "symfony/polyfill": ">=1,<1.10", "symfony/polyfill-php55": ">=1,<1.10", "symfony/proxy-manager-bridge": ">=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", "symfony/routing": ">=2,<2.0.19", - "symfony/security": ">=2,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7|>=4.4,<4.4.7|>=5,<5.0.7", + "symfony/security": ">=2,<2.7.51|>=2.8,<3.4.48|>=4,<4.4.23|>=5,<5.2.8", "symfony/security-bundle": ">=2,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", - "symfony/security-core": ">=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8,<2.8.37|>=3,<3.3.17|>=3.4,<3.4.7|>=4,<4.0.7", + "symfony/security-core": ">=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8,<3.4.48|>=4,<4.4.23|>=5,<5.2.8", "symfony/security-csrf": ">=2.4,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", - "symfony/security-guard": ">=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", - "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.2.12|>=4.3,<4.3.8|>=4.4,<4.4.7|>=5,<5.0.7", + "symfony/security-guard": ">=2.8,<3.4.48|>=4,<4.4.23|>=5,<5.2.8", + "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.51|>=2.8,<3.4.48|>=4,<4.4.23|>=5,<5.2.8", "symfony/serializer": ">=2,<2.0.11", - "symfony/symfony": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.4.13|>=5,<5.1.5", + "symfony/symfony": ">=2,<3.4.48|>=4,<4.4.23|>=5,<5.2.8", "symfony/translation": ">=2,<2.0.17", "symfony/validator": ">=2,<2.0.24|>=2.1,<2.1.12|>=2.2,<2.2.5|>=2.3,<2.3.3", "symfony/var-exporter": ">=4.2,<4.2.12|>=4.3,<4.3.8", @@ -13210,7 +13728,7 @@ "type": "tidelift" } ], - "time": "2021-05-06T19:08:33+00:00" + "time": "2021-05-13T21:03:10+00:00" }, { "name": "sebastian/cli-parser", @@ -14563,16 +15081,16 @@ }, { "name": "symfony/cache", - "version": "v5.3.3", + "version": "v5.2.8", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "82962a497f090e95e3b357c21bf6f54991c9b1a5" + "reference": "c13bfc6682a669e6ba592ba3305139ebf946a811" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/82962a497f090e95e3b357c21bf6f54991c9b1a5", - "reference": "82962a497f090e95e3b357c21bf6f54991c9b1a5", + "url": "https://api.github.com/repos/symfony/cache/zipball/c13bfc6682a669e6ba592ba3305139ebf946a811", + "reference": "c13bfc6682a669e6ba592ba3305139ebf946a811", "shasum": "" }, "require": { @@ -14639,7 +15157,7 @@ "psr6" ], "support": { - "source": "https://github.com/symfony/cache/tree/v5.3.3" + "source": "https://github.com/symfony/cache/tree/v5.2.8" }, "funding": [ { @@ -14655,7 +15173,7 @@ "type": "tidelift" } ], - "time": "2021-06-24T08:13:00+00:00" + "time": "2021-05-07T13:41:16+00:00" }, { "name": "symfony/cache-contracts", diff --git a/config/octane.php b/config/octane.php new file mode 100644 index 00000000..b85dde35 --- /dev/null +++ b/config/octane.php @@ -0,0 +1,208 @@ + env('OCTANE_SERVER', 'roadrunner'), + + /* + |-------------------------------------------------------------------------- + | Force HTTPS + |-------------------------------------------------------------------------- + | + | When this configuration value is set to "true", Octane will inform the + | framework that all absolute links must be generated using the HTTPS + | protocol. Otherwise your links may be generated using plain HTTP. + | + */ + + 'https' => env('OCTANE_HTTPS', false), + + /* + |-------------------------------------------------------------------------- + | Octane Listeners + |-------------------------------------------------------------------------- + | + | All of the event listeners for Octane's events are defined below. These + | listeners are responsible for resetting your application's state for + | the next request. You may even add your own listeners to the list. + | + */ + + 'listeners' => [ + WorkerStarting::class => [ + EnsureUploadedFilesAreValid::class, + ], + + RequestReceived::class => [ + ...Octane::prepareApplicationForNextOperation(), + ...Octane::prepareApplicationForNextRequest(), + // + ], + + RequestHandled::class => [ + // + ], + + RequestTerminated::class => [ + // + ], + + TaskReceived::class => [ + ...Octane::prepareApplicationForNextOperation(), + // + ], + + TickReceived::class => [ + ...Octane::prepareApplicationForNextOperation(), + // + ], + + OperationTerminated::class => [ + FlushTemporaryContainerInstances::class, + // DisconnectFromDatabases::class, + // CollectGarbage::class, + ], + + WorkerErrorOccurred::class => [ + ReportException::class, + StopWorkerIfNecessary::class, + ], + + WorkerStopping::class => [ + // + ], + ], + + /* + |-------------------------------------------------------------------------- + | Warm / Flush Bindings + |-------------------------------------------------------------------------- + | + | The bindings listed below will either be pre-warmed when a worker boots + | or they will be flushed before every new request. Flushing a binding + | will force the container to resolve that binding again when asked. + | + */ + + 'warm' => [ + ...Octane::defaultServicesToWarm(), + ], + + 'flush' => [ + // + ], + + /* + |-------------------------------------------------------------------------- + | Octane Cache Table + |-------------------------------------------------------------------------- + | + | While using Swoole, you may leverage the Octane cache, which is powered + | by a Swoole table. You may set the maximum number of rows as well as + | the number of bytes per row using the configuration options below. + | + */ + + 'cache' => [ + 'rows' => 1000, + 'bytes' => 10000, + ], + + /* + |-------------------------------------------------------------------------- + | Octane Swoole Tables + |-------------------------------------------------------------------------- + | + | While using Swoole, you may define additional tables as required by the + | application. These tables can be used to store data that needs to be + | quickly accessed by other workers on the particular Swoole server. + | + */ + + 'tables' => [ + 'example:1000' => [ + 'name' => 'string:1000', + 'votes' => 'int', + ], + ], + + /* + |-------------------------------------------------------------------------- + | File Watching + |-------------------------------------------------------------------------- + | + | The following list of files and directories will be watched when using + | the --watch option offered by Octane. If any of the directories and + | files are changed, Octane will automatically reload your workers. + | + */ + + 'watch' => [ + 'app', + 'bootstrap', + 'config', + 'database', + 'public/**/*.php', + 'resources/**/*.php', + 'routes', + 'composer.lock', + '.env', + ], + + /* + |-------------------------------------------------------------------------- + | Garbage Collection Threshold + |-------------------------------------------------------------------------- + | + | When executing long-lived PHP scripts such as Octane, memory can build + | up before being cleared by PHP. You can force Octane to run garbage + | collection if your application consumes this amount of megabytes. + | + */ + + 'garbage' => 50, + + /* + |-------------------------------------------------------------------------- + | Maximum Execution Time + |-------------------------------------------------------------------------- + | + | The following setting configures the maximum execution time for requests + | being handled by Octane. You may set this value to 0 to indicate that + | there isn't a specific time limit on Octane request execution time. + | + */ + + 'max_execution_time' => 30, + +]; diff --git a/docker-compose.yml b/docker-compose.yml index 38d17151..0cb9842d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,47 +1,28 @@ version: "3.7" services: - nginx: - image: ${REGISTRY:-localhost}/devhub_nginx:latest - build: - context: ./ - dockerfile: .docker/develop/nginx/Dockerfile - cache_from: - - ${REGISTRY:-localhost}/devhub_nginx:latest - container_name: nginx - ports: - - "8090:80" - volumes: - - ./:/var/www/ - depends_on: - - php - - mysql - - redis - networks: - - devhub - - mysql: - image: ${REGISTRY:-localhost}/devhub_mysql:latest - build: - context: ./ - dockerfile: .docker/develop/mysql/Dockerfile - cache_from: - - ${REGISTRY:-localhost}/devhub_mysql:latest - container_name: mysql - restart: unless-stopped - tty: true - ports: - - '${FORWARD_DB_PORT:-4306}:3306' - environment: - MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}' - MYSQL_DATABASE: '${DB_DATABASE:-devhub}' - MYSQL_USER: '${DB_USERNAME:-root}' - MYSQL_PASSWORD: '${DB_PASSWORD}' - MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' - volumes: - - mysql:/var/lib/mysql - networks: - - devhub + mysql: + image: ${REGISTRY:-localhost}/devhub_mysql:latest + build: + context: ./ + dockerfile: .docker/develop/mysql/Dockerfile + cache_from: + - ${REGISTRY:-localhost}/devhub_mysql:latest + container_name: mysql + restart: unless-stopped + tty: true + ports: + - '${FORWARD_DB_PORT:-4306}:3306' + environment: + MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}' + MYSQL_DATABASE: '${DB_DATABASE:-devhub}' + MYSQL_USER: '${DB_USERNAME:-root}' + MYSQL_PASSWORD: '${DB_PASSWORD}' + MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' + volumes: + - mysql:/var/lib/mysql + networks: + - devhub redis: container_name: redis @@ -51,28 +32,24 @@ services: networks: - devhub - php: - image: ${REGISTRY:-localhost}/devhub:latest - build: - context: ./ - dockerfile: .docker/develop/php/Dockerfile - cache_from: - - ${REGISTRY:-localhost}/devhub:latest - container_name: php - environment: - PHP_IDE_CONFIG: 'serverName=docker' - volumes: - - ./:/var/www/ - # - ./.docker/develop/php/local.ini:/usr/local/etc/php/conf.d - - ./.docker/develop/php/xdebug.ini:/usr/local/etc/php/conf.d/xdebug.ini - ports: - - "9000:9000" - networks: - - devhub - -networks: - devhub: - driver: bridge + php: + image: ${REGISTRY:-localhost}/devhub:latest + build: + context: ./ + dockerfile: .docker/develop/php/Dockerfile + cache_from: + - ${REGISTRY:-localhost}/devhub:latest + container_name: php + tty: true + volumes: + - ./:/var/www/ + ports: + - "8090:8000" + depends_on: + - mysql + - redis + networks: + - devhub volumes: mysql: diff --git a/resources/views/admin/include/adminbar.blade.php b/resources/views/admin/include/adminbar.blade.php index db7f686e..1d195a5c 100644 --- a/resources/views/admin/include/adminbar.blade.php +++ b/resources/views/admin/include/adminbar.blade.php @@ -25,10 +25,10 @@ {{-- --}} {{--

{{ $admin['cache'] }}

--}} {{-- --}} -
- -

{{ Numeric::bcmul_alternative((microtime(true) - LARAVEL_START), '1000', 2) }}ms

-
+{{--
--}} +{{-- --}} +{{--

{{ bcmul((microtime(true) - LARAVEL_START), '1000', 0) }}ms

--}} +{{--
--}}

{{ Numeric::convert(memory_get_usage(true)) }}

diff --git a/resources/views/include/footer.blade.php b/resources/views/include/footer.blade.php index 32743ade..ffa6d78a 100644 --- a/resources/views/include/footer.blade.php +++ b/resources/views/include/footer.blade.php @@ -15,7 +15,8 @@ class="h-8 xs:h-9 mb-4 dark:hidden">

DevHub

@@ -66,7 +68,7 @@ class="h-8 xs:h-9 mb-4 dark:hidden"> @endif > data-icon="ant-design:github-filled" data-inline="false"> - diff --git a/resources/views/pages/contact.blade.php b/resources/views/pages/contact.blade.php new file mode 100644 index 00000000..db70bab7 --- /dev/null +++ b/resources/views/pages/contact.blade.php @@ -0,0 +1,44 @@ +@extends('layouts.layout') + +@section('title'){{ __('devhub.contact') }}@stop + +@section('main') +
+

Обратная связь

+
+ @csrf +
+ + +
+
+ + +

+ На этот адрес будет отправлен ответ службы поддержки +

+
+
+ + +
+ +
+
+@endsection diff --git a/resources/views/pages/profile/show/info.blade.php b/resources/views/pages/profile/show/info.blade.php index 24a6dc7e..750c16bc 100644 --- a/resources/views/pages/profile/show/info.blade.php +++ b/resources/views/pages/profile/show/info.blade.php @@ -5,7 +5,7 @@ @section('main')
@include('pages.profile.include.header') -
+
@include('pages.profile.include.tabs')
diff --git a/routes/web.php b/routes/web.php index 97451379..265f3f80 100644 --- a/routes/web.php +++ b/routes/web.php @@ -7,13 +7,13 @@ use App\Http\Controllers\Auth\LoginController; use App\Http\Controllers\Auth\UserSettingsController; use App\Http\Controllers\AuthorController; +use App\Http\Controllers\ContactController; use App\Http\Controllers\HomeController; use App\Http\Controllers\HubController; use App\Http\Controllers\ProfileController; use App\Http\Controllers\SearchController; use App\Http\Controllers\StatusController; use Carbon\Carbon; -use Illuminate\Http\Response; use Illuminate\Support\Facades\Route; Auth::routes(['verify' => true]); @@ -162,11 +162,5 @@ function () { } ); -Route::get( - 'test', - function () { - sleep(1); - - return new Response(['status' => 'success']); - } -); +Route::get('feedback', [ContactController::class, 'show']); +Route::post('feedback', [ContactController::class, 'send'])->name('feedback');