Skip to content
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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Alex dolgov/hw5 #576

wants to merge 8 commits into from

Conversation

DolgovAleksandr
Copy link

No description provided.

@@ -0,0 +1 @@
FROM memcached:latest
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Если мы не собираемся как-то менять базовый образ, то нам нет нужды описывать dockerfile, можем просто использовать базовый образ.


use Exception;

function validateString(string $string): bool {
Copy link

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
Copy link

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();

@@ -0,0 +1,35 @@
<?php
Copy link

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)) {
Copy link

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants