mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 17:10:53 +00:00
Fix webserver & images
This commit is contained in:
parent
4948f4e26e
commit
09d0af7882
5 changed files with 16 additions and 21 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
knp_gaufrette:
|
||||
adapters:
|
||||
sylius_image:
|
||||
local:
|
||||
directory: "%kernel.project_dir%/public/media/image"
|
||||
create: true
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
liip_imagine:
|
||||
resolvers:
|
||||
default:
|
||||
web_path:
|
||||
web_root: "%kernel.project_dir%/public"
|
||||
cache_prefix: "media/cache"
|
||||
loaders:
|
||||
default:
|
||||
filesystem:
|
||||
data_root: "%kernel.project_dir%/public/media/image"
|
||||
|
|
@ -7,15 +7,15 @@ use Symfony\Component\HttpFoundation\Request;
|
|||
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);
|
||||
|
|
|
|||
|
|
@ -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%"
|
||||
|
|
@ -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:
|
||||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue