-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Домашнее задание №4 - Броузерное приложение и балансировщик #1169
base: main
Are you sure you want to change the base?
Conversation
balancer/memcached/Dockerfile
Outdated
@@ -0,0 +1 @@ | |||
FROM memcached:alpine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не нужно описывать образ с одним FROM. Просто используйте в docker-compose сам базовый образ memcached:alpine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Вот здесь не понял, будьте добры подробнее опишите
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Просто используйте в docker-compose секцию image и там укажите вот этот образ.
@@ -0,0 +1,44 @@ | |||
<?php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Поправьте все замечания линтера.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Какие конкретно замечания, я их не вижу.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Откройте пулл-реквест в github на последней вкладке - где показываются изменения.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Замечания линтера так и не поправлены.
Вы их можете посмотреть и на странице https://github.com/otusteamedu/PHP_2023/pull/1169/checks, там есть подсвеченный красным шаг пайплайна, нажмите на него и будет вывод код снифера. Так же вы можете запустить снифер локально.
balancer/src/code/Validator.php
Outdated
$message = []; | ||
//Проверяем строку регуляркой, чтобы не прошла строка )( | ||
if (preg_match("/^\(.*\)/", $postVar)){ | ||
if (preg_match_all("/(\()/u", $postVar, $m)){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Излишне усложнили. Есть более простое и эффективное решение - простой цикл в котором перебираем символа и увеличиваем счётчик на единицу если видим '(' и уменьшаем если видим ')'. Если во время итерации счётчки стал < 0, лишняя ')'. Если после цикла счётчик != 0 - то лишняя '(' или ')'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Согласен, переписал
balancer/src/code/Validator.php
Outdated
for ($i=1; $i<=$openCount; $i++){ | ||
//Если в процессе выполнение понимаем что строка пуста, отдаем 200 код, все ок | ||
if (empty($postVar)){ | ||
$message['code'] = 200; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Задача данного класса - провалидировать строку. Он не должен формировать HTTP ответ. Просто верните отсюда bool.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Согласен поправил
@@ -0,0 +1,44 @@ | |||
<?php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Откройте пулл-реквест в github на последней вкладке - где показываются изменения.
@@ -0,0 +1,44 @@ | |||
<?php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
balancer/nginx/Dockerfile
Outdated
@@ -0,0 +1,14 @@ | |||
FROM ubuntu:latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Есть образ с уже установленым nginx лучше использовать его.
https://hub.docker.com/_/nginx
@@ -0,0 +1,44 @@ | |||
<?php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Замечания линтера так и не поправлены.
Вы их можете посмотреть и на странице https://github.com/otusteamedu/PHP_2023/pull/1169/checks, там есть подсвеченный красным шаг пайплайна, нажмите на него и будет вывод код снифера. Так же вы можете запустить снифер локально.
No description provided.