]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Replace kernel.root_dir by kernel.project_dir 3382/head
authorNicolas Hart <contact@nclshart.net>
Fri, 13 Oct 2017 21:52:15 +0000 (23:52 +0200)
committerNicolas Hart <contact@nclshart.net>
Fri, 13 Oct 2017 22:32:56 +0000 (00:32 +0200)
kernel.root_dir and Kernel::getRootDir() are deprecated since Symfony 3.3.
See https://symfony.com/blog/new-in-symfony-3-3-a-simpler-way-to-get-the-project-root-directory and https://github.com/symfony/symfony/blob/3.3/UPGRADE-3.3.md#httpkernel for more information.

app/AppKernel.php
app/config/config.yml
app/config/config_dev.yml
app/config/config_prod.yml
app/config/parameters.yml.dist
app/config/parameters_test.yml
app/config/tests/parameters_test.sqlite.yml
app/config/wallabag.yml
src/Wallabag/CoreBundle/Command/ExportCommand.php
src/Wallabag/CoreBundle/Resources/config/services.yml
tests/Wallabag/ImportBundle/Command/ImportCommandTest.php

index f1140943dbc952c56635357e6175fb4ce97eb94a..d582c93e6ed4925d58db6577b71718470db6eca3 100644 (file)
@@ -57,11 +57,6 @@ class AppKernel extends Kernel
         return $bundles;
     }
 
-    public function getRootDir()
-    {
-        return __DIR__;
-    }
-
     public function getCacheDir()
     {
         return dirname(__DIR__) . '/var/cache/' . $this->getEnvironment();
@@ -74,7 +69,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')) {
                 $container->loadFromExtension('framework', [
index b76fb696636149b51fb68b61e61cda2f0d97cbae..08da4f8f8bb8e11948cff4355e8924e083734462 100644 (file)
@@ -16,7 +16,7 @@ framework:
         fallback: "%locale%"
     secret: "%secret%"
     router:
-        resource: "%kernel.root_dir%/config/routing.yml"
+        resource: "%kernel.project_dir%/app/config/routing.yml"
         strict_requirements: ~
     form: ~
     csrf_protection: ~
@@ -30,7 +30,7 @@ framework:
     session:
         # handler_id set to null will use default session handler from php.ini
         handler_id: session.handler.native_file
-        save_path: "%kernel.root_dir%/../var/sessions/%kernel.environment%"
+        save_path: "%kernel.project_dir%/var/sessions/%kernel.environment%"
     fragments: ~
     http_method_override: true
     assets: ~
@@ -72,7 +72,7 @@ stof_doctrine_extensions:
             sluggable: true
 
 doctrine_migrations:
-    dir_name: "%kernel.root_dir%/DoctrineMigrations"
+    dir_name: "%kernel.project_dir%/app/DoctrineMigrations"
     namespace: Application\Migrations
     table_name: migration_versions
     name: Application Migrations
index 3b67d8f6965b50a14b1460c9bea2a9416c25de8f..0c4905758e15b7f534614932b326c7120a3734c5 100644 (file)
@@ -3,7 +3,7 @@ imports:
 
 framework:
     router:
-        resource: "%kernel.root_dir%/config/routing_dev.yml"
+        resource: "%kernel.project_dir%/app/config/routing_dev.yml"
         strict_requirements: true
     profiler:
         only_exceptions: false
index 65b02d6602ba106e270678ef6da04c38a5f871b3..44e29aacf65a77333bc130aac7188eb505bc871a 100644 (file)
@@ -3,7 +3,7 @@ imports:
 
 framework:
     assets:
-        # json_manifest_path: '%kernel.root_dir%/../web/bundles/wallabagcore/manifest.json'
+        # json_manifest_path: '%kernel.project_dir%/web/bundles/wallabagcore/manifest.json'
 
 #doctrine:
 #    orm:
index b3fe11c87d5a89486e3e8eeeea5b7b07594f4297..b5b97950cac10d4198a4475bfa388888f8325828 100644 (file)
@@ -16,7 +16,7 @@ parameters:
     database_name: wallabag
     database_user: root
     database_password: ~
-    # For SQLite, database_path should be "%kernel.root_dir%/../data/db/wallabag.sqlite"
+    # For SQLite, database_path should be "%kernel.project_dir%/data/db/wallabag.sqlite"
     database_path: null
     database_table_prefix: wallabag_
     database_socket: null
index 010785e67c5de8e378ba978602eb96dc60864960..257d2acecbc4ba637b4f316628993647c01c3d1b 100644 (file)
@@ -6,5 +6,5 @@ parameters:
     test_database_user: null
     test_database_password: null
     test_database_path: "%env(TEST_DATABASE_PATH)%"
-    env(TEST_DATABASE_PATH): "%kernel.root_dir%/../data/db/wallabag_test.sqlite"
+    env(TEST_DATABASE_PATH): "%kernel.project_dir%/data/db/wallabag_test.sqlite"
     test_database_charset: utf8
index 5c731bf54f6bcc704e45b8910d68bb005876a05f..2b92d579f5d1db332c3aa68c523734c15e94043c 100644 (file)
@@ -8,5 +8,5 @@ parameters:
     # Using an environnement variable in order to avoid the error "attempt to write a readonly database"
     # when the schema is dropped then recreate
     test_database_path: "%env(TEST_DATABASE_PATH)%"
-    env(TEST_DATABASE_PATH): "%kernel.root_dir%/../data/db/wallabag_test.sqlite"
+    env(TEST_DATABASE_PATH): "%kernel.project_dir%/data/db/wallabag_test.sqlite"
     test_database_charset: utf8
index d70653ce6bf7725ccb01afefdc713577a87e99ba..6b4722fc2cb3fd1d1de6b2e5d86dc21444b2495c 100644 (file)
@@ -27,7 +27,7 @@ wallabag_core:
     fetching_error_message: |
         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>.
     api_limit_mass_actions: 10
-    encryption_key_path: "%kernel.root_dir%/../data/site-credentials-secret-key.txt"
+    encryption_key_path: "%kernel.project_dir%/data/site-credentials-secret-key.txt"
     default_internal_settings:
         -
             name: share_public
@@ -159,4 +159,4 @@ wallabag_user:
 
 wallabag_import:
     allow_mimetypes: ['application/octet-stream', 'application/json', 'text/plain', 'text/csv']
-    resource_dir: "%kernel.root_dir%/../web/uploads/import"
+    resource_dir: "%kernel.project_dir%/web/uploads/import"
index b07087c8a1219e847d79eefb9bb8a5cd7852e593..75e9ad91bc0c4d117810e96c113c7dcb11e8a7b6 100644 (file)
@@ -52,7 +52,7 @@ class ExportCommand extends ContainerAwareCommand
         $filePath = $input->getArgument('filepath');
 
         if (!$filePath) {
-            $filePath = $this->getContainer()->getParameter('kernel.root_dir') . '/../' . sprintf('%s-export.json', $user->getUsername());
+            $filePath = $this->getContainer()->getParameter('kernel.project_dir') . '/' . sprintf('%s-export.json', $user->getUsername());
         }
 
         try {
index caef2c8dfa0ce1d7c530e2be5f2a888d74ea06e0..31b16739f064a1412cc867c2d4bb83ac2c36ec5b 100644 (file)
@@ -205,7 +205,7 @@ services:
         class: Wallabag\CoreBundle\Helper\DownloadImages
         arguments:
             - "@wallabag_core.entry.download_images.client"
-            - "%kernel.root_dir%/../web/assets/images"
+            - "%kernel.project_dir%/web/assets/images"
             - '%domain_name%'
             - "@logger"
 
index 8bed180a6fd8855bc0bb4652da8092b120f42817..30aee4d8a7af2b3dc3a8d5d7ba0b4f3f1b14e451 100644 (file)
@@ -74,7 +74,7 @@ class ImportCommandTest extends WallabagCoreTestCase
         $tester->execute([
             'command' => $command->getName(),
             'username' => 'admin',
-            'filepath' => $application->getKernel()->getContainer()->getParameter('kernel.root_dir') . '/../tests/Wallabag/ImportBundle/fixtures/wallabag-v2-read.json',
+            'filepath' => $application->getKernel()->getContainer()->getParameter('kernel.project_dir') . '/tests/Wallabag/ImportBundle/fixtures/wallabag-v2-read.json',
             '--importer' => 'v2',
         ]);
 
@@ -93,7 +93,7 @@ class ImportCommandTest extends WallabagCoreTestCase
         $tester->execute([
             'command' => $command->getName(),
             'username' => 1,
-            'filepath' => $application->getKernel()->getContainer()->getParameter('kernel.root_dir') . '/../tests/Wallabag/ImportBundle/fixtures/wallabag-v2-read.json',
+            'filepath' => $application->getKernel()->getContainer()->getParameter('kernel.project_dir') . '/tests/Wallabag/ImportBundle/fixtures/wallabag-v2-read.json',
             '--useUserId' => true,
             '--importer' => 'v2',
         ]);