diff --git a/app/AppKernel.php b/app/AppKernel.php index 812f778fa..61b734e06 100644 --- a/app/AppKernel.php +++ b/app/AppKernel.php @@ -62,11 +62,6 @@ class AppKernel extends Kernel return $bundles; } - public function getRootDir() - { - return __DIR__; - } - public function getCacheDir() { return dirname(__DIR__) . '/var/cache/' . $this->getEnvironment(); @@ -79,7 +74,7 @@ class AppKernel extends Kernel public function registerContainerConfiguration(LoaderInterface $loader) { - $loader->load($this->getRootDir() . '/config/config_' . $this->getEnvironment() . '.yml'); + $loader->load($this->getProjectDir() . '/app/config/config_' . $this->getEnvironment() . '.yml'); $loader->load(function ($container) { if ($container->getParameter('use_webpack_dev_server')) { diff --git a/app/config/services.yml b/app/config/services.yml index 28eaed1e2..605e6383f 100644 --- a/app/config/services.yml +++ b/app/config/services.yml @@ -12,7 +12,7 @@ services: autoconfigure: true public: true bind: - $rootDir: '%kernel.root_dir%' + $projectDir: '%kernel.project_dir%' $debug: '%kernel.debug%' $defaultLocale: '%kernel.default_locale%' $wallabagUrl: '%domain_name%' diff --git a/app/config/webpack/common.js b/app/config/webpack/common.js index cc16bafc3..4eca0e39d 100644 --- a/app/config/webpack/common.js +++ b/app/config/webpack/common.js @@ -2,16 +2,16 @@ const path = require('path'); const webpack = require('webpack'); const StyleLintPlugin = require('stylelint-webpack-plugin'); -const rootDir = path.resolve(__dirname, '../../../'); +const projectDir = path.resolve(__dirname, '../../../'); module.exports = { entry: { - material: path.join(rootDir, './app/Resources/static/themes/material/index.js'), - public: path.join(rootDir, './app/Resources/static/themes/_global/share.js'), + material: path.join(projectDir, './app/Resources/static/themes/material/index.js'), + public: path.join(projectDir, './app/Resources/static/themes/_global/share.js'), }, output: { filename: '[name].js', - path: path.resolve(rootDir, 'web/wallassets'), + path: path.resolve(projectDir, 'web/wallassets'), publicPath: '', }, plugins: [ @@ -31,7 +31,7 @@ module.exports = { ], resolve: { alias: { - jquery: path.join(rootDir, 'node_modules/jquery/dist/jquery.js'), + jquery: path.join(projectDir, 'node_modules/jquery/dist/jquery.js'), }, }, }; diff --git a/docker/php/config/parameters.yml b/docker/php/config/parameters.yml index 3bf5a6295..198b757d6 100644 --- a/docker/php/config/parameters.yml +++ b/docker/php/config/parameters.yml @@ -6,7 +6,7 @@ parameters: database_name: ${DATABASE_NAME:-symfony} database_user: ${DATABASE_USER:-root} database_password: ${DATABASE_PASSWORD:-~} - database_path: '${DATABASE_PATH:-"%kernel.root_dir%/data/db/wallabag.sqlite"}' + database_path: '${DATABASE_PATH:-"%kernel.project_dir%/data/db/wallabag.sqlite"}' database_table_prefix: ${DATABASE_TABLE_PREFIX:-wallabag_} database_socket: null database_charset: ${DATABASE_CHARSET:-utf8} diff --git a/src/Wallabag/CoreBundle/Twig/WallabagExtension.php b/src/Wallabag/CoreBundle/Twig/WallabagExtension.php index 3fad85d61..e94bf3603 100644 --- a/src/Wallabag/CoreBundle/Twig/WallabagExtension.php +++ b/src/Wallabag/CoreBundle/Twig/WallabagExtension.php @@ -19,16 +19,16 @@ class WallabagExtension extends AbstractExtension implements GlobalsInterface private $tagRepository; private $lifeTime; private $translator; - private $rootDir; + private $projectDir; - public function __construct(EntryRepository $entryRepository, TagRepository $tagRepository, TokenStorageInterface $tokenStorage, $lifeTime, TranslatorInterface $translator, string $rootDir) + public function __construct(EntryRepository $entryRepository, TagRepository $tagRepository, TokenStorageInterface $tokenStorage, $lifeTime, TranslatorInterface $translator, string $projectDir) { $this->entryRepository = $entryRepository; $this->tagRepository = $tagRepository; $this->tokenStorage = $tokenStorage; $this->lifeTime = $lifeTime; $this->translator = $translator; - $this->rootDir = $rootDir; + $this->projectDir = $projectDir; } public function getGlobals(): array @@ -174,7 +174,7 @@ class WallabagExtension extends AbstractExtension implements GlobalsInterface public function assetFileExists($name) { - return file_exists(realpath($this->rootDir . '/../web/' . $name)); + return file_exists(realpath($this->projectDir . '/web/' . $name)); } public function themeClass()