 It's just this morning that I found out that I've spent like 23.41% of my life on Drupal.org. So that's like 13 years and seven months that I spent, that I've been there. Started from Drupal 4 and 5, 6, 7 and then 8 now. Today we are going to look at Drupal 8 bog-offs, a hitchhiker's guide to less popular symphony components. Now, buy one, get one free. We all love it baggy, right? But we all know that actually you are paying for two or three items when you buy one and get one free. But anyway, that's all we had to talk about. Well, my good friend, Nonimos, said there's nothing like a free lunch even in the open source world. So you get something free, that's usually a price to pay. And he also said all vanilla Drupal installations are equal, but some are more equal than others. What does that mean? So that means there is a slight difference between the symphony components that you get when you use Composer Create Project and when you just download Hitah Ball from Drupal.org. You've got some smaller components that get pulled in when you use Composer. And that you can easily verify with Composer Show. Now, all the symphony components in blue come with it when you get Hitah Ball. However, Composer Create Project actually pulls in the ones in green. And most of what I'm going to talk about today are the ones that compose a person. OK, yes. Now, I've sort of looked at all these lesser known components and I've classified them into four groups. Very simple, it's there, just do it. It's there, you need to use it, see what that means. It's there, do your own thing. And it's there, nothing stops you. Now, the first one, is there, just do it. I believe some of us use something like this. Some people say Exdebug is the only thing. But Vadom is there, DPM, we use Kint, we use DSM, we use Print R. However, that Vadom component allows you to call just dump. You don't need to do anything at all, just like you do DPM, you use Vadom, you use Print R. All you have to do is just call dump. And there you get something like this. OK, so let me just exit now, I hope this works. Yeah, can we see it? I've got a super cool site here. Yeah, you can see it there, it sits there nicely, you can collapse everything, you've got the language, you've got the array there, it's super handy, I find it useful. And you don't have to do anything at all, just call dump. It's there, you just have to use it. OK, now before I go to the next one, let me quickly do something here. Let me check out this. I've got a branch here for the next. OK, cool. So, let me now refresh this sign. What happened? What just happened? Anyway, we all probably have seen that message a number of times, so I just go back. And that's what the next component is all about. It's there, you don't have to do anything special except just use it. That's a symphony debug component. How is that going to help me now? I just need to add the following two lines at the top of my settings.php. And then let's see what happens. I hope it works. So that's my settings.php, I've added those lines there before. So I just do that. Let's see whether that's going to help me now. Ah, that's better, that's better. It takes me a lot of time. And before going to the solution to that problem, you can see how the request is handled. You can see index.php is handled. And then where the magic is happening in the symphony, that's the handle method. Where is handle method? It's not there, I can find it. However, when it gets to the point of connection to the database, it says that's the problem. Access denied for user, you can see. And that's there. So let me see where the problem is. I think I know. So now all I have to do is I've got some DMC Amsterdam. And I know my... Close your eyes while I type my password. I think I should do it now. DC Amsterdam, DC Amsterdam. We are happy again, yeah? Awesome, awesome. Good. So nothing else needs to be done. Let me just switch back to my old... Because I need the others. Okay, that's better. So we can see how that small change allows us to have more information about errors, about things, and our code. Next is this one. The Finder, the Finder component. It's there. You have to do your own thing. It's not that used a lot in code or in... Whether it's the console, the Drupal console project or all sorts of things. However, I find it useful when dealing with fires. And let me just... You see? I would like to get zip files from a certain directory. And that folder is nested. And I just want to do that, right? So this code works, right? It works. But then look at the code. I'm looking for all the files. And we know fires. And here you can either be the folder or the file. So we check whether it's a directory. Then we recast back to get the zip files. And again and again, then we do path info. And then we check for the extension. And then we get our data. What about this one? That's what the Finder component allows us to do. It's an abstraction. Of course it's an object-oriented abstraction of all the functionality we saw earlier on. But you can see. You can fit up by the name. You can fit up by size. You can say I want to get fires between this size and that size. You can do all sorts of things, right? And then the output is just the same. I don't know which one you prefer. I know the one I prefer. And the output is exactly the same. So if I go to my site. Yeah, you can see that. Let me just turn that off. Let me just turn that off. I've just done something. I shouldn't be done really there. OK, that's better. So that's the one. And exactly the same thing you can do. You can see with my Finder. But when it comes to code, the one that is easier to understand, of course I know the one that I choose. OK. Is there? Nothing stops here. Now, with this .env component, there are two things that I would like to mention before coming to this one. First of all, Drupal Core includes a .env example. Right? So it allows you to store credentials in a .env file. However, as documentation says, you need to call getEnv to get the variable you set in the .env file. You don't need to do anything else apart from copy this .env example to .env. And then you can then use getEnv to get the credentials. However, I read somewhere that getEnv is not that safe. It's not a performance. I don't know what that means. However, this .env example in Drupal Core is managed by another component. It's Vlucas.php.env. And that was what the symphony guys took. They made it more object-oriented. And we can do other things, different things with that component. So what that allows us to do is something like this. Let me just show you before I demo that. What that allows you to do. However, before you can use that, you need to install it. You deal with the composer require symphony.env that pulls in the component for you. So in your settings.php you can after creating the .env object you can now load the .env file. However, if you follow the Drupal recommendation of just copying the .env example to .env in the same place you don't need this, you don't need that line. .env load. It's not automatically for you. And to make it easier you can also name space your variables there. So let me show you how that one looks like. But that one looks like. So I've got my super cool app here. I named space it DCA. This is the credential that I need, right? And to make it work with the settings object in Drupal and I'll do something like this here. I can just similar to what we saw earlier on the slide. So it's exactly the same thing. So I'm just reading my DC underscore variables and removing it so I can then set the value in the settings area. So what that means is that when I want to use that in any place it works just like any other settings then because load it automatically for you. You don't have to call .env again. You don't have to do any of that by yourself, right? So you can just do your settings normally. So you can see it's there like that. Settings get. I get API user and then you can do that. And we can see it here. I think I made it. That's what that one is called. So that's from my .env. It's not accessible from the web and that kind of thing and that's what .env is used for. There are other uses for the .env file. Now all these components were documented on the symphony website. So if you go there just type in components and you get all these all the different options. You can have different .env files for different environments and then to get automatically loaded for it depending on the depending on where you are at. Yes. So where are we? So just a quick just do it. You don't have to do anything and you have to use it. You can just use X, Y, Z and then and then if it's there you can use it as you like like to find a component or something that is there out there in the wild. It doesn't have to be a symphony component at all, right? Maybe you like how digital time is being handled but a carbon project requires a carbon and then you use it. So now there is there's another there's another thing that you can do now the Drupal console project leverages the symphony component from the symphony project and there are some gems little gems in all these packages that are not being used at all that you can use to do something like this. Let me just do something like this quickly I think my time is nearly up let me quickly do this now there's no content here, right? You can write you can write a Drupal console command to generate notes for you, right? Sometimes you would like to get a visual representation to show where you are at I worked on a project that had to handle like that was pushing pushing like 10,000 tens of thousands of files to S3. There was no way we could know, right? Whether it's successful or not we just crossed our fingers, you know however, something like this let me just say there's oh, I hope I remember this command let me just let me quickly ah, DNC okay, that's the alias Drupal, DNC look it's telling us how many notes have been created and then it tells us done so that is the progress bar class in that's part of the symphony console component and the code is simple of course you need to create the command yourself, right? and then in that command first of all you need the progress bar class, right? and then you initialize it and then you customize the output and the device is open now you can now start your processor, right? as many as you like at the bottom of the loop you advance the progress bar by default it's just one for instance if you've got chunks chunks of items to then it makes sense if you have 10 then you can then advance 10 so that's gone 10 items and then you can track the progress and then progress bar finish yeah, so that's it I think we are finished right? yeah? hold on yeah so let me just the we can see our 1000 nodes there so they were created for us nicely yeah so quick recap then yeah my friend says what happens in Amsterdam stays in Amsterdam but he added something else what happened? shouldn't stay in Amsterdam so what I'm trying to say is that whether it's one little thing that you've learned over this couple of days it'll be good to take it back with you I hope one of those little gems will be something from this session thank you thank you for your show tomorrow and please take the survey thank you very much