Skip to content

Commit e95426e

Browse files
Merge feature/setup
1 parent 7103776 commit e95426e

53 files changed

Lines changed: 6313 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
*.DS_Store
2+
*.php~
3+
*.sublime-project
4+
*.sublime-workspace
5+
._*
6+
.dockerignore
7+
.editorconfig
8+
.git/
9+
.gitignore
10+
.gitmodules
11+
.travis.yml
12+
app/config/parameters.yml
13+
bin/
14+
composer.phar
15+
docker-compose.override.yml
16+
docker-compose.yml
17+
Dockerfile
18+
Thumbs.db
19+
README.md
20+
var/
21+
vendor/
22+
web/app_dev.php
23+
web/config.php
24+
web/bundles/
25+
26+
!bin/console

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/app/config/parameters.yml
2+
/build/
3+
/phpunit.xml
4+
/var/*
5+
!/var/cache
6+
/var/cache/*
7+
!var/cache/.gitkeep
8+
!/var/logs
9+
/var/logs/*
10+
!var/logs/.gitkeep
11+
!/var/sessions
12+
/var/sessions/*
13+
!var/sessions/.gitkeep
14+
!var/SymfonyRequirements.php
15+
/vendor/
16+
/web/bundles/
17+
/web/adminer.php

.travis.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
sudo: required
2+
3+
services:
4+
- docker
5+
6+
script:
7+
- docker-compose build
8+
- docker-compose run --rm web composer install -o -n
9+
- docker-compose run --rm web bin/console security:check

Dockerfile

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
FROM php:7.1-apache
2+
3+
# PHP extensions
4+
ENV APCU_VERSION 5.1.7
5+
RUN buildDeps=" \
6+
libicu-dev \
7+
zlib1g-dev \
8+
" \
9+
&& apt-get update \
10+
&& apt-get install -y --no-install-recommends \
11+
$buildDeps \
12+
libicu52 \
13+
zlib1g \
14+
&& rm -rf /var/lib/apt/lists/* \
15+
&& docker-php-ext-install \
16+
intl \
17+
mbstring \
18+
pdo_mysql \
19+
zip \
20+
&& apt-get purge -y --auto-remove $buildDeps
21+
RUN pecl install \
22+
apcu-$APCU_VERSION \
23+
&& docker-php-ext-enable --ini-name 05-opcache.ini \
24+
opcache \
25+
&& docker-php-ext-enable --ini-name 20-apcu.ini \
26+
apcu
27+
28+
# Apache config
29+
RUN a2enmod rewrite
30+
ADD docker/apache/vhost.conf /etc/apache2/sites-available/000-default.conf
31+
32+
# PHP config
33+
ADD docker/php/php.ini /usr/local/etc/php/php.ini
34+
35+
# Install Git
36+
RUN apt-get update \
37+
&& apt-get install -y --no-install-recommends \
38+
git \
39+
&& rm -rf /var/lib/apt/lists/*
40+
41+
# Add the application
42+
ADD . /app
43+
WORKDIR /app
44+
45+
# Fix permissions (useful if the host is Windows)
46+
RUN chmod +x docker/composer.sh docker/start.sh docker/apache/start_safe_perms
47+
48+
# Install composer
49+
RUN ./docker/composer.sh \
50+
&& mv composer.phar /usr/bin/composer \
51+
&& composer global require "hirak/prestissimo:^0.3"
52+
53+
RUN \
54+
# Remove var directory if it's accidentally included
55+
(rm -rf var || true) \
56+
# Create the var sub-directories
57+
&& mkdir -p var/cache var/logs var/sessions \
58+
# Install dependencies
59+
&& composer install --prefer-dist --no-scripts --no-dev --no-progress --no-suggest --optimize-autoloader --classmap-authoritative \
60+
# Fixes permissions issues in non-dev mode
61+
&& chown -R www-data . var/cache var/logs var/sessions
62+
63+
CMD ["/app/docker/start.sh"]

app/.htaccess

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<IfModule mod_authz_core.c>
2+
Require all denied
3+
</IfModule>
4+
<IfModule !mod_authz_core.c>
5+
Order deny,allow
6+
Deny from all
7+
</IfModule>

app/AppCache.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
use Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache;
4+
5+
/**
6+
* Class AppCache
7+
*/
8+
class AppCache extends HttpCache
9+
{
10+
}

app/AppKernel.php

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<?php
2+
3+
use Symfony\Component\Config\Loader\LoaderInterface;
4+
use Symfony\Component\HttpKernel\Kernel;
5+
6+
/**
7+
* Class AppKernel
8+
*/
9+
class AppKernel extends Kernel
10+
{
11+
/**
12+
* {@inheritdoc}
13+
*/
14+
public function registerBundles()
15+
{
16+
$bundles = [
17+
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
18+
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
19+
new Symfony\Bundle\TwigBundle\TwigBundle(),
20+
new Symfony\Bundle\MonologBundle\MonologBundle(),
21+
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
22+
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
23+
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
24+
new Dunglas\ActionBundle\DunglasActionBundle(),
25+
new ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle(),
26+
new Nelmio\CorsBundle\NelmioCorsBundle(),
27+
new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
28+
new Ds\Bundle\TopicBundle\DsTopicBundle(),
29+
];
30+
31+
if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
32+
$bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
33+
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
34+
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
35+
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
36+
}
37+
38+
return $bundles;
39+
}
40+
41+
/**
42+
* {@inheritdoc}
43+
*/
44+
public function getRootDir()
45+
{
46+
return __DIR__;
47+
}
48+
49+
/**
50+
* {@inheritdoc}
51+
*/
52+
public function getCacheDir()
53+
{
54+
return dirname(__DIR__).'/var/cache/'.$this->getEnvironment();
55+
}
56+
57+
/**
58+
* {@inheritdoc}
59+
*/
60+
public function getLogDir()
61+
{
62+
return dirname(__DIR__).'/var/logs';
63+
}
64+
65+
/**
66+
* {@inheritdoc}
67+
*/
68+
public function registerContainerConfiguration(LoaderInterface $loader)
69+
{
70+
$loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml');
71+
}
72+
}

app/autoload.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
use Composer\Autoload\ClassLoader;
4+
use Doctrine\Common\Annotations\AnnotationRegistry;
5+
6+
/** @var ClassLoader $loader */
7+
$loader = require __DIR__.'/../vendor/autoload.php';
8+
9+
AnnotationRegistry::registerLoader([$loader, 'loadClass']);
10+
11+
return $loader;

app/config/config.yml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
imports:
2+
- { resource: parameters.yml }
3+
- { resource: security.yml }
4+
- { resource: listeners.yml }
5+
- { resource: services.yml }
6+
7+
parameters:
8+
locale: en
9+
10+
framework:
11+
#esi: ~
12+
#translator: { fallbacks: ["%locale%"] }
13+
secret: "%secret%"
14+
router:
15+
resource: "%kernel.root_dir%/config/routing.yml"
16+
strict_requirements: ~
17+
form: ~
18+
csrf_protection: ~
19+
validation: { enable_annotations: true }
20+
serializer: { enable_annotations: true }
21+
templating:
22+
engines: ['twig']
23+
default_locale: "%locale%"
24+
trusted_hosts: ~
25+
trusted_proxies: ~
26+
session:
27+
handler_id: session.handler.native_file
28+
save_path: "%kernel.root_dir%/../var/sessions/%kernel.environment%"
29+
fragments: ~
30+
http_method_override: true
31+
assets: ~
32+
php_errors:
33+
log: true
34+
35+
twig:
36+
debug: "%kernel.debug%"
37+
strict_variables: "%kernel.debug%"
38+
39+
doctrine:
40+
dbal:
41+
driver: pdo_mysql
42+
host: "%database_host%"
43+
port: "%database_port%"
44+
dbname: "%database_name%"
45+
user: "%database_user%"
46+
password: "%database_password%"
47+
charset: UTF8
48+
49+
orm:
50+
auto_generate_proxy_classes: "%kernel.debug%"
51+
naming_strategy: doctrine.orm.naming_strategy.underscore
52+
auto_mapping: true
53+
mappings:
54+
gedmo_translatable:
55+
type: annotation
56+
prefix: Gedmo\Translatable\Entity
57+
dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/Entity"
58+
alias: GedmoTranslatable
59+
is_bundle: false
60+
gedmo_translator:
61+
type: annotation
62+
prefix: Gedmo\Translator\Entity
63+
dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Translator/Entity"
64+
alias: GedmoTranslator
65+
is_bundle: false
66+
gedmo_loggable:
67+
type: annotation
68+
prefix: Gedmo\Loggable\Entity
69+
dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Loggable/Entity"
70+
alias: GedmoLoggable
71+
is_bundle: false
72+
gedmo_tree:
73+
type: annotation
74+
prefix: Gedmo\Tree\Entity
75+
dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Entity"
76+
alias: GedmoTree
77+
is_bundle: false
78+
79+
stof_doctrine_extensions:
80+
default_locale: "%locale%"
81+
orm:
82+
default:
83+
timestampable: true
84+
85+
swiftmailer:
86+
transport: "%mailer_transport%"
87+
host: "%mailer_host%"
88+
username: "%mailer_user%"
89+
password: "%mailer_password%"
90+
spool: { type: memory }
91+
92+
nelmio_cors:
93+
defaults:
94+
allow_origin: ["%cors_allow_origin%"]
95+
allow_methods: ["POST", "PUT", "GET", "DELETE", "OPTIONS"]
96+
allow_headers: ["content-type", "authorization"]
97+
expose_headers: ["link"]
98+
max_age: 3600
99+
paths:
100+
'^/': ~
101+
102+
dunglas_action:
103+
directories:
104+
- ../src/*/Bundle/*Bundle/{Controller,Action,Command,EventSubscriber,Service}
105+
106+
api_platform:
107+
title: Topics
108+
description: The DigitalState Topics Api
109+
version: 0.1.0
110+
default_operation_path_resolver: api_platform.operation_path_resolver.dash
111+
eager_loading:
112+
force_eager: false

app/config/config_dev.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
imports:
2+
- { resource: config.yml }
3+
4+
framework:
5+
router:
6+
resource: "%kernel.root_dir%/config/routing_dev.yml"
7+
strict_requirements: true
8+
profiler: { only_exceptions: false }
9+
10+
web_profiler:
11+
toolbar: true
12+
intercept_redirects: false
13+
14+
monolog:
15+
handlers:
16+
main:
17+
type: stream
18+
path: "%kernel.logs_dir%/%kernel.environment%.log"
19+
level: debug
20+
channels: [!event]
21+
console:
22+
type: console
23+
channels: [!event, !doctrine]
24+
firephp:
25+
type: firephp
26+
level: info
27+
chromephp:
28+
type: chromephp
29+
level: info
30+
31+
#swiftmailer:
32+
# delivery_address: [email protected]

0 commit comments

Comments
 (0)