aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJérémy Benoist <j0k3r@users.noreply.github.com>2017-10-15 09:24:32 +0200
committerGitHub <noreply@github.com>2017-10-15 09:24:32 +0200
commit393020100350140e421d991a3fc7d12eaf69a8b7 (patch)
tree39c058cfca7543ac4a3e60e8a5ffc97db7629474
parent64f4112caea165d79d10c624bcc69e6a3597714f (diff)
parent9ca069a6fea67ddf2ef44601901ea3c02e3cffbe (diff)
downloadwallabag-393020100350140e421d991a3fc7d12eaf69a8b7.tar.gz
wallabag-393020100350140e421d991a3fc7d12eaf69a8b7.tar.zst
wallabag-393020100350140e421d991a3fc7d12eaf69a8b7.zip
Merge pull request #3382 from nclsHart/replace-kernel-rootdir
Replace kernel.root_dir by kernel.project_dir
-rw-r--r--app/AppKernel.php7
-rw-r--r--app/config/config.yml6
-rw-r--r--app/config/config_dev.yml2
-rw-r--r--app/config/config_prod.yml2
-rw-r--r--app/config/parameters.yml.dist2
-rw-r--r--app/config/parameters_test.yml2
-rw-r--r--app/config/tests/parameters_test.sqlite.yml2
-rw-r--r--app/config/wallabag.yml4
-rw-r--r--src/Wallabag/CoreBundle/Command/ExportCommand.php2
-rw-r--r--src/Wallabag/CoreBundle/Resources/config/services.yml2
-rw-r--r--tests/Wallabag/ImportBundle/Command/ImportCommandTest.php4
11 files changed, 15 insertions, 20 deletions
diff --git a/app/AppKernel.php b/app/AppKernel.php
index 45f6b795..90e9f1d8 100644
--- a/app/AppKernel.php
+++ b/app/AppKernel.php
@@ -58,11 +58,6 @@ class AppKernel extends Kernel
58 return $bundles; 58 return $bundles;
59 } 59 }
60 60
61 public function getRootDir()
62 {
63 return __DIR__;
64 }
65
66 public function getCacheDir() 61 public function getCacheDir()
67 { 62 {
68 return dirname(__DIR__) . '/var/cache/' . $this->getEnvironment(); 63 return dirname(__DIR__) . '/var/cache/' . $this->getEnvironment();
@@ -75,7 +70,7 @@ class AppKernel extends Kernel
75 70
76 public function registerContainerConfiguration(LoaderInterface $loader) 71 public function registerContainerConfiguration(LoaderInterface $loader)
77 { 72 {
78 $loader->load($this->getRootDir() . '/config/config_' . $this->getEnvironment() . '.yml'); 73 $loader->load($this->getProjectDir() . '/app/config/config_' . $this->getEnvironment() . '.yml');
79 $loader->load(function ($container) { 74 $loader->load(function ($container) {
80 if ($container->getParameter('use_webpack_dev_server')) { 75 if ($container->getParameter('use_webpack_dev_server')) {
81 $container->loadFromExtension('framework', [ 76 $container->loadFromExtension('framework', [
diff --git a/app/config/config.yml b/app/config/config.yml
index b76fb696..08da4f8f 100644
--- a/app/config/config.yml
+++ b/app/config/config.yml
@@ -16,7 +16,7 @@ framework:
16 fallback: "%locale%" 16 fallback: "%locale%"
17 secret: "%secret%" 17 secret: "%secret%"
18 router: 18 router:
19 resource: "%kernel.root_dir%/config/routing.yml" 19 resource: "%kernel.project_dir%/app/config/routing.yml"
20 strict_requirements: ~ 20 strict_requirements: ~
21 form: ~ 21 form: ~
22 csrf_protection: ~ 22 csrf_protection: ~
@@ -30,7 +30,7 @@ framework:
30 session: 30 session:
31 # handler_id set to null will use default session handler from php.ini 31 # handler_id set to null will use default session handler from php.ini
32 handler_id: session.handler.native_file 32 handler_id: session.handler.native_file
33 save_path: "%kernel.root_dir%/../var/sessions/%kernel.environment%" 33 save_path: "%kernel.project_dir%/var/sessions/%kernel.environment%"
34 fragments: ~ 34 fragments: ~
35 http_method_override: true 35 http_method_override: true
36 assets: ~ 36 assets: ~
@@ -72,7 +72,7 @@ stof_doctrine_extensions:
72 sluggable: true 72 sluggable: true
73 73
74doctrine_migrations: 74doctrine_migrations:
75 dir_name: "%kernel.root_dir%/DoctrineMigrations" 75 dir_name: "%kernel.project_dir%/app/DoctrineMigrations"
76 namespace: Application\Migrations 76 namespace: Application\Migrations
77 table_name: migration_versions 77 table_name: migration_versions
78 name: Application Migrations 78 name: Application Migrations
diff --git a/app/config/config_dev.yml b/app/config/config_dev.yml
index 3b67d8f6..0c490575 100644
--- a/app/config/config_dev.yml
+++ b/app/config/config_dev.yml
@@ -3,7 +3,7 @@ imports:
3 3
4framework: 4framework:
5 router: 5 router:
6 resource: "%kernel.root_dir%/config/routing_dev.yml" 6 resource: "%kernel.project_dir%/app/config/routing_dev.yml"
7 strict_requirements: true 7 strict_requirements: true
8 profiler: 8 profiler:
9 only_exceptions: false 9 only_exceptions: false
diff --git a/app/config/config_prod.yml b/app/config/config_prod.yml
index 65b02d66..44e29aac 100644
--- a/app/config/config_prod.yml
+++ b/app/config/config_prod.yml
@@ -3,7 +3,7 @@ imports:
3 3
4framework: 4framework:
5 assets: 5 assets:
6 # json_manifest_path: '%kernel.root_dir%/../web/bundles/wallabagcore/manifest.json' 6 # json_manifest_path: '%kernel.project_dir%/web/bundles/wallabagcore/manifest.json'
7 7
8#doctrine: 8#doctrine:
9# orm: 9# orm:
diff --git a/app/config/parameters.yml.dist b/app/config/parameters.yml.dist
index b3fe11c8..b5b97950 100644
--- a/app/config/parameters.yml.dist
+++ b/app/config/parameters.yml.dist
@@ -16,7 +16,7 @@ parameters:
16 database_name: wallabag 16 database_name: wallabag
17 database_user: root 17 database_user: root
18 database_password: ~ 18 database_password: ~
19 # For SQLite, database_path should be "%kernel.root_dir%/../data/db/wallabag.sqlite" 19 # For SQLite, database_path should be "%kernel.project_dir%/data/db/wallabag.sqlite"
20 database_path: null 20 database_path: null
21 database_table_prefix: wallabag_ 21 database_table_prefix: wallabag_
22 database_socket: null 22 database_socket: null
diff --git a/app/config/parameters_test.yml b/app/config/parameters_test.yml
index 010785e6..257d2ace 100644
--- a/app/config/parameters_test.yml
+++ b/app/config/parameters_test.yml
@@ -6,5 +6,5 @@ parameters:
6 test_database_user: null 6 test_database_user: null
7 test_database_password: null 7 test_database_password: null
8 test_database_path: "%env(TEST_DATABASE_PATH)%" 8 test_database_path: "%env(TEST_DATABASE_PATH)%"
9 env(TEST_DATABASE_PATH): "%kernel.root_dir%/../data/db/wallabag_test.sqlite" 9 env(TEST_DATABASE_PATH): "%kernel.project_dir%/data/db/wallabag_test.sqlite"
10 test_database_charset: utf8 10 test_database_charset: utf8
diff --git a/app/config/tests/parameters_test.sqlite.yml b/app/config/tests/parameters_test.sqlite.yml
index 5c731bf5..2b92d579 100644
--- a/app/config/tests/parameters_test.sqlite.yml
+++ b/app/config/tests/parameters_test.sqlite.yml
@@ -8,5 +8,5 @@ parameters:
8 # Using an environnement variable in order to avoid the error "attempt to write a readonly database" 8 # Using an environnement variable in order to avoid the error "attempt to write a readonly database"
9 # when the schema is dropped then recreate 9 # when the schema is dropped then recreate
10 test_database_path: "%env(TEST_DATABASE_PATH)%" 10 test_database_path: "%env(TEST_DATABASE_PATH)%"
11 env(TEST_DATABASE_PATH): "%kernel.root_dir%/../data/db/wallabag_test.sqlite" 11 env(TEST_DATABASE_PATH): "%kernel.project_dir%/data/db/wallabag_test.sqlite"
12 test_database_charset: utf8 12 test_database_charset: utf8
diff --git a/app/config/wallabag.yml b/app/config/wallabag.yml
index d70653ce..6b4722fc 100644
--- a/app/config/wallabag.yml
+++ b/app/config/wallabag.yml
@@ -27,7 +27,7 @@ wallabag_core:
27 fetching_error_message: | 27 fetching_error_message: |
28 wallabag can't retrieve contents for this article. Please <a href="http://doc.wallabag.org/en/user/errors_during_fetching.html#how-can-i-help-to-fix-that">troubleshoot this issue</a>. 28 wallabag can't retrieve contents for this article. Please <a href="http://doc.wallabag.org/en/user/errors_during_fetching.html#how-can-i-help-to-fix-that">troubleshoot this issue</a>.
29 api_limit_mass_actions: 10 29 api_limit_mass_actions: 10
30 encryption_key_path: "%kernel.root_dir%/../data/site-credentials-secret-key.txt" 30 encryption_key_path: "%kernel.project_dir%/data/site-credentials-secret-key.txt"
31 default_internal_settings: 31 default_internal_settings:
32 - 32 -
33 name: share_public 33 name: share_public
@@ -159,4 +159,4 @@ wallabag_user:
159 159
160wallabag_import: 160wallabag_import:
161 allow_mimetypes: ['application/octet-stream', 'application/json', 'text/plain', 'text/csv'] 161 allow_mimetypes: ['application/octet-stream', 'application/json', 'text/plain', 'text/csv']
162 resource_dir: "%kernel.root_dir%/../web/uploads/import" 162 resource_dir: "%kernel.project_dir%/web/uploads/import"
diff --git a/src/Wallabag/CoreBundle/Command/ExportCommand.php b/src/Wallabag/CoreBundle/Command/ExportCommand.php
index b07087c8..75e9ad91 100644
--- a/src/Wallabag/CoreBundle/Command/ExportCommand.php
+++ b/src/Wallabag/CoreBundle/Command/ExportCommand.php
@@ -52,7 +52,7 @@ class ExportCommand extends ContainerAwareCommand
52 $filePath = $input->getArgument('filepath'); 52 $filePath = $input->getArgument('filepath');
53 53
54 if (!$filePath) { 54 if (!$filePath) {
55 $filePath = $this->getContainer()->getParameter('kernel.root_dir') . '/../' . sprintf('%s-export.json', $user->getUsername()); 55 $filePath = $this->getContainer()->getParameter('kernel.project_dir') . '/' . sprintf('%s-export.json', $user->getUsername());
56 } 56 }
57 57
58 try { 58 try {
diff --git a/src/Wallabag/CoreBundle/Resources/config/services.yml b/src/Wallabag/CoreBundle/Resources/config/services.yml
index caef2c8d..31b16739 100644
--- a/src/Wallabag/CoreBundle/Resources/config/services.yml
+++ b/src/Wallabag/CoreBundle/Resources/config/services.yml
@@ -205,7 +205,7 @@ services:
205 class: Wallabag\CoreBundle\Helper\DownloadImages 205 class: Wallabag\CoreBundle\Helper\DownloadImages
206 arguments: 206 arguments:
207 - "@wallabag_core.entry.download_images.client" 207 - "@wallabag_core.entry.download_images.client"
208 - "%kernel.root_dir%/../web/assets/images" 208 - "%kernel.project_dir%/web/assets/images"
209 - '%domain_name%' 209 - '%domain_name%'
210 - "@logger" 210 - "@logger"
211 211
diff --git a/tests/Wallabag/ImportBundle/Command/ImportCommandTest.php b/tests/Wallabag/ImportBundle/Command/ImportCommandTest.php
index 8bed180a..30aee4d8 100644
--- a/tests/Wallabag/ImportBundle/Command/ImportCommandTest.php
+++ b/tests/Wallabag/ImportBundle/Command/ImportCommandTest.php
@@ -74,7 +74,7 @@ class ImportCommandTest extends WallabagCoreTestCase
74 $tester->execute([ 74 $tester->execute([
75 'command' => $command->getName(), 75 'command' => $command->getName(),
76 'username' => 'admin', 76 'username' => 'admin',
77 'filepath' => $application->getKernel()->getContainer()->getParameter('kernel.root_dir') . '/../tests/Wallabag/ImportBundle/fixtures/wallabag-v2-read.json', 77 'filepath' => $application->getKernel()->getContainer()->getParameter('kernel.project_dir') . '/tests/Wallabag/ImportBundle/fixtures/wallabag-v2-read.json',
78 '--importer' => 'v2', 78 '--importer' => 'v2',
79 ]); 79 ]);
80 80
@@ -93,7 +93,7 @@ class ImportCommandTest extends WallabagCoreTestCase
93 $tester->execute([ 93 $tester->execute([
94 'command' => $command->getName(), 94 'command' => $command->getName(),
95 'username' => 1, 95 'username' => 1,
96 'filepath' => $application->getKernel()->getContainer()->getParameter('kernel.root_dir') . '/../tests/Wallabag/ImportBundle/fixtures/wallabag-v2-read.json', 96 'filepath' => $application->getKernel()->getContainer()->getParameter('kernel.project_dir') . '/tests/Wallabag/ImportBundle/fixtures/wallabag-v2-read.json',
97 '--useUserId' => true, 97 '--useUserId' => true,
98 '--importer' => 'v2', 98 '--importer' => 'v2',
99 ]); 99 ]);