mirror of
https://github.com/ToxicCrack/PrintABrick.git
synced 2025-05-15 20:00:08 -07:00
Setup ElasticSearch
This commit is contained in:
parent
8528817e0b
commit
1c39cc1f81
@ -20,8 +20,8 @@ class AppKernel extends Kernel
|
||||
new Knp\Bundle\MenuBundle\KnpMenuBundle(),
|
||||
new Oneup\FlysystemBundle\OneupFlysystemBundle(),
|
||||
new Knp\Bundle\PaginatorBundle\KnpPaginatorBundle(),
|
||||
new Lexik\Bundle\FormFilterBundle\LexikFormFilterBundle(),
|
||||
new Liip\ImagineBundle\LiipImagineBundle(),
|
||||
new FOS\ElasticaBundle\FOSElasticaBundle()
|
||||
];
|
||||
|
||||
if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
|
||||
|
@ -2,6 +2,8 @@ imports:
|
||||
- { resource: parameters.yml }
|
||||
- { resource: security.yml }
|
||||
- { resource: services.yml }
|
||||
- { resource: config/fos_elastica.yml }
|
||||
- { resource: config/liip_imagine.yml }
|
||||
|
||||
# Put parameters here that don't need to change on each machine where the app is deployed
|
||||
# http://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
|
||||
@ -42,7 +44,7 @@ framework:
|
||||
twig:
|
||||
debug: "%kernel.debug%"
|
||||
strict_variables: "%kernel.debug%"
|
||||
form_themes: ['form/semantic-ui.html.twig', 'LexikFormFilterBundle:Form:form_div_layout.html.twig']
|
||||
form_themes: ['form/semantic-ui.html.twig', 'form/search.html.twig']
|
||||
|
||||
# Doctrine Configuration
|
||||
doctrine:
|
||||
@ -74,14 +76,6 @@ doctrine_migrations:
|
||||
table_name: migration_versions
|
||||
name: Application Migrations
|
||||
|
||||
## Swiftmailer Configuration
|
||||
#swiftmailer:
|
||||
# transport: "%mailer_transport%"
|
||||
# host: "%mailer_host%"
|
||||
# username: "%mailer_user%"
|
||||
# password: "%mailer_password%"
|
||||
# spool: { type: memory }
|
||||
|
||||
monolog:
|
||||
channels: ['loader']
|
||||
handlers:
|
||||
@ -109,40 +103,6 @@ knp_paginator:
|
||||
pagination: :pagination:knp_pagination.html.twig
|
||||
sortable: KnpPaginatorBundle:Pagination:sortable_link.html.twig # sort link template
|
||||
|
||||
liip_imagine:
|
||||
resolvers:
|
||||
default:
|
||||
web_path: ~
|
||||
|
||||
filter_sets:
|
||||
set_min:
|
||||
quality: 80
|
||||
data_loader: set_image_loader
|
||||
cache: ~
|
||||
filters:
|
||||
thumbnail: { size: [200, 200], mode: inset }
|
||||
background: { size: [250, 250], position: center, color: '#FFFFFF' }
|
||||
set_large:
|
||||
data_loader: set_image_loader
|
||||
cache: ~
|
||||
quality: 92
|
||||
filters:
|
||||
thumbnail: { size: [840, 580], mode: inset }
|
||||
background: { size: [900, 600], position: center, color: '#FFFFFF' }
|
||||
part_large:
|
||||
data_loader: part_image_loader
|
||||
cache: ~
|
||||
quality: 92
|
||||
filters:
|
||||
thumbnail: { size: [840, 580], mode: inset }
|
||||
background: { size: [900, 600], position: center, color: '#FFFFFF' }
|
||||
part_min:
|
||||
quality: 80
|
||||
data_loader: part_image_loader
|
||||
cache: ~
|
||||
filters:
|
||||
thumbnail: { size: [200, 200], mode: inset }
|
||||
background: { size: [250, 250], position: center, color: '#FFFFFF' }
|
||||
oneup_flysystem:
|
||||
adapters:
|
||||
media:
|
||||
|
47
app/config/config/fos_elastica.yml
Normal file
47
app/config/config/fos_elastica.yml
Normal file
@ -0,0 +1,47 @@
|
||||
fos_elastica:
|
||||
clients:
|
||||
default: { host: '%elastica_host%', port: '%elastica_port%', logger: false }
|
||||
indexes:
|
||||
app:
|
||||
index_name: app_%kernel.environment%
|
||||
types:
|
||||
set:
|
||||
mappings:
|
||||
id: ~
|
||||
name: { type: string }
|
||||
year: { type: integer }
|
||||
partCount: { type: integer }
|
||||
theme:
|
||||
type: "object"
|
||||
properties:
|
||||
id: ~
|
||||
name: { type: string }
|
||||
persistence:
|
||||
driver: orm
|
||||
model: AppBundle\Entity\Rebrickable\Set
|
||||
provider: ~
|
||||
finder: ~
|
||||
repository: AppBundle\Repository\Search\SetRepository
|
||||
model:
|
||||
mappings:
|
||||
id: ~
|
||||
name: { type: string }
|
||||
aliases:
|
||||
type: "object"
|
||||
properties:
|
||||
id: ~
|
||||
category:
|
||||
type: "object"
|
||||
properties:
|
||||
id: ~
|
||||
name: { type: string }
|
||||
keywords:
|
||||
type: "object"
|
||||
properties:
|
||||
name: ~
|
||||
persistence:
|
||||
driver: orm
|
||||
model: AppBundle\Entity\LDraw\Model
|
||||
provider: ~
|
||||
finder: ~
|
||||
repository: AppBundle\Repository\Search\ModelRepository
|
38
app/config/config/liip_imagine.yml
Normal file
38
app/config/config/liip_imagine.yml
Normal file
@ -0,0 +1,38 @@
|
||||
liip_imagine:
|
||||
resolvers:
|
||||
default:
|
||||
web_path: ~
|
||||
|
||||
filter_sets:
|
||||
set_min:
|
||||
quality: 90
|
||||
data_loader: set_image_loader
|
||||
cache: ~
|
||||
default_image: "/resources/images/noimage_min.png"
|
||||
filters:
|
||||
thumbnail: { size: [200, 200], mode: inset }
|
||||
background: { size: [250, 250], position: center, color: '#FFFFFF' }
|
||||
set_large:
|
||||
data_loader: set_image_loader
|
||||
cache: ~
|
||||
quality: 90
|
||||
default_image: "/resources/images/noimage_large.png"
|
||||
filters:
|
||||
thumbnail: { size: [840, 580], mode: inset }
|
||||
background: { size: [900, 600], position: center, color: '#FFFFFF' }
|
||||
part_min:
|
||||
quality: 90
|
||||
data_loader: part_image_loader
|
||||
cache: ~
|
||||
default_image: "/resources/images/noimage_min.png"
|
||||
filters:
|
||||
thumbnail: { size: [200, 200], mode: inset }
|
||||
background: { size: [250, 250], position: center, color: '#FFFFFF' }
|
||||
part_large:
|
||||
data_loader: part_image_loader
|
||||
cache: ~
|
||||
quality: 90
|
||||
default_image: "/resources/images/noimage_large.png"
|
||||
filters:
|
||||
thumbnail: { size: [840, 580], mode: inset }
|
||||
background: { size: [900, 600], position: center, color: '#FFFFFF' }
|
@ -10,6 +10,10 @@ parameters:
|
||||
# You should uncomment this if you want use pdo_sqlite
|
||||
# database_path: "%kernel.root_dir%/data.db3"
|
||||
|
||||
# https://www.elastic.co/guide/en/elasticsearch/reference/current/getting-started.html
|
||||
elastica_host : localhost
|
||||
elastica_port : 9200
|
||||
|
||||
# A secret key that's used to generate certain security-related tokens
|
||||
secret: ThisTokenIsNotSoSecretChangeIt
|
||||
|
||||
|
@ -1,20 +1,21 @@
|
||||
services:
|
||||
form.filter.category:
|
||||
class: AppBundle\Form\Filter\Model\CategoryFilterType
|
||||
arguments:
|
||||
- '@repository.ldraw.category'
|
||||
tags:
|
||||
- { name: form.type }
|
||||
|
||||
form.filter.brickset:
|
||||
class: AppBundle\Form\FilterSetType
|
||||
arguments: ['@api.manager.brickset']
|
||||
tags:
|
||||
- { name: form.type }
|
||||
|
||||
form.filter.theme:
|
||||
class: AppBundle\Form\Filter\Set\ThemeFilterType
|
||||
form.search.model:
|
||||
class: AppBundle\Form\Search\ModelSearchType
|
||||
arguments:
|
||||
- '@repository.rebrickable.theme'
|
||||
- '@repository.ldraw.category'
|
||||
tags:
|
||||
- { name: form.type }
|
||||
|
||||
form.search.set:
|
||||
class: AppBundle\Form\Search\SetSearchType
|
||||
arguments:
|
||||
- '@repository.rebrickable.theme'
|
||||
- '@repository.rebrickable.set'
|
||||
tags:
|
||||
- { name: form.type }
|
||||
|
@ -25,10 +25,10 @@
|
||||
"incenteev/composer-parameter-handler": "^2.0",
|
||||
"guzzlehttp/guzzle": "^6.2",
|
||||
"knplabs/knp-menu-bundle": "^2.1",
|
||||
"oneup/flysystem-bundle": "^1.7",
|
||||
"knplabs/knp-paginator-bundle": "^2.5",
|
||||
"lexik/form-filter-bundle": "~5.0",
|
||||
"liip/imagine-bundle": "^1.7"
|
||||
"oneup/flysystem-bundle": "^1.7",
|
||||
"liip/imagine-bundle": "^1.7",
|
||||
"friendsofsymfony/elastica-bundle": "^4.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"sensio/generator-bundle": "^3.0",
|
||||
|
3115
composer.lock
generated
3115
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@ -633,12 +633,6 @@ class SymfonyRequirements extends RequirementCollection
|
||||
'Install and enable the <strong>mbstring</strong> extension.'
|
||||
);
|
||||
|
||||
$this->addRecommendation(
|
||||
function_exists('iconv'),
|
||||
'iconv() should be available',
|
||||
'Install and enable the <strong>iconv</strong> extension.'
|
||||
);
|
||||
|
||||
$this->addRecommendation(
|
||||
function_exists('utf8_decode'),
|
||||
'utf8_decode() should be available',
|
||||
|
@ -11,7 +11,7 @@
|
||||
*/
|
||||
|
||||
if (!isset($_SERVER['HTTP_HOST'])) {
|
||||
exit('This script cannot be run from the CLI. Run it from a browser.');
|
||||
exit("This script cannot be run from the CLI. Run it from a browser.\n");
|
||||
}
|
||||
|
||||
if (!in_array(@$_SERVER['REMOTE_ADDR'], array(
|
||||
|
Loading…
x
Reference in New Issue
Block a user