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.
return $bundles;
}
- public function getRootDir()
- {
- return __DIR__;
- }
-
public function getCacheDir()
{
return dirname(__DIR__) . '/var/cache/' . $this->getEnvironment();
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', [
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: ~
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: ~
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
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
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:
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
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
# 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
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
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"
$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 {
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"
$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',
]);
$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',
]);