-
-
Notifications
You must be signed in to change notification settings - Fork 756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flex structure #7115
base: master
Are you sure you want to change the base?
Flex structure #7115
Changes from all commits
2a118a4
b95882c
d67f965
3a54681
2c59a78
72a5941
937ae28
1cc5a09
272a069
122e293
08a813e
101b356
ef52786
ecf08d8
4f772fd
12d37f7
158ee58
463c4a8
2c608c5
ad4eef9
49aa373
fe4bdd7
bb11829
ba6ac85
6dc8eb3
6334e6d
ff9e3dc
5e2740f
3cbf37e
5941643
ddf9a06
79e0897
fbe23c1
39c8175
b7286cc
6f29eae
e48adda
329650b
c65d410
6f416d5
7b22b65
c2f2824
33187d0
768706c
6a261ca
afd78c8
a132031
8090c3a
d3d8e45
c7a212a
9727a2c
561d83c
e86a5b9
1f93d4d
de9607a
531896c
2846cbd
a217d47
0516045
fe8d57f
231e59b
388f264
313fabc
8f571e3
63b1e82
ed21eb9
c574ce0
082dac5
653c17b
7ac3dc1
23ea7b3
cdc1564
2af7a29
4ea21f5
24cfea0
0c0d6bd
2a72622
3beeb28
7339837
205d1d5
70c02e8
51790d9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,6 @@ indent_style = tab | |
|
||
[.github/**.yml] | ||
indent_size = 2 | ||
|
||
[phpstan-baseline.neon] | ||
indent_style = tab |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
###> symfony/framework-bundle ### | ||
APP_ENV=dev | ||
APP_SECRET=CHANGE_ME_TO_SOMETHING_SECRET_AND_RANDOM | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. being here it means dev setup will use the env var, so this needs to be updated. |
||
###< symfony/framework-bundle ### |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# define your env variables for the test env here | ||
KERNEL_CLASS='Wallabag\Kernel' | ||
APP_SECRET='$ecretf0rt3st' | ||
SYMFONY_DEPRECATIONS_HELPER=weak | ||
PANTHER_APP_ENV=panther | ||
PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?php | ||
|
||
use Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache; | ||
use Wallabag\CacheKernel; | ||
|
||
class AppCache extends HttpCache | ||
class AppCache extends CacheKernel | ||
{ | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,133 +1,7 @@ | ||
<?php | ||
|
||
use Symfony\Component\Config\Loader\LoaderInterface; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\HttpKernel\Kernel; | ||
use Wallabag\Kernel; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. decided to use Wallabag as root namespace instead of the default App one. |
||
|
||
class AppKernel extends Kernel | ||
{ | ||
public function registerBundles() | ||
{ | ||
$bundles = [ | ||
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), | ||
new Symfony\Bundle\SecurityBundle\SecurityBundle(), | ||
new Symfony\Bundle\TwigBundle\TwigBundle(), | ||
new Symfony\Bundle\MonologBundle\MonologBundle(), | ||
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), | ||
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), | ||
new FOS\RestBundle\FOSRestBundle(), | ||
new FOS\UserBundle\FOSUserBundle(), | ||
new JMS\SerializerBundle\JMSSerializerBundle(), | ||
new Nelmio\ApiDocBundle\NelmioApiDocBundle(), | ||
new Nelmio\CorsBundle\NelmioCorsBundle(), | ||
new Bazinga\Bundle\HateoasBundle\BazingaHateoasBundle(), | ||
new Lexik\Bundle\FormFilterBundle\LexikFormFilterBundle(), | ||
new FOS\OAuthServerBundle\FOSOAuthServerBundle(), | ||
new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(), | ||
new Scheb\TwoFactorBundle\SchebTwoFactorBundle(), | ||
new KPhoen\RulerZBundle\KPhoenRulerZBundle(), | ||
new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(), | ||
new Craue\ConfigBundle\CraueConfigBundle(), | ||
new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(), | ||
new FOS\JsRoutingBundle\FOSJsRoutingBundle(), | ||
new BD\GuzzleSiteAuthenticatorBundle\BDGuzzleSiteAuthenticatorBundle(), | ||
new OldSound\RabbitMqBundle\OldSoundRabbitMqBundle(), | ||
new Http\HttplugBundle\HttplugBundle(), | ||
new Sentry\SentryBundle\SentryBundle(), | ||
new Twig\Extra\TwigExtraBundle\TwigExtraBundle(), | ||
|
||
// wallabag bundles | ||
new Wallabag\CoreBundle\WallabagCoreBundle(), | ||
new Wallabag\ApiBundle\WallabagApiBundle(), | ||
new Wallabag\UserBundle\WallabagUserBundle(), | ||
new Wallabag\ImportBundle\WallabagImportBundle(), | ||
new Wallabag\AnnotationBundle\WallabagAnnotationBundle(), | ||
]; | ||
|
||
if (in_array($this->getEnvironment(), ['dev', 'test'], true)) { | ||
$bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle(); | ||
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); | ||
$bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(); | ||
|
||
if ('test' === $this->getEnvironment()) { | ||
$bundles[] = new DAMA\DoctrineTestBundle\DAMADoctrineTestBundle(); | ||
} | ||
|
||
if ('dev' === $this->getEnvironment()) { | ||
$bundles[] = new Symfony\Bundle\MakerBundle\MakerBundle(); | ||
$bundles[] = new Symfony\Bundle\WebServerBundle\WebServerBundle(); | ||
} | ||
} | ||
|
||
return $bundles; | ||
} | ||
|
||
public function getCacheDir() | ||
{ | ||
return dirname(__DIR__) . '/var/cache/' . $this->getEnvironment(); | ||
} | ||
|
||
public function getLogDir() | ||
{ | ||
return dirname(__DIR__) . '/var/logs'; | ||
} | ||
|
||
public function registerContainerConfiguration(LoaderInterface $loader) | ||
{ | ||
$loader->load($this->getProjectDir() . '/app/config/config_' . $this->getEnvironment() . '.yml'); | ||
|
||
$loader->load(function ($container) { | ||
if ($container->getParameter('use_webpack_dev_server')) { | ||
$container->loadFromExtension('framework', [ | ||
'assets' => [ | ||
'base_url' => 'http://localhost:8080/', | ||
], | ||
]); | ||
} else { | ||
$container->loadFromExtension('framework', [ | ||
'assets' => [ | ||
'base_url' => $container->getParameter('domain_name'), | ||
], | ||
]); | ||
} | ||
}); | ||
|
||
$loader->load(function (ContainerBuilder $container) { | ||
// $container->setParameter('container.autowiring.strict_mode', true); | ||
// $container->setParameter('container.dumper.inline_class_loader', true); | ||
$container->addObjectResource($this); | ||
}); | ||
|
||
$loader->load(function (ContainerBuilder $container) { | ||
$this->processDatabaseParameters($container); | ||
}); | ||
} | ||
|
||
private function processDatabaseParameters(ContainerBuilder $container) | ||
{ | ||
switch ($container->getParameter('database_driver')) { | ||
case 'pdo_mysql': | ||
$scheme = 'mysql'; | ||
break; | ||
case 'pdo_pgsql': | ||
$scheme = 'pgsql'; | ||
break; | ||
case 'pdo_sqlite': | ||
$scheme = 'sqlite'; | ||
break; | ||
default: | ||
throw new \RuntimeException('Unsupported database driver: ' . $container->getParameter('database_driver')); | ||
} | ||
|
||
$container->setParameter('database_scheme', $scheme); | ||
|
||
if ('sqlite' === $scheme) { | ||
$container->setParameter('database_name', $container->getParameter('database_path')); | ||
} | ||
|
||
$container->setParameter('database_user', (string) $container->getParameter('database_user')); | ||
$container->setParameter('database_password', (string) $container->getParameter('database_password')); | ||
$container->setParameter('database_port', (string) $container->getParameter('database_port')); | ||
$container->setParameter('database_socket', (string) $container->getParameter('database_socket')); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
even not installed with Flex, used this syntax so Flex is ready to identify those places when we will install it and update recipes