Hello Flex: Moving Final Files
With a Subscription, click any sentence in the script to jump to that part of the video!Login Subscribe
We're on a mission to remove the last parts of our Symfony 3 structure!
So what about the
DoctrineMigrations directory? Look in
src/. Interesting... the DoctrineMigrationsBundle recipe added a
Migrations/ directory. So, I guess that's where they go!
Copy all of the migration files and paste them there. I guess that worked? Let's find out:
Ah! I guess not! It says that my migration class wasn't found: Is it placed in a
DoctrineMigrations namespace? Bah! I don't know!
Our files have an
Application\Migrations namespace. What's going on? Open the
Ah ha! The recipe installed config that told the bundle to expect a
DoctrineMigrations namespace. Easy fix! Copy the current namespace, and paste it here.
|// ... lines 2 - 4
Try the command again:
Life is good! Well, we don't have a database - but life is still pretty good.
At this point,
app/ only has 3 files left:
autoload.php. And unless you made some crazy customizations to these, you don't need any of them. Yes, I'm telling you to delete the
composer.json, remove the
classmap line: those files are gone!
Let's reset our files and look at each directory one by one. We need
public/ is the new document root.
src/ holds our code, and
translations/ are all valid Flex directories. Oh, and
tutorial/? Ignore that: I added that for this course - it has a file we'll use later.
var/. Delete everything except for
log: the default logs directory was renamed in Flex. And that bootstrap file is a relic of the past!
web/! This directory should not exist. Select the files we need:
vendor/: move these into
public/. Let's also move
And that's it! The
favicon is from Symfony and we don't need the app files anymore. What about
.htaccess? You only need that if you use Apache. And if you do, Flex can add this file for you! Just run
composer require symfony/apache-pack. The recipe will add this inside
web/! This is it! Our app is fully in Flex! And we didn't even need to move all our files from
src/AppBundle... though we will do that soon. And as far as
bin/console is concerned, the app works!
But to really prove it's alive, let's try this in a browser and handle a few last details. That's next!