 session. So I hope you're all here to sort of get a sense of how diverse the kinds are here. So who here has a Drupal setup module? It's already started operating pretty much everyone. Has a Drupal setup module that maybe had, I don't know, six people. So before I start, just want to mention, and so my name's Alex Bronstein. So also where we are in the process right now, so you just start by taking a Drupal A alpha one that was released. We'll see how reality turns out, but those are sort of our work. So one question that comes up is when, you know, why should you update a module? And the answer is it depends. For example, before, you know, at the code spread, for example, we still haven't sold data, so we still have a month, which things can still change quite a bit. The APIs are not yet frozen. So even in the process of updating a module, you'll see something like that. So that's the advantage of starting now. The disadvantage of starting an alias is that we haven't frozen APIs yet. So whatever you do now might not work in a month or two. So some of you might want to wait until beta one. These means, you know, we don't change APIs anymore if we don't have to, but if we have to, to fix a critical issue. So some of you might want to wait until the police can't do it, or until 8.0 releases. So it's just, you know, to make the sooner you start, the more influence you have. You're familiar with the payouts module. You've seen this presentation online, or a version of this presentation online. Okay. So this is actually a presentation, an update to the presentation that web show Kenji Byron gave at Sydney a few months ago, but the content topic has changed quite a bit because... So what I'm going to show is something called the payouts module. This is a module that's sort of been made for a similar purpose like seven, eight years ago to demonstrate how to update from like 4.5 to 4.6, and sort of reuse of these sessions ever since. The branch that I'm showing is called 8.x-courtland. So this has a commit history, so later after the session you can find 8.x-courtland as all the code that I'm showing you. You can type the commit history, but it does. Obviously, it's not going to touch on everything that's changed. This is a fresh install of a triple set of seven. So I'm just going to sort of show you what the module does on triple seven. It's having a standard program configuration page. Okay. So that's a site-wide configuration. So I have a site-wide configuration form. You can see their path status. The module also comes with a block. Two blocks in fact. And a changed path block. My changed path block sort of gives me a way to just, through 8.x, I can just click change. My path's off, and I can click change again. The recent path block tells me the reason I did it. So that's pretty much it. That's the functionality that I love. So I'm now going to show some of the code. But before I show the code from the module, I actually want to show you the code through the text. Because actually the first step, the best step to take, start telling you, as you start trying to care, I see how many of you have written tests. So there's credit, create, update, delete, is to make sure that I can call the basic, you know, payouts get, payoutfigurationtest, which basically tests my configuration form, to make sure that I can't go to the configuration URL that I expect. As far as days, I can test, and I can get to the user profile page. I want to want the user profile page that I have my status, and then I can go to set testing the block by 100% or maybe even 100% test coverage. So where's the module? The module has permissions sort of function, that's a, you know, combination of permissions. I either have permission, limitation, which defines my two URLs. So I have my one URL for being able to change it, and my configuration URL. The practice in Drupal 7 is for, is to put page callbacks in separate files, right? Because most of this just sort of allows the implementation of those functions exist, the status. Similarly, the other one, the configuration form, I can put it in my own Drupal 7. You put your modules in, like, site-told modules. In Drupal 7, modules was all, so this, right here, version of the module, you know what I do is I want to enable this module, so I go to my, does the modules page know where something is? It's in the dieting profile. So I go to my dieting profile, and I think, oh, well, maybe, my core version is right, except I have to know, you know, if I have to type experience Drupal 7, I know that, just because I got my core version wrong here doesn't mean it shouldn't show up in the modules page. It should, the behavior should be like, this shows up in the modules page, and this shows any resource on Drupal.org, slash list changes. So this just was, this just renamed the file, and the animal extension, but you'll notice this isn't actually an dieting platform, so there was an entry in the dieting profile that pointed me to my test, and things you could do here, right? So from here, I could enable it. So one path you could take is you could actually try it, like you could go to, like, the configuration page, see if it works, you can try to go to the user profile and see if it works. I'm lazy. I think I have all these automated tests that spent all this time right across the change record. It mentioned something about removing files entries, right? So the way, the weight test that we're talking about in Drupal 7 is that so basically, one changes in tests are basic classes. Okay, so one difference in Drupal 8 is whatever we have classes, instead of them being, and actually, I guess, not quite the same as they were before. In Drupal 7, you could just have PSRZO standard is also, and every class doesn't just leave them in some direction, but it leaves curves. It'll start telling you that, well, oh, because I changed my test, and it tests its classes. Well, if there's this new PSRZO standard where I have to, you know, change my test, probably the basic classes also have to be put into it, but I happen to know, because this is my module, I happen to know that, like, CRUD should be, like, the first thing I do when it comes to less useful objects. Basically, it goes with the database API. Configuration forms is basically telling you something quite wrong with the configuration form, like a function that doesn't exist, a system setting. So the purpose is, very much said, you sort of get a configuration object, and that a big change is that in Drupal 7, what system settings form, you know, it's a big function because Drupal 7 just assumes, like, anything's a big function. Just in case, like, you just need to make your config object to get set the, you know, basically set the thing, you know, set the pin step within the configuration object to the same as what the form submission is that's saying it. So it's a little annoying that being able to be explicit. I've been safer because in Drupal 7, you know, when I did a, like, saving all sorts of things to the test, we'd start getting into blocked records for how blocks have changed, you know, you'll find instructions on how these classes, we put them in the right folder, you sort of get to the class, the system automatically finds it, and there's various functions that you can call, and then there's a specifically special function to get info that tells you the information. So that's a pattern that exists in Drupal 7 for tests, of saying, instead of having an info, there's other sort of random public location, and the special location is blocked in block. Other systems, other than block, would have a different location. You return the same thing that in Drupal 7, you would information goes into the annotations. Why annotations? Why not? I get info method, like we did around. The reason it is, because it's just a really unfortunate limitation of PHP, the class has to be loaded into PHP right now. So for tests, we sort of accept that because we could just say, if you want to run tests, the web UI, but to run Drupal itself, we don't want to, you know, say that, you know, you need this, and say no, and the alternative, the only alternative that we really came up with to that was, was annotations, because annotations can be sort of used to do a lot, and the change records go into this, so the question is, how do we run tests, and all of the tests that are running here are functional tests. They're not unit tests, so they're still running in PHP, and it allows you to unit test it, which has a lot of benefits, and so one of the things you can start doing is if you have tests that are, if you actually have real unit tests running in functional tests, then I would do just testing specific API functions around that, like, visit this URL and see if the response has, working on Drupal 8 Alpha 1 isn't really enough, right? You kind of want it working on Drupal 8 and this is, this is the Drupal 7 way of declaring that unit, so this is actually that within a hook menu there's two different kind, you can categorize the information that's in here in broadly into two different ways. Some of the information that's here relates to essentially configuring that in particular that each callback is part of that, right? It's like, okay, when someone visits this, you don't know what is, what is the function that we need to run in order to return the right stuff. I'll see a couple of things. I'll see title and description. So this one actually has a, the VHX one has a title as well, but in a way that you actually want to do, there's title and description because this link isn't just, it's not just telling me, so the idea is there's sort of many routing, what should the server do, and then there's like information about links which says, you know, how do I build up menus. So the Drupal 8 we're splitting those two but that actually had no menu that moved elsewhere, no option where it was the configuration one. All of the routing stuff moved, so that's a menu that reduced to just a couple places. So one is there's a routing dynamic file. A few things here I defined by two ranks, and it's changing and settings. I specified a permission in this case. What I'll notice is there's a distinction now between the sort of identifier in Drupal 7 and the key was also the URL pattern. Here, those are two separate things. One of the ways in which that's useful is web services to work. You'll also notice that like in Drupal 7, you can use a few menus per cent or slash per cent user based on some thing. Instead of doing per cent user, you sort of put users in these user braces where you can put per cent users. So it's a class. So essentially what I've done is that it took what used to be at my pages.inq ans.scoreChange function and I can just make it a method and it's actually the same code that's in the end. In the case of forms that you're converting forms over, then again there's a change record on this if you look for like a system config form base or if you look on the change record for the and it sort of talks about having two forms so I have two forms of by the way if you go to the repository if you are removed and see the github each of the github message has a link to the change record to sort of took my form. Yes, exactly. So here we don't in the case of a symbol if you look at how you have your logic it's a very simple page call button. That doesn't require any fancy objects or any features. Then yes, if you want to take advantage of sort of many features then you can start converting from some multiple space classes in order to get that and it's very likely to happen. So we don't know yet what's happening. So just a change starts up in the handle from tpl.php to twig it's essentially where you used to have use the sort of twig syntax which is curly brace, curly brace and then there's stuff to be taken out as far as I know those are at least with the path module but that's all that's necessary to do to get their stuff working wonderfully. I mean there's the path module a symbol if you have more complicated modules you might run into a cave in APIs you might run into is not having to do with APIs are actually still in flux. There are four hundred two different some of these changes so you can encounter what I'll mention is I sort of ran out of time to show this here but if you look at the get history of the path module it demonstrates some of the cool necessary something to show what's necessary to do if you think stuff with dependency injection like you can take so for example here so you have a custom module on the website that uses relational database features you can take advantage of in tpl.php for web services it's more like code services as methods and is that then some other module so you can still some other module comes to the service declaration it just means that someone who for example they can just override your implementation of the path's current service with implementation that works for a month can be a feature you can take advantage of and moving to sort of more object orientation but you don't have to base it right in the act procedurally or some relational take closer to sort of tpl.php because if there's you can either raise your hand or go the question is what's the status of that compatibility so specifically with the writing system so we still have you know we still have the test worked and the reason we still allow these ways to work is because it's a huge effort to get all of our modules something like 80 modules to get all of the important to using the system there's lots of problems where you're trying to get all of that so some shipping jubilee with both in place would be of course converted to not be so the question is in jupil 7 if you're wildcard path smart percent you know if you have like percent node and the path percent user and the path that wasn't just you weren't just defining the type of your argument so what it would pass to the function would be a user object not just the string that came through this magic naming it's a city types so in user node it's possible that we will remove sort of the need to do that magic name and that it if out of this this user outcasting has happened imagine there's a debate of the issue of attacks like this so it's you know it's four lines the arrow code which you didn't otherwise need and this is just a way to identify that user seven you could do percent user slash percent user and the races are correspond to the name so there's sort of two things you're naming something because that's the name of the argument and you also want to identify what type of conceptually there are two different things and force them to be two different things though there's still some debate on it so yes the question is that somebody has the synthetic graphic system and some of the other things like that and the observation was that interesting features had a straight balance to this and others so can you repeat that so I guess the question is for people who are familiar with procedure code every type of interpretation in general are behaviors in this particular sample so I guess one answer is we will need to have an example with you know blocks so understanding like block base because you don't necessarily need to understand how it works you just need to understand that it's there and you can extend it so for example there's controllers and then there's base forms so I'd say at a very high level controllers and specifically for to also address the education question that is a question that becomes so much communication with your coworkers various different communities on Facebook and Google plus I'd say that the answer is that purple seven and purple eight thank you that's excellent point and that reminds me of you know how did we all learn about the modules are available how do we all learn about views and all the cool stuff you can do with behaviors and all the cool stuff you can do with rules there's a flag module