 My name is Garrett Woodworth. I'm the project manager for CakePHP. I joined the project in 2005, about four months after it was first released. It was initially released really, really simply. Just a quick, easy MVC. And then some other developers picked it up after the original developer. And we proceeded to build onto it as much as we could to make things easier. So, basically, why do we have CakePHP? Why do we... Oh, yeah. I meant to do that. There we go. So, why do we... Why do we do CakePHP? Why do we build CakePHP? We wanted to make our lives easier, building web applications. I don't know. How many people in here, I'm just curious, have used Cake before? So, about half. That's good. Some others have heard about it. Cool. All right. Nice. So, there'll be a lot that we can cover, and hopefully we can do it pretty quickly. So, anyway, we built CakePHP, make our lives easier. PHP itself is a really unstructured language. We used to see just tons and tons of scripts that would just be mashed up with HTML, mixing in with email and all sorts of different things. So, the idea here was to bring structure. We needed to have something that would install anywhere. That's something that's really important to us. CakePHP supports PHP 4 and 5. Works as easily across any version from 4.32 on. Works with MS SQL, Oracle, Firebird. Obviously, MySQL Postgres. So, you've got pretty much anywhere that you want to put an application, you can pretty much do it with CakePHP. The other thing was to bring the structure. We needed to have something conventional over configuration. This came from Ruby on Rails. This is something, and a lot of things that we do in terms of our structure came from Rails. That was the intent of the original developer. And so, you know, we've carried that on. Convention over configuration just makes a lot of sense. It means that we don't have to spend a lot of time setting things up. We can drop it in place and we can make it work. So, it goes really well with installing it anywhere. It's flexible. It's extensible. There is a structure. That structure is meant to provide you and other developers, a team of developers, an idea of where things can go. We'll go through some of the structure and how it does still allow flexibility and extensibility, even though you're somewhat locked into how things are set up. But that allows you to think about everything else. That once you know where things go and once you know how to set things up, then you can just have fun and make stuff that works. Write less to do more. I think that's pretty simple. I think we all want to write less code. I think when we want to maintain a project, when we go back to a project after three months and client wants a new feature, or we want to add a new feature to our own web app, you don't want to have to look through a thousand lines of code to figure out where you're going to put it in. You want to be able to just jump right in there, add something new, and move on. So, less code is good. We've got a cake growing community. Cake is really growing pretty fast, and it's still growing fast. It has been over the last two years. In August 2005, there were 150 people on the mailing list. There's now close to 7,800 people. So, it's 7,000 people, close to 8,000 people all answering questions sitting there. We've got over 150 in the IRC channel on a daily basis. So, things have really grown in the last two years. I think that's a really nice aspect to cake PHP, it means that a lot of extensions and a lot of ways to grow outside of the framework are being developed, and there's also a lot of good examples that people can use to go by. And then we've got MIT license. We're here at Open Source Conference, and MIT license is about as open source as you can get. So, anyway, that's why. Basics behind cake PHP, if you don't know it, if you do, this might be some review for you, so I'll try and go through it pretty quickly. MVC, so it's got a model view controller. I think a lot of us are familiar with the model view controller. I don't need to spend too much time on that. It has a front controller too, so basically everything goes through one place. Everything goes through the dispatcher. This makes it a lot easier for us to manage the request and to control where everything's going. Routing, so another way that we control the request is we can route it to different places. We can understand what's actually being requested, and we can discern certain things from that that are going to help us in our application. There's an ORM, so we have associations. Associate your models together so that you can pull back the data that you want more easily with less code. That's become really popular, and Cake uses it really well. It's all built in, it doesn't come from anywhere else. We've got our own unique ORM scaffolding. So this is something that people want to see so you can get prototyping really quickly. So basically you can, with a couple lines of code, you can build out your whole application. You can see what the database is going to do. You can start interacting with your database. You can create, read, update, and delete things with just one word. Validation. So I think every application that you're going to build is going to need some sort of validation. You need to know what kind of inputs coming in, and we try and make validation as easy as possible because otherwise it can be a nightmare, and I think we all know about that. So extending Cake, once you get by the basics, you want to start adding some more functionality on top of the normal framework. You've got behaviors. These help extend your models. So basically you can add functionality to your models. You can use the callbacks that are set up in the behaviors to do things automatically for you. We'll look at a little bit of that later. But those help out your models. Then we've got data sources. There aren't too many of these, but there is a Facebook data source that's being built. This is just another way. If you look at data, just like a database is another data source. You've got XML that could be a data source. Facebook could be a data source. Some APIs act that way. So that's one way that you can get your data. Components. We've got a lot of built-in components, and that's just an extra place to put some code that you might use often in your controllers. So you throw it in a component, then you can put it in different applications, and it's all nicely encapsulated. Helpers. Helpers really, really make your life in the view a lot easier. We all have our pains with markup, and Kate comes with some really nice built-in helpers, and you can make your own to do anything you need to in the view and make things really simple. So once you get that data back and you want to display it a certain way, you can do it easily. Plugins. This is a growing part of cake. People are just really adapting a lot of their code to plugins now, and we can do a lot more with plugins. So you can put together components and helpers and behaviors all into one plugin, then you can just move that plugin around. Or you can make a plugin actually have a blog, for instance. Then you can move your blog plugin around as well. So those are being developed, and it's a really nice way to add functionality quickly. And then last but not least, we have the vendors. So if working within the cake structure doesn't work for you, you can always just throw a class inside of vendors, include it as you normally would with some simple line of code, and then create your own instance of a class and start using it. Or maybe it's some basic functions that you want to use. So that kind of breaks you outside of the structure, might not be something you use all that often. Some more goodies. This is a lot of stuff that we have now in Cake 1.2. 1.2 we've been working on 1.2 for almost a year. We've added a lot of new features to 1.2. We've reduced the amount of code that you have to write tremendously and add in a whole bunch of new things. So pagination. A couple lines of code you can paginate records. We'll look at that a little bit. Authentication. This is all like the Asian stuff over on this side. We've got authorization. All this is built in so it's really simple to add. Internationalization. You know, here we are in Europe so there's a lot of different languages. A lot of people in the US might not need some of the difficulties but internationalization and localization are really important for applications and this is all built into Cake. You can do it statically or dynamically. And then configuration. You might have your own configuration for your own application. Cake doesn't necessarily need too much configuration but you might have some configuration that you want to set up for your app so you've got testing. We've in 1.2 the test suite is included in the download. Cake now has test coverage for a lot of the core which helps obviously the stability and it also allows you for your applications to test first and follow the test driven development. I'm not going to go into testing too much but there are some good presentations out there on it that will become available. Debugging, Cake comes with a debugger so it's got a stack trace. The default when you're programming like a web app is a JavaScript. It's got a nice little drop down that you can actually see the whole stack trace. You can see the context of the code where the error is so that really helps when it comes to debugging your app. There's error handling as well. Some people have said that you don't really need any documentation because Cake sort of tells you what to do. If you've got a missing controller there's a nice error message that shows up that tells you you've got a missing controller. You can also use this error handling in your own application to throw 404s and any kind of error message that you want to put out there. Caching. When you optimize your application you have to look at caching. In 1.2 we have cache engines for memcache, apc, xcache, file caching, and even model caching. You can cache anything anywhere. There's a set class. The set class makes it really easy to work with arrays and objects. You can actually take objects, put it into the set class and get an object out. Plus all these other nice helper methods to extract from the arrays and add to them, combine them. The set class is really powerful. There's a string class. The string class is being used with the Unicode support and it also supplies us with the UUID. If you set up your database primary keys to have 36 characters it'll be a UUID automatically. CAKE will just use a UUID and generate that all for you. If you're going to have multiple databases running on the same application you start to get really big auto increments and not going to do it for you. UUID is really important. That may even become the default. We're still going. There's more. Unicode, this is something we actually put inside of CAKE. It's a pure PHP implementation of Unicode. Yesterday there was a good talk on PHP 6 Unicode support but it's still going to be there. We're still waiting for it. We've included some functions inside of CAKE to help us do that and that's going to be adapted into the core of CAKE too so that we can handle all these character sets and it goes along with the internationalization and localization stuff too. Asset filters this is a nice way so you can actually compress your CSS or your JavaScript on the way out basically. Cache it, do whatever you want with it. You can put a class in between the output of your assets whether it be an image or CSS or JavaScript. Reverse routing we're not going to go through all this stuff today because we've already been here for 15 minutes. Reverse routing you can put an array into a link for instance into the helpers and you get out the specified route so you can fully control what the link looks like going in and what it looks like coming out so if you change a route inside of your application you don't have to go looking around for a string everywhere where that needs to change just do it dynamically. Resources this kind of goes along with assets in some ways but RSS, XML you've got extensions to these things. When you have an extension Cache understands that on the request coming in it's going to actually pull out different view files and do different things based on the resource that's being requested so it's a really nice way to do RSS XML without having to change any controller code any model code you just add a different view and you're done. REST so there's REST support now inside of Cache so if you're going to build an API another thing that the resources help with you might want to enable RESTful API so Cache helps with that as well XML parsing it so if you don't have simple XML or you don't have something else this is another one of those things about installing it anywhere. When you build an application with Cache if you use the stuff that's inside of Cache it's going to work wherever you put the application which is a really nice thing. HTTP authentication goes along with the APIs the RESTful APIs you're going to want to protect those for certain people HTTP authentication digest or basic and you can control and you can also quickly do that for an application that you're building for a client for instance if you don't feel like going through and setting up a login system and a user database or whatever you can just in two lines of code enable HTTP authentication. There's a socket class I might have some time to show you some cool stuff with the socket that I did with IRC but basically anything that can take a socket you can do it and so there's an HTTP socket as well this makes it really easy to consume APIs and also provide them as well. We're not going to have time for all this stuff. There's a media view class the media view class allows you to dynamically output jpegs and swifts and gifts and whatever you want to do whatever piece of media there is there's a magic db class so we actually read all the extensions and all the content types and output the proper headers so that kind of helps with dynamic and then there's a theme class as well, theme view class so you can locate if you want to have multiple themes in your application you can locate those in different different view files and move them around and they're nice the command line command line and cake is a really amazing tool and it's just a tool. It's not a requirement but once you get used to it, it's really nice so we provide some nice little command line utilities for ACL, the access control handles the authorization so you can quickly add that there's an extractor for the initialization and localization stuff so you can actually when you build out your application you just run the extractor from the command line and it'll go through your whole application find all the strings that need to be converted generate the po and mo stuff for it so you can go in and translate everything bake bake is the code generation utility once you've scaffolded an application you might just bake the whole thing and you've got all the code there that handles the create, read, update and delete bake is really powerful it's really nice maybe we'll have some time to look at that too there's a schema command line utility and this goes with the schema class so this is kind of like a database migrations but it looks at your whole database instead of just that one little piece of it and it provides you with a snapshot of your database at a specific point in time commit that to SVN now you've got it versioned you can go roll back if you need to you can move forward whatever the case is schema really helps manage your databases if you alter something in the schema you can apply that to your database or if you alter something in your database you can generate a new schema file so it works both ways there's an API shell so if you you know let's say you're on an airplane or somewhere and you want to check out what's going on in the API you can just quickly type in a few commands and check that out and then there's a console, an interactive console so you could actually start debugging your models or building models or exploring your database from the command line with the interactive console you can also check out some routes we'll quickly try and show here the API so cake API model for instance this lists out all of our model all of our model methods so we can see what all those are and let's say we want to look at save all for instance this will tell us a little bit more about save all it takes data and options saves multiple individual records for a single model so we can do all sorts neat things like that we can do cake API helper form and now we know everything that's in the form class so this is all available to us as well if I want to look at let's say the radio buttons creates a radio set of widgets or creates a set of radio widgets tells us about the parameters so this is a little bit big for the screen so let me just try and do that ok so anyway that's a really helpful utility when you're moving along so now I got to go through all this again shouldn't have done that but anyway maybe we'll have some time for bake at the end too ok so what's next I don't know oh bad cake this was actually done by Amy Hoy who's a big Rails developer but one of the things that we want to look at is how do we build the right cake application and traditionally or let's say in the very very beginning a lot of people would have these tiny little skinny models which was basically just the class and then their controllers would handle all this logic and grab all this data transform all the data and do all these things and then the views would be kind of small and tiny but that's not the right way to do it nice of a Rails person to actually create this for us so we have good cake and this is the good cake the good cake has some fat models so you've got most of your logic in there you can use that in other places and you try and keep your controllers as skinny as possible so that you can look back at the controller know exactly what's going on know exactly what's happening and then let the models do their job of dealing with the data so just remember that thank you Amy Hoy slash seven if you want to visit her website she's got a lot of good articles on a lot of stuff that deals with rapid development think twice code once this is another little thing I try and remember that cake is not writing less code so if you just if all you're thinking about is getting something done really fast then you're not necessarily really thinking about your problem and what you want to do is try and say well here's my problem how can I boil that problem down into as few lines of code as possible we've tried to do that inside of the cake core you should try and do it inside of your applications like I said when you come back to it I'm happy you did that okay so move on to the models because they're really important some of you have already played with cake but the cake has associations has one associations belongs to associations so these are one to many one to one, one to many another one to many has many we'll see an example of this has and belongs to many as well so this is when you have a joint table okay so this is a user model sample user model class user extends app model has one profile this is really typical user typically has one profile belongs to level I just put that in there because we need it to belongs to but you know you can belong to a level and that might control some access rights or something like that who knows but anyway that has many posts that's we're kind of familiar with the whole example of posts I think a lot of people are at least and so a user usually writes some posts and they got many of them and then has and belongs to many group so this is just a sample of some of the associations that you can put in there so this a user would maybe they're part of you know the PHP group but they're also part of the cake PHP group so you need to you need to have that set up with associations this is an extension on the has and belongs to many so when you start dealing with has and belongs to many associations you're going to start to say oh well maybe I need some more data in my has and belongs to many table how do we access that well we have this with association and while cake does it automatically for us it's nice to be able to name that so this enables extra fields in your joint tables access to the model from the joint table so we have a group model group table in this case we've got a users table and we're going to join these together with the groups users so and here we go we match these things up with some nice arrows and so this is our join but you can see that our groups users we want to know a date when the user joined the group so that's going to be specific to that association it's got to be in that table how do we access that so we add the with here we go we're back to our same model again and here we're specifying the group this is the alias that we're using the class name is group as well and then we're going to it's going to call it with group so this is how we're going to do it take by default we call this groups users or groups user and you can access it that way but we're going to call it group so it makes it easier to access in the before save function if there's some data if the group array of data is filled up then we're going to save that into the grouped table that would assume that would have our date in it that would have our user ID we'd save that right into the groups into that groups users table that we saw before so very simple very easy to add data into that table so then we might be using the with model inside of our controller maybe we want to get some information out so here's an index function where we find everything by the grouped so we find all the grouped users and we pull those back maybe we're going to pass in a group ID here or maybe we're going to pass in a user ID to find out all those users groups but anyway this is a way we can access that other model if you look at it the first user is our model and then the with association so it's pretty simple to see how you might access that users index this is where we print out our data so here we can print out our arrays of data that we get back the group name the grouped date while I have tag left over that was an old one I copied and pasted okay so that's simple whoa how did I get back to the end okay well that stinks technical problem sorry about that I think I held the key down all right so behaviors that's where we are we're at behaviors okay so behaviors like I was saying about behaviors this is a way to extend and add functionality your model that you can bring across multiple applications so they enhance some models they encapsulate reusable functionality and use some callbacks for auto magic which is nice built into the core there's a tree behavior that does your modified pre-order tree traversal stuff left and right and if you have to work with a tree of data you need to use this behavior and believe me it saves you a lot of time if you have to work with a tree ACL behavior that makes it easy to create access control for a user for instance or for a record let's say you have a post and you want to control that post you can use the ACL behavior to do that and there's a translate behavior and the translate behavior allows you to dynamically translate content so if you've got a translator sitting there and they read a post that was in English for instance and they want to translate it they can add it right to that table and it can be associated with that record so that when somebody comes to the site with German for instance if that German translation exists in the IATN content table then you can access it and you'll get that out instead of the English version which is kind of cool what do we got so this is a cool behavior this extends the model behavior it's just a simple example of what a behavior might look like these are the callback functions before find after find these are the same basic callback functions that you have in every model so these get called before you do a find or after or before save or after a save you know if it's created or if it's been updated before delete after delete and then there's an error so if you have an error you can find out and you can do something with it put out an error message send an email or do something else which is kind of nice so and then you can add custom methods to your behavior as well this is the be cool method and it's going to take an amount and then it's going to save it to the current model whatever that model that is and it takes the settings from up top we'll show how that's used and it puts the amount so it saves that so here we are going to use it let's see quickly we're going to use the post extends that model we've got the cool behavior this is our settings here we've got an array the field that you saw was being used in the bottom of that method there is cool amount so we can add to that and then we can use it inside of our controller be cool just like any other method inside your model so that's a really easy way to do it you might need a cool behavior for a lot of other models so this this helps out validation like I said validation is really important it's the king we've got a bunch of validation methods alphanumeric between blank credit cards comparisons you can define your own custom ones date decimals email equal to file ip addresses max length it goes on for a little while number, numeric phone okay you get the idea but validation is really important and we make that a priority inside of cake 1.2 here's how you'd set it up so you've got your model you put a validate array in your model you might be required it might have a length requirement to it with the max length of 100 is the rule and then the body might just be alphanumeric you only want alphanumeric characters in there so now we're under components they enhance the controllers so it's kind of a same old story here encapsulate reusable functionality use callbacks for auto magic there's an auth component acl component session component all these things are really useful the session component for instance the cake session class is really pretty advanced it goes much further than the core php sessions does things like in high security mode for instance it will actually rewrite the session every time and store the old session data in there so this can prevent session hijacking so security is really important to us too we have a cookie component there's an email component which handles html plain text email security request handler component which helps with the resource mapping that we saw before using the email component pretty simple add the component to our controller in the var components then we've got access to it we can simply send an email and more on the emails here we're going to send html in text so this is going to have a template our template is going to be located in our elements directory inside of our views and we can have a layout for this as well so you can send both html and text at the same time you can attach attachments you can do a lot of different things with the email class the security class is really important this is going to actually just talk about that http authentication that we saw before this is just to quickly add some protection to your site if you want to show it to somebody or if you've got an api you're going to want to have some http auth on there all the time so this is how you might add that so you've got a controller you add the component and then you can require login on specific methods and then you can set up your login users where the user and then the password so that would be it you get a little drop down if you went to the browser and you tried to pull up any of these add edit delete functions you'd quickly get that drop down and you'd have to type in cake and too easy to move on so the other thing that the security component does when you add it as soon as you add it it does something to protect against cross-site request forgeries so what can happen in that case if you're not familiar with it is basically somebody could create a form on some other site on their own site let's say and it's going to actually post back to your site and you wouldn't know where it's coming from it looks like any other form post might but with the security component there's a hash generated it's based on the values that are currently in the form if you use that it makes it really really difficult next to impossible to do something like that so it's a great protection if you're really concerned about your web app and people attacking your web app it's something that you enable right off the start when you go public with it authentication something that's really helpful when you're obviously most web apps nowadays have some sort of authentication and so here we're going to add the auth component that's it now every single method every single action that somebody might visit is now protected and would automatically redirect them to a login form so you just have to create a login form you can authenticate any model server, an editor, anything you want so you can authorize against models controllers or other abstract objects so if you want to create your own authorization you can do that you don't have to use the built-in ACL you can just use a model or controllers and then it automates the login so you don't have to write a login method all you need is a login view that has a username password field and you're pretty much good to go so here's how we'd set it up our components auth, we've got our before filter so in the before filter we do a lot of setup for components that allows the components to actually do all the automagic handling there's a startup method that gets called inside of a component and so that will allow you before filter allows you to set things up that will be used inside a startup and then startup can kick you back out and allow you to move on so here we're going to set the user model to be a member we've got a login action that we're going to define these are all sort of the defaults anyway so we don't really need to define these you can define the login action as an array or a string it's up to you the array would use the reverse routing that we talked about a little bit before and then here we're going to set the fields that the authentication of the database so we want to set that up and let's say the user name for instance you might want to use an email instead of a user name so you can use that or maybe a nickname is your database field that's up to you but you can control it and we're going to authorize against a member model here we're going to also map some actions so we know that these are the create, read, update and delete actions and we can control those from inside of our model when you're dealing with models you're basically dealing with create, read, update, delete that's why you map the actions so when we go to authorize inside of our model we can see we can see how to do that so there's an isauthorize method that's the one that gets called that's the callback for authorization and gets a user a controller and then an action that action is actually the create, read, update or delete when you're dealing with models so here we just have a switch and if the user role is an admin then we allow them to delete stuff otherwise we return false so right now this one only handles delete so um what I was thinking about doing was instead of I've got a bunch more slides but we're running out of time well trying to decide what we have time for we only have ten more minutes so what I could do is quickly show you some bake stuff because I think bake is pretty interesting and a lot of people are not familiar with bake so first thing I'm going to do is I'm going to bake a new project actually I'm going to change into my Faustem directory here which is on my desktop so now I'm in Faustem I'm going to cake bake a project called demo that looks okay it's going to save it in my desktop Faustem directory which I've already set up as a virtual host so that created the file now what I can do is I can just go over to Safari quickly you can see demo is already there um this can also be taken by Faustem I think so sweet demo got baked by cake php attempt directory is writable it did that all for me your database configuration file is not present I've got to do some other stuff here right so if I want to connect up to my database first thing I'm going to do is connect up to my database I'm going to actually create a new database called Faustem I'm going to add some tables into here maybe I'll have one called talks oops spelt it wrong talks I'm just going to use the auto increments for now because should be easier auto increment auto increment that that's going to ask for a primary key I'm going to add in a name for the talk I'm going to require that so it's not going to be null and then I'm going to have a description of the talk so I've got 9 minutes left oh no 10 he's just showed up the sign there's a description so this is going to be a text field here I got distracted text so this program doesn't work quite as well as cake it's still in okay tiny text is fine we don't care okay we're also going to add in a created date time field these are automatically updated by cake so we might as well add them created and modified date time boom okay cool so now we got a database it's got something in it at least but we're going to go back in here I don't know if you can all see that let me know if you have trouble seeing it because it's way down at the bottom I'll move it up so you can see that now I'm going to do cake bake db config because I need a database configuration if you remember back here told us we needed a database configuration that's going to we're going to use the default database mySQL you can see all the options there a lot of options no persistent it's on the local host I don't need a port root password yeah I'm going to use an empty password fostm is our database name we don't need a prefix or to deal with the encoding because it defaults utf-8 so we're good there that looks all good it asks us for some others you know make sure we verify it looks okay we don't need to add anything new so oh sweet I am exactly right thank you for telling me that I have to change into demo and then I could do the same thing again luckily we can speed through it because all the defaults are set up nicely and all I have to do is type in fostm here and who pinpointed that thank you for that anyway looks okay yeah no okay well that's just as bad no not really it's it's fine that had to do with the temp directory not being very happy at who the user was I should probably just do that do all of it oh pseudo we'll get this guy hey it's my local computer I could do that okay cool so anyway we got all green bars we're all happy now right so I got six minutes and I want to go really fast so what I'm going to do is I'm going to cheat a lot I'm going to do cake bake all and then I'm just going to call it talk and let's see if that works yeah so I just did everything everything that's needed for the talks okay cross fingers boom there's that's okay so here we have our talks already set up I can add a new talk this is Ji Wu by the way that's my name that's my nickname anyway description this is a great talk bam done okay I can edit that I can go back to the list I can delete it'll ask me a little confirmation message okay well that's cool well let's see what this actually did what did what did that do open up textmate so here we are with the talks so created I don't know if everyone can see that but I can pretty much let me see if I can increase the font bigger bigger bigger bigger oh there we go shift how's that good okay so very simple um created the talks controller indexed view add edit delete actions very nicely very simply uses session set flash it even handles the internationalization that we were talking about before so these are the types of strings that you might have with internationalization this is what the extractor would pick up and it would actually then put out a file for you so that you could do that uh so you could translate then it's gonna create it created my views directory as well there's my talks so add there's my ad form really simple ad form I mean there's some markup in there but this markup is there so that you can you can uh you know you can see what's happening if you want to make this even simpler you can basically do form create dot form four minutes inputs and then I'm gonna add my form end in here and then I'll just take all this stuff out well no I'll leave I'll leave in that action link there but I can basically get rid of the rest of this form and in one line of code I can go back to my ad form a new talk and I got the same thing now I've got to create a modified field because inputs actually reads every single table from the database and knows knows what you have so I can actually if I don't want that I can add these in here so let's say I don't want the created one but I want the modified one so I can take and add in the modified field creates the field set for me the name everything like that one line of code um takes us longer to print out this table so I mean we've basically very very easily we can we can do forms um what else we want to do we got three minutes left we already kind of built the application um so hey how about some uh how about we'll add in that before filter right so so we can do function before filter uh but I'm going to add in my security component first for our components equals security added that bam so now I can set up this security login users array cake what was it too easy was the password right okay so then we'll set up some security what was it login actions or something like that I think it's a method index um I can't remember what it was but I don't use it very often but we'll see what happens actually maybe we'll just make this add the security login action what is it alright let me go back to my presentation wait we still have time here it is oh require login yeah that's easier makes more sense too oops wrong thing oh there we go so we've got HTTP authentication too easy I'm going to remember now I can't remember it too easy did I spell it right no I probably used the wrong code no login users alright anyway um it's just a demo um how about I do uh how about I'll do regular auth and then we can show you um I'll show you that instead so here it's gonna well now it wants a users um I forget that too um but if we wanted to add users we could do that we've got uh out of time darn wait I still have 51 seconds no that's good anyway that was enough um you get the idea and uh in not too much time we we build something that that's pretty much functions so uh you can see the debug output down at the bottom and I'll take questions anybody yeah in the back uh compared to rails I think we do really well um and and yeah thanks for he asked about performance in case anyone didn't hear me and and he was specifically asking about rails I think PHP in general is a lot faster than rails we haven't done any specific benchmarks against it the benchmarks that have been done uh put cake PHP in the top three of the frameworks and as far as how much easier it makes your life it's it's really worth it um and you know you can get down to caching at the end and whatever you need to do but Mozilla's using it on their add-on site they've got a 12 machine cluster they were actually uh they upgraded from cake 1.1.1 to cake 1.1.1 and I think they were able to even take out a couple machines from their cluster so they were pretty happy about that uh we're getting faster well I think if you if you were here for the beginning of the talk uh it's pretty clear why you'd want to use cake versus the question was why would you want to use cake instead of symphony or Zend and for me it was really simple when I was choosing a framework I wanted something that worked out of the box without having to dive into the command line without having to do a ton of setup without having to do anything I want to build applications I want to do this I want in three minutes or ten minutes I want to be able to put together an app I don't want to sit there spending a whole ton of time trying to set something up because I know that when I go to deploy it the same thing is going to happen and I'm going to go through the same headaches to deploy something and you have to remember as a developer that your job doesn't end when your application is when you're done building your application your your job continues on in the deployment process when that application goes public and anything that's involved in that you have to remember that that's going to happen so that's why I choose it hopefully that answers your question yeah you're right the question in case anyone in the back didn't hear him was a templating language and by default no cake doesn't include a templating language PHP is a templating language in a lot of ways and if you saw I don't know if you I could show you quickly but if you use you can use with a colon kind of feels like a template you know I mean there's there's ways around it and so we don't see the need for a template we want to keep things fast but there has been a smarty view created so if you want to use smarty templates or if you want to use I think there's a PHP tile template view as well now so you can just create your view extend the core view and use whatever template you want yeah middle what is this a beat down on share it today or something I mean it depends on the shared host I don't know I mean shared hosts they've got their own configurations it's hard to cover every single scenario but I would say that more often than not it's either a misconfiguration there or you know I don't know what the exact problem is you can ask me afterwards and maybe I can help you figure it out but I've installed it on four or five shared hosts without any difficulties and I haven't really heard of too many problems with it with shared hosts the only thing is usually the ht access you know mod rewrite stuff but other than that usually not a problem anything else alright cool well thanks guys for coming