-
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
Alex dolgov/hw5 #576
base: main
Are you sure you want to change the base?
Alex dolgov/hw5 #576
Conversation
docker/memcached/Dockerfile
Outdated
@@ -0,0 +1 @@ | |||
FROM memcached: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.
Если мы не собираемся как-то менять базовый образ, то нам нет нужды описывать dockerfile, можем просто использовать базовый образ.
src/validator.php
Outdated
|
||
use Exception; | ||
|
||
function validateString(string $string): 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.
Обратите внимание на предупреждение линтера и исправьте пожалуйста форматирование.
src/index.php
Outdated
@@ -0,0 +1,25 @@ | |||
<?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.
Пожалуйста, используйте паттерн фронт-контроллер. Пусть в index.php будет только инициализация приложения и его запуск:
$app = new App();
echo $app->run();
src/validator.php
Outdated
@@ -0,0 +1,35 @@ | |||
<?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.
Данный файл лежит в папке, которую обслуживает nginx. Как итог, пользователь может запросить её напрямую - это плохо. Нужно создать отдельную папку public, где будет только index.php.
{ | ||
public static function validateString(string $string): bool | ||
{ | ||
if (preg_match('/^(\((?1)*\))*$/', $string)) { |
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.
Можно просто return preg_match('/^(\((?1)*\))*$/', $string)
No description provided.