Skip to content

Commit

Permalink
Fix webserver & images
Browse files Browse the repository at this point in the history
  • Loading branch information
pamil committed Aug 15, 2018
1 parent 4948f4e commit 09d0af7
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 21 deletions.
3 changes: 3 additions & 0 deletions config/packages/_sylius.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ imports:

- { resource: "@SyliusShopBundle/Resources/config/app/config.yml" }

parameters:
sylius_core.public_dir: '%kernel.project_dir%/public'

sylius_shop:
product_grid:
include_all_descendants: true
6 changes: 0 additions & 6 deletions config/packages/knp_gaufrette.yaml

This file was deleted.

10 changes: 0 additions & 10 deletions config/packages/liip_imagine.yaml

This file was deleted.

6 changes: 3 additions & 3 deletions public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
require __DIR__.'/../vendor/autoload.php';

// The check is to ensure we don't use .env in production
if (!isset($_SERVER['APP_ENV'])) {
if (!isset($_SERVER['APP_ENV']) && !isset($_ENV['APP_ENV'])) {
if (!class_exists(Dotenv::class)) {
throw new \RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add "symfony/dotenv" as a Composer dependency to load variables from a .env file.');
}
(new Dotenv())->load(__DIR__.'/../.env');
}

$env = $_SERVER['APP_ENV'] ?? 'dev';
$debug = (bool) ($_SERVER['APP_DEBUG'] ?? ('prod' !== $env));
$env = $_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? 'dev';
$debug = (bool) ($_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? ('prod' !== $env));

if ($debug) {
umask(0000);
Expand Down
12 changes: 10 additions & 2 deletions src/Sylius/Bundle/CoreBundle/Resources/config/app/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ imports:
- { resource: "@SyliusCoreBundle/Resources/config/app/state_machine.yml" }
- { resource: "@SyliusCoreBundle/Resources/config/app/fixtures.yml" }

parameters:
sylius_core.public_dir: "%kernel.project_dir%/web"

doctrine:
orm:
auto_generate_proxy_classes: "%kernel.debug%"
Expand All @@ -38,7 +41,7 @@ knp_gaufrette:
adapters:
sylius_image:
local:
directory: "%kernel.project_dir%/web/media/image"
directory: "%sylius_core.public_dir%/media/image"
create: true
filesystems:
sylius_image:
Expand All @@ -48,7 +51,12 @@ liip_imagine:
loaders:
default:
filesystem:
data_root: "%kernel.project_dir%/web/media/image"
data_root: "%sylius_core.public_dir%/media/image"
resolvers:
default:
web_path:
web_root: "%sylius_core.public_dir%"
cache_prefix: "media/cache"
filter_sets:
sylius_small:
filters:
Expand Down

0 comments on commit 09d0af7

Please sign in to comment.