-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
86,103 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
APP_ENV=dev | ||
ELASTICSEARCH_HOST=localhost:9200 | ||
ELASTICSEARCH_USER=elastic | ||
ELASTICSEARCH_PASSWORD=password | ||
ELASTICSEARCH_CA_BUNDLE=path/to/http_ca.crt | ||
ELASTIC_INDEX=otus-books | ||
INDEX_FILE_PATH=files/books.json | ||
PAGE_SIZE=100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,5 @@ | |
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
.env | ||
/config/http_ca.crt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM php:8.2-cli | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
libzip-dev \ | ||
unzip \ | ||
&& docker-php-ext-install zip | ||
|
||
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer | ||
|
||
ARG SOURCE_PATH=/var/www/html | ||
WORKDIR $SOURCE_PATH | ||
COPY . $SOURCE_PATH | ||
RUN composer install --no-dev --optimize-autoloader | ||
|
||
CMD ["php", "-S", "0.0.0.0:8000"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,56 @@ | ||
# PHP_2024 | ||
# OTUS BOOK SHOP | ||
|
||
https://otus.ru/lessons/razrabotchik-php/?utm_source=github&utm_medium=free&utm_campaign=otus | ||
```shell | ||
docker exec -ti book_shop chmod +x app | ||
``` | ||
|
||
# Для получения данных с сайта используется команда. | ||
|
||
```shell | ||
docker exec -ti book_shop php app app:spider | ||
``` | ||
|
||
Более подробная информация | ||
|
||
```shell | ||
docker exec -ti book_shop php app app:spider --help | ||
``` | ||
|
||
# Для индексирования данных в эластик команда. | ||
|
||
```shell | ||
docker exec -ti book_shop php app app:bulk | ||
``` | ||
|
||
Более подробная информация | ||
|
||
```shell | ||
docker exec -ti book_shop php app app:bulk --help | ||
``` | ||
|
||
# Для поиска используется команда. | ||
|
||
```shell | ||
docker exec -ti book_shop php app app:search | ||
``` | ||
|
||
Команда поддерживает опции: | ||
|
||
```shell | ||
--title="Поиск по названию" # Поиск по части названия | ||
--price=">100" --price="<=200" # Указание фильтра по ценам | ||
--is_comment # Выводит книги только с комментариями | ||
--page=1 # Для постраничного вывода. На одной странице выводится 100. | ||
``` | ||
|
||
Более подробная информация | ||
|
||
```shell | ||
docker exec -ti book_shop php app app:search --help | ||
``` | ||
|
||
# Для более подробной информации по проекту. | ||
|
||
```shell | ||
docker exec -ti book_shop php app --help | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env php | ||
|
||
<?php | ||
|
||
require __DIR__.'/vendor/autoload.php'; | ||
|
||
use KRudenko\Otus\Core\Kernel; | ||
|
||
$kernel = new Kernel(); | ||
$kernel->handleCommand($argv); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"name": "krudenko/hw13", | ||
"description": "Otus Home Work 13", | ||
"type": "project", | ||
"autoload": { | ||
"psr-4": { | ||
"KRudenko\\Otus\\": "src/" | ||
} | ||
}, | ||
"require": { | ||
"php": "^8.2", | ||
"elasticsearch/elasticsearch": "^8.17", | ||
"vlucas/phpdotenv": "^5.6", | ||
"php-di/php-di": "^7.0", | ||
"symfony/console": "^7.2", | ||
"symfony/finder": "^7.2", | ||
"symfony/browser-kit": "^7.2", | ||
"symfony/http-client": "^7.2", | ||
"symfony/dom-crawler": "^7.2", | ||
"symfony/css-selector": "^7.2" | ||
}, | ||
"config": { | ||
"allow-plugins": { | ||
"php-http/discovery": true | ||
} | ||
} | ||
} |
Oops, something went wrong.