Stimulus
... use the Internet.
But even though Stimulus is a JavaScript library... Symfony has a bundle to help
us load it, get it set up, and use it. So, find your terminal and run:
composer ...
Upgrading to Symfony 5.4
...
But a few of these, like symfony/maker-bundle, follow their own versioning
scheme. What a diva! We're not going to worry about upgrading those right now, but
we will make sure that, by the end, we've upgraded everything ...
Upgrading to Symfony 4.4
... there are a bunch here:
Including symfony/debug-bundle, which has a funny-looking version because
I unpacked it from a debug-pack in one of our courses. And both MakerBundle and
MonologBundle are not in the main ...
... /doctrine-fixtures-bundle ^3.1 -> satisfiable by doctrine/doctrine-fixtures-bundle[3.1.0].
- Conclusion: don't install symfony/framework-bundle v4.2.3
- Conclusion: don't install symfony/framework-bundle v4.2.2 ...
Starting in Symfony2 Course 2 2.4
Over the next hour, we're going to take you through some of the most difficult areas of Symfony learning all about security, forms, and parts of Doctrine. We'll also see testing and learn more about how Symfony's ...
|
// ... lines 1 - 5
|
|
class AppKernel extends Kernel |
|
{ |
|
public function registerBundles() |
|
{ |
|
$bundles = array( |
|
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), |
|
new Symfony\Bundle\SecurityBundle\SecurityBundle(), |
|
new Symfony\Bundle\TwigBundle\TwigBundle(), |
|
new Symfony\Bundle\MonologBundle\MonologBundle(), |
|
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(), |
|
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), |
|
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), |
|
// ... lines 18 - 20
|
|
new AppBundle\AppBundle(), |
|
); |
|
|
|
if (in_array($this->getEnvironment(), array('dev', 'test'), true)) { |
|
$bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle(); |
|
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); |
|
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle(); |
|
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle(); |
|
} |
|
|
|
return $bundles; |
|
} |
|
// ... lines 33 - 52
|
|
} |
See Code Block in Script
Symfony2 Security Firewalls and Dinosaurs
Symfony2 Security, Firewalls and Dinosaurs¶
From Gerard Araujo:
What is a typical/ideal bundle and firewall structure for symfony 2 for a
project with the following basic requirements:
frontend [ public ]
frontend ...
|
{ |
|
// ... lines 2 - 3
|
|
"require": { |
|
// ... lines 5 - 20
|
|
"symfony/asset": "^4.0", |
|
"symfony/console": "^4.0", |
|
"symfony/flex": "^1.0", |
|
"symfony/form": "^4.0", |
|
"symfony/framework-bundle": "^4.0", |
|
"symfony/mailer": "4.3.*", |
|
"symfony/messenger": "4.3.*", |
|
"symfony/orm-pack": "^1.0", |
|
"symfony/security-bundle": "^4.0", |
|
"symfony/sendgrid-mailer": "4.3.*", |
|
"symfony/serializer-pack": "^1.0", |
|
"symfony/twig-bundle": "^4.0", |
|
"symfony/twig-pack": "^1.0", |
|
"symfony/validator": "^4.0", |
|
"symfony/web-server-bundle": "^4.0", |
|
"symfony/webpack-encore-bundle": "^1.4", |
|
"symfony/yaml": "^4.0", |
|
// ... lines 38 - 40
|
|
}, |
|
"require-dev": { |
|
// ... lines 43 - 45
|
|
"symfony/browser-kit": "4.3.*", |
|
"symfony/debug-bundle": "^3.3|^4.0", |
|
"symfony/dotenv": "^4.0", |
|
"symfony/maker-bundle": "^1.0", |
|
"symfony/monolog-bundle": "^3.0", |
|
"symfony/phpunit-bridge": "^3.3|^4.0", |
|
"symfony/profiler-pack": "^1.0", |
|
"symfony/var-dumper": "^3.3|^4.0" |
|
}, |
|
// ... lines 55 - 102
|
|
} |
See Code Block in Script
Disable HTML5 Validation
Leave everything blank and hit save.
Oh, it doesn't submit. Instead we get this validation error. So where's that coming
from?
Hint: it's not Symfony!. It's our friend HTML5. When Symfony renders the field, it's
adding ...
... If you can't install `symfony/stimulus-bundle` because of unresolved dependencies use this composer.json instead:
```
{
"type": "project",
"license": "proprietary",
"minimum-stability": "dev ...
Upgrading the FrameworkBundle Recipe Part 1
Run:
composer recipes
Our goal is to update all of the recipes starting with symfony/. The hardest
ones are at the beginning: symfony/console and symfony/framework-bundle. But ...
Sluggable Doctrine Extensions
... we're going to install another bundle. Google for
StofDoctrineExtensionsBundle and find its GitHub page. And then click
over to its documentation, which lives on Symfony.com. This bundle gives you a
bunch of superpowers ...
Thumbnailing with LiipImagineBundle
... see the tiny thumbnail.
Google for LiipImagineBundle and find its GitHub page. They have a bunch of docs
right here... but most of the information actually lives over on Symfony.com.
Click "Download the Bundle" to get ...
|
// ... lines 1 - 2
|
|
return [ |
|
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true], |
|
Symfony\Bundle\WebServerBundle\WebServerBundle::class => ['dev' => true], |
|
Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true], |
|
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], |
|
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true], |
|
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true], |
|
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true], |
|
Knp\Bundle\MarkdownBundle\KnpMarkdownBundle::class => ['all' => true], |
|
]; |
See Code Block in Script
Assets and Cache Busting
... /event/css directory. And since the web/
directory is the document root, we don’t include that part.
Making Bundle Assets Public¶
The only thing Symfony is doing is helping move these files from their original
location ...
Configuring the Cache Service
... FrameworkBundle - the core Symfony bundle:
Every other bundle was installed by us. And... since I don't really see any
"CacheBundle", it's a good guess that the cache service comes from FrameworkBundle.
Let's test that theory ...
|
{ |
|
// ... lines 2 - 3
|
|
"require": { |
|
// ... lines 5 - 24
|
|
"symfony/asset": "4.4.*", |
|
"symfony/console": "4.4.*", |
|
"symfony/dotenv": "4.4.*", |
|
"symfony/flex": "^1.0", |
|
"symfony/form": "4.4.*", |
|
"symfony/framework-bundle": "4.4.*", |
|
"symfony/mailer": "4.4.*", |
|
"symfony/messenger": "4.4.*", |
|
"symfony/monolog-bundle": "^3.5", |
|
"symfony/security-bundle": "4.4.*", |
|
"symfony/sendgrid-mailer": "4.4.*", |
|
"symfony/serializer-pack": "^1.0", |
|
"symfony/twig-bundle": "4.4.*", |
|
"symfony/twig-pack": "^1.0", |
|
"symfony/validator": "4.4.*", |
|
"symfony/webpack-encore-bundle": "^1.4", |
|
"symfony/yaml": "4.4.*", |
|
// ... lines 42 - 44
|
|
}, |
|
"require-dev": { |
|
// ... lines 47 - 48
|
|
"symfony/browser-kit": "4.4.*", |
|
"symfony/debug-bundle": "4.4.*", |
|
"symfony/maker-bundle": "^1.0", |
|
"symfony/phpunit-bridge": "4.4.*", |
|
"symfony/profiler-pack": "^1.0", |
|
"symfony/var-dumper": "4.4.*" |
|
}, |
|
// ... lines 56 - 103
|
|
} |
See Code Block in Script
|
// ... lines 1 - 2
|
|
return [ |
|
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true], |
|
Symfony\Bundle\WebServerBundle\WebServerBundle::class => ['dev' => true], |
|
Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true], |
|
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], |
|
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true], |
|
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true], |
|
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true], |
|
]; |
See Code Block in Script
... /"
}
},
"require": {
"php": ">=5.5.9",
"symfony/symfony": "3.1.*",
"doctrine/orm": "^2.5",
"doctrine/doctrine-bundle": "^1.6",
"doctrine/doctrine-cache-bundle": "^1.2 ...
... /master/composer.json ). stof/doctrine-extensions-bundle is fine now, so it stays as is. The whole composer.json for successful update for this tutorial:
```
{
"name": "symfony/framework-standard-edition",
"license ...
1535
symfony bundle
Filter Results