[symfony-users] Re: in my error logs: "Action "uploads/assets" does not exist. "
On Mar 21, 1:49 am, Eno wrote: > On Fri, 20 Mar 2009, Lawrence Krubner wrote: > > I've got the sfMediaLibraryPlugin installed, and it uploads files to > > uploads/assets, but I don't see how that can be an issue. I've haven't > > been using or testing the plugin, yet these errors appear. > > How do you know that noone else is calling that action? Script kiddies > attack web servers all the time, so check your web server access and error > logs. That is my error log . That is where I'm seeing it, is in my error log. I'm wondering why it is there. This is a dev site. Unless the client was up late tonight and decided to poke at the site, I'm the only who is poking at it. But let's assume, for a moment, that the client is up late and poking at the site. How do I find where in the code that non-existent action was called? I need to find that and fix it. But I don't know how to find it. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] how do I update 23 records with one query? That is, all the players on a particular team?
When I look in Chapter 8 of the book, I realize that Criteria seems to be mostly about building SELECT statements: http://www.symfony-project.org/book/1_1/08-Inside-the-Model-Layer When I look to see how I should update a record, I find a lot of information about updating a particular record, which I already know how to do. But how do I update many records? I want this SQL: UPDATE player SET mufson_award_winner='' WHERE new_team_id='712' How do I get that? Right now, this is the code I have. I can not figure out how to replace the "magic" part. // 03-20-09 - normally, one player per team wins the Mufson award. Sometimes, when there // are syblings on a team, they will give the award to both syblings. Here we are getting // an array of ids of the players who've won the Mufson Award. We must update the // mufson_award_winner field in the player database table $arrayWhoWonTheMufsonAward = $request->getParameter ('whoWonTheMufsonAward'); if (isset($arrayWhoWonTheMufsonAward)) { if (is_array($arrayWhoWonTheMufsonAward)) { // First, we must ensure that none of the players are marked as winners of the // the Mufson award. We will blank anyone currently chosen as a winner. Then // we will assign the winner. $c = new Criteria(); $c->add(NewPlayerPeer::NEW_TEAM_ID, $request->getParameter ('id')); [now something magic happens and all the players on the team have their mufson_award_winner field blanked] for ($i=0; $i < count($arrayWhoWonTheMufsonAward); $i++) { $playerId = $arrayWhoWonTheMufsonAward[$i]; $playerModelClass = new NewPlayer(); $playerModelClass->setNew(false); $playerModelClass->setId($playerId); $playerModelClass->setMufsonAwardWinner("1"); $playerModelClass->save(); } } } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Pake V's Phing?
On Mar 13, 8:34 am, Lee Bolding wrote: > FWIW, I chose Phing. > > Seems pretty cool - just trying to work out how to make a wrapper so I > can deploy my application like so : > > ./deploy.sh --target=[dev|test|stage|prod] --tag= > Lee, can you tell us why you chose Phing? What steered you away from pake? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: how do I update 23 records with one query? That is, all the players on a particular team?
This might be what you're after: http://snippets.symfony-project.org/snippet/50 On Sat, Mar 21, 2009 at 9:16 PM, Lawrence Krubner wrote: > > > When I look in Chapter 8 of the book, I realize that Criteria seems to > be mostly about building SELECT statements: > > http://www.symfony-project.org/book/1_1/08-Inside-the-Model-Layer > > When I look to see how I should update a record, I find a lot of > information about updating a particular record, which I already know > how to do. But how do I update many records? I want this SQL: > > UPDATE player SET mufson_award_winner='' WHERE new_team_id='712' > > How do I get that? > > Right now, this is the code I have. I can not figure out how to > replace the "magic" part. > > > // 03-20-09 - normally, one player per team wins the Mufson award. > Sometimes, when there > // are syblings on a team, they will give the award to both > syblings. Here we are getting > // an array of ids of the players who've won the Mufson Award. We > must update the > // mufson_award_winner field in the player database table > $arrayWhoWonTheMufsonAward = $request->getParameter > ('whoWonTheMufsonAward'); > if (isset($arrayWhoWonTheMufsonAward)) { > if (is_array($arrayWhoWonTheMufsonAward)) { > // First, we must ensure that none of the players are marked > as winners of the > // the Mufson award. We will blank anyone currently chosen as > a winner. Then > // we will assign the winner. > $c = new Criteria(); > $c->add(NewPlayerPeer::NEW_TEAM_ID, $request->getParameter > ('id')); > > [now something magic happens and all the players on the team > have their mufson_award_winner field blanked] > > for ($i=0; $i < count($arrayWhoWonTheMufsonAward); $i++) { > $playerId = $arrayWhoWonTheMufsonAward[$i]; > $playerModelClass = new NewPlayer(); > $playerModelClass->setNew(false); > $playerModelClass->setId($playerId); > $playerModelClass->setMufsonAwardWinner("1"); > $playerModelClass->save(); > } > } > } > > > -- Blue Horn Ltd - System Development http://bluehorn.co.nz --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: in my error logs: "Action "uploads/assets" does not exist. "
On 21 Mar 2009, at 04:36, Lawrence Krubner wrote: > > As far as I know, I never call an action called "uploads/assets". Yet > I'm getting this in my error logs: > > [21-Mar-2009 00:21:10] Action "uploads/assets" does not exist. > >> > content/templates/showTeamSuccess.php: src="/bocahoops/web/ > uploads/assets//> getTeamnumber() ?>.jpg" alt="getTeamname() ? >> >" / >> > > How can I find out what code is calling this action? Looks like you've specified a bad path, and the routing thinks it's a routable URL. Remember, if the actual file/directory does not exist, the URL will be passed to Symfony It should read : /getTeamnumber() ?>.jpg" alt="" /> --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Pake V's Phing?
Phing isn't so tightly coupled to Symfony. The project I'm using it on is in the process of adopting a framework, but it hasn't yet been decided which one. I'm sure you can use Pake outside of Symfony, but investigating that would have taken time, and I already knew Phing would work with any framework (or lack thereof). Also, Phing had better documentation, because it's based on Ant, it follows a lot of the same conventions. Overall, I'm pretty pleased with the deploy procedure we've got now... On the server I'm deploying to, I check out the build script from SVN, then just run : phing A Phing InputTask prompts for the tag that I want to deploy and the rest is done automatically, including database changes etc. Pretty smooth :) On 21 Mar 2009, at 08:17, Lawrence Krubner wrote: > > > > On Mar 13, 8:34 am, Lee Bolding wrote: >> FWIW, I chose Phing. >> >> Seems pretty cool - just trying to work out how to make a wrapper >> so I >> can deploy my application like so : >> >> ./deploy.sh --target=[dev|test|stage|prod] --tag= >> > > > Lee, can you tell us why you chose Phing? What steered you away from > pake? > > > > > > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] new sfDoctrinePager() 1. argument
I have something like that - it is my first pager: $this->pager = new sfDoctrinePager('?', 1); $this->pager->setQuery( Doctrine_Query::create() ->select('s1.*, s2.username as username') ->from('SfGuardUserProfile s1') ->innerJoin('s1.SfGuardUser s2') ->innerJoin('s2.Friends z ON s2.id=z.id_friend') ->where('z.id_user = ?', $id)); $this->pager->setPage($request->getParameter('page', 1)); $this->pager->init(); What should I write as 1. argument in new sfDoctrinePager() in that case ??? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: how do I update 23 records with one query? That is, all the players on a particular team?
What you need is BasePeer::doUpdate($selectCriteria, $updateCriteria, $con) See http://snippets.symfony-project.org/snippet/50 On Sat, Mar 21, 2009 at 09:16, Lawrence Krubner wrote: > > > When I look in Chapter 8 of the book, I realize that Criteria seems to > be mostly about building SELECT statements: > > http://www.symfony-project.org/book/1_1/08-Inside-the-Model-Layer > > When I look to see how I should update a record, I find a lot of > information about updating a particular record, which I already know > how to do. But how do I update many records? I want this SQL: > > UPDATE player SET mufson_award_winner='' WHERE new_team_id='712' > > How do I get that? > > Right now, this is the code I have. I can not figure out how to > replace the "magic" part. > > > // 03-20-09 - normally, one player per team wins the Mufson award. > Sometimes, when there > // are syblings on a team, they will give the award to both > syblings. Here we are getting > // an array of ids of the players who've won the Mufson Award. We > must update the > // mufson_award_winner field in the player database table > $arrayWhoWonTheMufsonAward = $request->getParameter > ('whoWonTheMufsonAward'); > if (isset($arrayWhoWonTheMufsonAward)) { > if (is_array($arrayWhoWonTheMufsonAward)) { > // First, we must ensure that none of the players are marked > as winners of the > // the Mufson award. We will blank anyone currently chosen as > a winner. Then > // we will assign the winner. > $c = new Criteria(); > $c->add(NewPlayerPeer::NEW_TEAM_ID, $request->getParameter > ('id')); > > [now something magic happens and all the players on the team > have their mufson_award_winner field blanked] > > for ($i=0; $i < count($arrayWhoWonTheMufsonAward); $i++) { > $playerId = $arrayWhoWonTheMufsonAward[$i]; > $playerModelClass = new NewPlayer(); > $playerModelClass->setNew(false); > $playerModelClass->setId($playerId); > $playerModelClass->setMufsonAwardWinner("1"); > $playerModelClass->save(); > } > } > } > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: How to access sfWebRequest object from the model
Or... $_SERVER['REMOTE_ADDR'] It may look "dirty", but your models won't be coupled to Symfony ;) It should be marginally more efficient too - after all, at the end of the day that's exactly how Symfony is gonna get that information back to you. On 21 Mar 2009, at 09:29, michael.pie...@googlemail.com wrote: > > sfContext::getInstance()->getRequest() > > Michael > > > On 21 Mrz., 03:00, Benjamin wrote: >> Hello, >> >> In my user model I would like to capture the user's ip address for >> new >> records in the user->save() event. I am using symfony 1.2. What is >> the best way to access the sfWebRequest object from within the model? >> >> Thank you, >> Benjamin > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: How to access sfWebRequest object from the model
I would do neither! The is the model. It knows about its data, but id does not know where to get it from. It should not. No models should read data from outside themselves. It might be finde to do recalculation of own data, but where should it get the information from? This is exactly the problem you have. The eas solution: let it set somewhere .. e.g. in the action. Fabian On Sat, Mar 21, 2009 at 10:42 AM, Lee Bolding wrote: > > Or... $_SERVER['REMOTE_ADDR'] > > It may look "dirty", but your models won't be coupled to Symfony ;) > > It should be marginally more efficient too - after all, at the end of > the day that's exactly how Symfony is gonna get that information back > to you. > > On 21 Mar 2009, at 09:29, michael.pie...@googlemail.com wrote: > > > > > sfContext::getInstance()->getRequest() > > > > Michael > > > > > > On 21 Mrz., 03:00, Benjamin wrote: > >> Hello, > >> > >> In my user model I would like to capture the user's ip address for > >> new > >> records in the user->save() event. I am using symfony 1.2. What is > >> the best way to access the sfWebRequest object from within the model? > >> > >> Thank you, > >> Benjamin > > > > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: How to access sfWebRequest object from the model
Yep, coupling model with outside data is really, really bad idea. Let's look at Lee's example of using plain $_SERVER array. It works. It works almost everywhere... ALMOST. 1. What if U will decide to move models to another project with another framework? What if that framework import all outside data and cleans e.g. $_SERVER? 2. What if you'll decide to deploy current project on another platform like Quercus (Javas PHP implementation) where existence of $_SERVER, $_GET, $_POST is not rock solid. Remember, always supply outside data to model, model shouldn't do that. Cheers, Alan On Sat, Mar 21, 2009 at 11:16 AM, Fabian Lange < fabian.la...@symfony-project.com> wrote: > I would do neither! > The is the model. It knows about its data, but id does not know where to > get it from. It should not. No models should read data from outside > themselves. It might be finde to do recalculation of own data, but where > should it get the information from? This is exactly the problem you have. > The eas solution: let it set somewhere .. e.g. in the action. > > Fabian > > > On Sat, Mar 21, 2009 at 10:42 AM, Lee Bolding wrote: > >> >> Or... $_SERVER['REMOTE_ADDR'] >> >> It may look "dirty", but your models won't be coupled to Symfony ;) >> >> It should be marginally more efficient too - after all, at the end of >> the day that's exactly how Symfony is gonna get that information back >> to you. >> >> On 21 Mar 2009, at 09:29, michael.pie...@googlemail.com wrote: >> >> > >> > sfContext::getInstance()->getRequest() >> > >> > Michael >> > >> > >> > On 21 Mrz., 03:00, Benjamin wrote: >> >> Hello, >> >> >> >> In my user model I would like to capture the user's ip address for >> >> new >> >> records in the user->save() event. I am using symfony 1.2. What is >> >> the best way to access the sfWebRequest object from within the model? >> >> >> >> Thank you, >> >> Benjamin >> > > >> >> >> >> > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: How to access sfWebRequest object from the model
sfContext::getInstance()->getRequest() Michael On 21 Mrz., 03:00, Benjamin wrote: > Hello, > > In my user model I would like to capture the user's ip address for new > records in the user->save() event. I am using symfony 1.2. What is > the best way to access the sfWebRequest object from within the model? > > Thank you, > Benjamin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: How to access sfWebRequest object from the model
On Sat, Mar 21, 2009 at 12:05 PM, Lee Bolding wrote: > > is it even possible to overwrite $_SERVER['REMOTE_ADDR']? I'll try it > later on. Of course - its a variable. I don't think ANYBODY would ever use a framework that did that - if > they did, they'd have far bigger problems than this ;) > > As for Quercus, it's not stable - again, you've got far bigger > problems than just $_SERVER being a bit flakey. > > The ONLY place where $_SERVER may be an issue is where you're not > using a CGI environment (eg CLI). I 100% agree - what I wanted to show are numerous of posibilities when coupling model with outside data can fail. I think I achieve that anyway :) As for get/set - yes - POSSIBLY. > > However, in this instance - we're talking about an IP address, which > is presumably being recorded for security/auditing purposes, which > changes the game slightly. Assuming this is the case, our concern is > that it gets set, it get's set securely, can't be tampered with, and > happens automatically (we don't want a developer to "forget" or decide > they don't want to implement it). This argument is really only valid > when you're talking about security and/or auditing. The rest of the > time, I'd recommend using getters/setters. If you ask me, that "auditing" is not responsibility of model as well. Allowing IP address property to be "set" introduces an attack vector > and also extra code that could fail or introduce further security flaws. > > My advice would be to make IP address a private variable, create a > getter method (no setter), and set the value inside the constructor to > the object. This makes it much more secure, and easier to use - > setting the IP address doesn't then become an "option" and the > responsibility of the developer, it's mandatory, and done > automatically, with a valid value every time a new object is created. > You can also dispense with logic to handle when this value hasn't been > set, validation of the value that's been set etc > > Alternatively, you could probably use a Doctrine behaviour to achieve > the same. > > > On 21 Mar 2009, at 10:32, Alan Bem wrote: > > > Yep, coupling model with outside data is really, really bad idea. > > Let's look at Lee's example of using plain $_SERVER array. It works. > > It works almost everywhere... ALMOST. > > 1. What if U will decide to move models to another project with > > another framework? What if that framework import all outside data > > and cleans e.g. $_SERVER? > > 2. What if you'll decide to deploy current project on another > > platform like Quercus (Javas PHP implementation) where existence of > > $_SERVER, $_GET, $_POST is not rock solid. > > > > Remember, always supply outside data to model, model shouldn't do > > that. > > > > Cheers, Alan > > > > On Sat, Mar 21, 2009 at 11:16 AM, Fabian Lange < > fabian.la...@symfony-project.com > > > wrote: > > I would do neither! > > The is the model. It knows about its data, but id does not know > > where to get it from. It should not. No models should read data from > > outside themselves. It might be finde to do recalculation of own > > data, but where should it get the information from? This is exactly > > the problem you have. The eas solution: let it set somewhere .. e.g. > > in the action. > > > > Fabian > > > > > > On Sat, Mar 21, 2009 at 10:42 AM, Lee Bolding > > wrote: > > > > Or... $_SERVER['REMOTE_ADDR'] > > > > It may look "dirty", but your models won't be coupled to Symfony ;) > > > > It should be marginally more efficient too - after all, at the end of > > the day that's exactly how Symfony is gonna get that information back > > to you. > > > > On 21 Mar 2009, at 09:29, michael.pie...@googlemail.com wrote: > > > > > > > > sfContext::getInstance()->getRequest() > > > > > > Michael > > > > > > > > > On 21 Mrz., 03:00, Benjamin wrote: > > >> Hello, > > >> > > >> In my user model I would like to capture the user's ip address for > > >> new > > >> records in the user->save() event. I am using symfony 1.2. What > > is > > >> the best way to access the sfWebRequest object from within the > > model? > > >> > > >> Thank you, > > >> Benjamin > > > > > > > > > > > > > > > > > > > > > > > > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: How to access sfWebRequest object from the model
is it even possible to overwrite $_SERVER['REMOTE_ADDR']? I'll try it later on. I don't think ANYBODY would ever use a framework that did that - if they did, they'd have far bigger problems than this ;) As for Quercus, it's not stable - again, you've got far bigger problems than just $_SERVER being a bit flakey. The ONLY place where $_SERVER may be an issue is where you're not using a CGI environment (eg CLI). As for get/set - yes - POSSIBLY. However, in this instance - we're talking about an IP address, which is presumably being recorded for security/auditing purposes, which changes the game slightly. Assuming this is the case, our concern is that it gets set, it get's set securely, can't be tampered with, and happens automatically (we don't want a developer to "forget" or decide they don't want to implement it). This argument is really only valid when you're talking about security and/or auditing. The rest of the time, I'd recommend using getters/setters. Allowing IP address property to be "set" introduces an attack vector and also extra code that could fail or introduce further security flaws. My advice would be to make IP address a private variable, create a getter method (no setter), and set the value inside the constructor to the object. This makes it much more secure, and easier to use - setting the IP address doesn't then become an "option" and the responsibility of the developer, it's mandatory, and done automatically, with a valid value every time a new object is created. You can also dispense with logic to handle when this value hasn't been set, validation of the value that's been set etc Alternatively, you could probably use a Doctrine behaviour to achieve the same. On 21 Mar 2009, at 10:32, Alan Bem wrote: > Yep, coupling model with outside data is really, really bad idea. > Let's look at Lee's example of using plain $_SERVER array. It works. > It works almost everywhere... ALMOST. > 1. What if U will decide to move models to another project with > another framework? What if that framework import all outside data > and cleans e.g. $_SERVER? > 2. What if you'll decide to deploy current project on another > platform like Quercus (Javas PHP implementation) where existence of > $_SERVER, $_GET, $_POST is not rock solid. > > Remember, always supply outside data to model, model shouldn't do > that. > > Cheers, Alan > > On Sat, Mar 21, 2009 at 11:16 AM, Fabian Lange > > wrote: > I would do neither! > The is the model. It knows about its data, but id does not know > where to get it from. It should not. No models should read data from > outside themselves. It might be finde to do recalculation of own > data, but where should it get the information from? This is exactly > the problem you have. The eas solution: let it set somewhere .. e.g. > in the action. > > Fabian > > > On Sat, Mar 21, 2009 at 10:42 AM, Lee Bolding > wrote: > > Or... $_SERVER['REMOTE_ADDR'] > > It may look "dirty", but your models won't be coupled to Symfony ;) > > It should be marginally more efficient too - after all, at the end of > the day that's exactly how Symfony is gonna get that information back > to you. > > On 21 Mar 2009, at 09:29, michael.pie...@googlemail.com wrote: > > > > > sfContext::getInstance()->getRequest() > > > > Michael > > > > > > On 21 Mrz., 03:00, Benjamin wrote: > >> Hello, > >> > >> In my user model I would like to capture the user's ip address for > >> new > >> records in the user->save() event. I am using symfony 1.2. What > is > >> the best way to access the sfWebRequest object from within the > model? > >> > >> Thank you, > >> Benjamin > > > > > > > > > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: How to access sfWebRequest object from the model
Some more ideas.. some from the more practical side: when you put it into save(): - what happens when you run a script to update the records which invokes save()? - what happens if an admin edits and save()s? - what happens if a save() is triggered by a second save() on a related object (have a look on how propel internally handles FK relations)? - what happens when the save trigger is not invoked by the IP-owner? Without an example this might be hard to get. Assume you have a warehouse and affiliates can sell stuff from it using their brand. Now you create a webservice on top of your own online shop, so that affiliates can do B2B Webserive calls to place orders of their customer. Even in your IP case you might want store the IP of the real customer, not of the other online shop server which is performing the webservice call. Also, as indicated already, the place to obtain the IP from might be different in various scenarios. Or lets say you want to postprocess the IP, lets say for legal reasons add an extra mapping inbetween etc. Model objects (class instances) should always deal only with owned data, that is only with member variables (attributes) [Note: that can be also other model objects, those it has relations to and can navigate to] The advantage of this is that those objects can be reused everywhere, even if that might not be applicable for you at the moment. So in summary: of course you can, but there are so many reasons why it would be better not to do it. And of course its fine to discuss different options; cause this is a very good way to learn good design patterns. Fabian On Sat, Mar 21, 2009 at 12:40 PM, Alan Bem wrote: > On Sat, Mar 21, 2009 at 12:05 PM, Lee Bolding wrote: > >> >> is it even possible to overwrite $_SERVER['REMOTE_ADDR']? I'll try it >> later on. > > > Of course - its a variable. > > I don't think ANYBODY would ever use a framework that did that - if >> they did, they'd have far bigger problems than this ;) >> >> As for Quercus, it's not stable - again, you've got far bigger >> problems than just $_SERVER being a bit flakey. >> >> The ONLY place where $_SERVER may be an issue is where you're not >> using a CGI environment (eg CLI). > > > I 100% agree - what I wanted to show are numerous of posibilities when > coupling model with outside data can fail. > I think I achieve that anyway :) > > As for get/set - yes - POSSIBLY. >> >> However, in this instance - we're talking about an IP address, which >> is presumably being recorded for security/auditing purposes, which >> changes the game slightly. Assuming this is the case, our concern is >> that it gets set, it get's set securely, can't be tampered with, and >> happens automatically (we don't want a developer to "forget" or decide >> they don't want to implement it). This argument is really only valid >> when you're talking about security and/or auditing. The rest of the >> time, I'd recommend using getters/setters. > > > If you ask me, that "auditing" is not responsibility of model as well. > > Allowing IP address property to be "set" introduces an attack vector >> and also extra code that could fail or introduce further security flaws. >> >> My advice would be to make IP address a private variable, create a >> getter method (no setter), and set the value inside the constructor to >> the object. This makes it much more secure, and easier to use - >> setting the IP address doesn't then become an "option" and the >> responsibility of the developer, it's mandatory, and done >> automatically, with a valid value every time a new object is created. >> You can also dispense with logic to handle when this value hasn't been >> set, validation of the value that's been set etc >> >> Alternatively, you could probably use a Doctrine behaviour to achieve >> the same. >> >> >> On 21 Mar 2009, at 10:32, Alan Bem wrote: >> >> > Yep, coupling model with outside data is really, really bad idea. >> > Let's look at Lee's example of using plain $_SERVER array. It works. >> > It works almost everywhere... ALMOST. >> > 1. What if U will decide to move models to another project with >> > another framework? What if that framework import all outside data >> > and cleans e.g. $_SERVER? >> > 2. What if you'll decide to deploy current project on another >> > platform like Quercus (Javas PHP implementation) where existence of >> > $_SERVER, $_GET, $_POST is not rock solid. >> > >> > Remember, always supply outside data to model, model shouldn't do >> > that. >> > >> > Cheers, Alan >> > >> > On Sat, Mar 21, 2009 at 11:16 AM, Fabian Lange < >> fabian.la...@symfony-project.com >> > > wrote: >> > I would do neither! >> > The is the model. It knows about its data, but id does not know >> > where to get it from. It should not. No models should read data from >> > outside themselves. It might be finde to do recalculation of own >> > data, but where should it get the information from? This is exactly >> > the problem you have. The eas solution: let it se
[symfony-users] sfSympal Questions
Hello, I just read and check out the sympal plugin on a existing symfony project. (Fixtures failed to load : Invalid row key specified: EntityType_Page ). So I just stop trying to install the plugin and check what have been done so far. - sfSympal contains sfSympal*Plugin, but also sfFormExtraPlugin and sfDoctrineGuardPlugin. Does that means sympal sympal must be the only main plugin in the project ? Why these 2 last plugin should not be installed in the main plugin repository ? - Generated models do not have a sympal prefix, so class names clash will occur with some project. How many projects have a Page class ? - Same thing with the table name, they should be prefixed with "sympal_*". I have not look deeper in the code, but from the documentation point of view there is no way to include actions from another modules into sympal. The demo page looks very nice ! -- Thomas Rabaix http://rabaix.net --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: How to include partials from another module in the Admin Generator
thank you that's what i did (override) On 8 mar, 12:34, naholyr wrote: > You could try to add "_module/partial" in the display list. > If this doesn't work (I didn't try), then yes you'll have to edit a > template to add the call to include_partial. > Note that you can overwrite _edit_header.php or _list_header.php, > which are meant to be overwritten for your needs as they're empty by > default. > > On 8 mar, 11:54, Dheeraj Kumar Aggarwal > wrote: > > > Hi > > > u can directly include partial from another module like this > > > e.g. Module Name: Hello > > partial name: message > > > then include_partial("Hello/message",array(any arguments)); > > > On Sun, Mar 8, 2009 at 2:46 PM,ssaboum wrote: > > > > Hi, > > > i wanted to know how to include partials from another module, > > > i perfectly understand how to do it when the partial is in the module > > > of the admin gen, > > > but as the command include_partial can take a module into account, how > > > can we do that with Admin Generator (generator.yml file) ? > > > > Should i change the editSuccess generated file ? > > > > Thank you > > > -- > > Regards, > > Dheeraj --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Symfony 1.2 uses more memory than symfony 1.1 ?
Hi, I was trying to improve the performace of my symfony projects and we made a lot of tests. We use same projects with symfony 1.1 and symfony 1.12. Symfony 1.1.7 uses less memory. Do anybody know why this happens and if there is anything i could do to improve the performance. Symfony 1.1.7 Memory 4686.9 KB Symfony 1.2.4 # 1.2.4 # Memory 12201.6 KB Symfony 1.2 uses aprox. 3x more! The tests was made on the same servers. Sorry for my bad english. Thanks, Edgard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: How to access sfWebRequest object from the model
On 21 Mar 2009, at 11:40, Alan Bem wrote: > On Sat, Mar 21, 2009 at 12:05 PM, Lee Bolding > wrote: > > is it even possible to overwrite $_SERVER['REMOTE_ADDR']? I'll try it > later on. > > Of course - its a variable. Yup, I tested it - you can. I never thought of that before. I always assumed (hoped?) the Zend Engine would somehow make environment variables read-only. > If you ask me, that "auditing" is not responsibility of model as well. There was a bunch of debates about this very subject years ago when the Spring framework was still very young. There's two schools of thought - one that says auditing should be flexible, and applied by - ideally - a (cross-cutting) aspect. The other that believes an aspect isn't secure, and the DAO layer should be secured/self auditing. Usually, this is achieved by having the models you want audited extend an auditable class or implement an auditable interface. There's some good disucssions about these issues : http://forum.springsource.org/showthread.php?p=229757 http://cagataycivici.wordpress.com/2006/07/03/aspect_oriented_audit_logging_with/ Ofcourse, you also need to decide what exactly it is that you are auditing - who changed what, when? from what, to what? what URL and params did they use? what roles and permissions were in effect when they did? are you auditing CHANGE of data, ACCESS to data or both? etc To be honest, I haven't looked too closely into "proper" auditing with Symfony. But as you can see from the conversation so far, it's a pretty deep subject with a lot to consider - it's not just about saving the users IP address in a table ;) I know Doctrine has some auditing capabilities, so could be worth checking those out - but obviously that falls into the second school of thought, not the first. "proper" auditing is probably a plugin that could do with being created... which could dovetail quite nicely with a chain-of-custody plugin. If there were more hours in the day... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: How to access sfWebRequest object from the model
On Sat, Mar 21, 2009 at 4:51 PM, Lee Bolding wrote: > > Yup, I tested it - you can. I never thought of that before. I always > assumed (hoped?) the Zend Engine would somehow make environment > variables read-only. > Let me quote a line from great movie "A Knight's Tale": "*(...) Pain*, *lots of pain"* :) > There was a bunch of debates about this very subject years ago when > the Spring framework was still very young. > > There's two schools of thought - one that says auditing should be > flexible, and applied by - ideally - a (cross-cutting) aspect. > > The other that believes an aspect isn't secure, and the DAO layer > should be secured/self auditing. Usually, this is achieved by having > the models you want audited extend an auditable class or implement an > auditable interface. I don't have Java background, but IMHO AOP as a concept is too abstract (I'm not talking about simple things of course :D); its too detached from language itself which makes it error prone. Yeah, my choice would be some kind of Auditable interface... But yet, my point was that audit should be delegate somehow. Both schools are compliant with that. > There's some good disucssions about these issues : > > http://forum.springsource.org/showthread.php?p=229757 > > http://cagataycivici.wordpress.com/2006/07/03/aspect_oriented_audit_logging_with/ > Thanks for the links. Great reading. Cheers, Alan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: sfSympal Questions
On Sat, Mar 21, 2009 at 9:45 AM, Thomas Rabaix wrote: > Hello, > > I just read and check out the sympal plugin on a existing symfony project. > (Fixtures failed to load : Invalid row key specified: EntityType_Page ). > I believe this is a bug in the symfony version you are using. I fixed a bug in symfony that is only in the latest 1.2 branch of svn. If I use the latest svn you should not get this error. > > So I just stop trying to install the plugin and check what have been done > so far. > > >- sfSympal contains sfSympal*Plugin, but also sfFormExtraPlugin and >sfDoctrineGuardPlugin. Does that means sympal sympal must be the only main >plugin in the project ? Why these 2 last plugin should not be installed in >the main plugin repository ? > > I make the plugin come with these two plugins so that things work out of the box. > >- >- Generated models do not have a sympal prefix, so class names clash >will occur with some project. How many projects have a Page class ? > > >- Same thing with the table name, they should be prefixed with >"sympal_*". > > This is something that needs to be fixed I suppose. > I have not look deeper in the code, but from the documentation point of > view there is no way to include actions from another modules into sympal. This is very possible. You accomplish this several ways. You can include partials/components in to your sympal content. You can link menu items to your own custom routes, etc. > > > The demo page looks very nice ! > > -- > Thomas Rabaix > http://rabaix.net > > > > -- Jonathan H. Wage Open Source Software Developer & Evangelist http://www.jwage.com http://www.doctrine-project.org http://www.symfony-project.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: sfSympal Questions
On Sat, Mar 21, 2009 at 11:44 AM, Jonathan Wage wrote: > > > On Sat, Mar 21, 2009 at 9:45 AM, Thomas Rabaix wrote: > >> Hello, >> >> I just read and check out the sympal plugin on a existing symfony project. >> (Fixtures failed to load : Invalid row key specified: EntityType_Page ). >> > > I believe this is a bug in the symfony version you are using. I fixed a bug > in symfony that is only in the latest 1.2 branch of svn. If I use the latest > svn you should not get this error. > I also just fixed something in sfSympalPlugin that might have been the cause of this. Can you try now? > > > >> >> So I just stop trying to install the plugin and check what have been done >> so far. >> >> >>- sfSympal contains sfSympal*Plugin, but also sfFormExtraPlugin and >>sfDoctrineGuardPlugin. Does that means sympal sympal must be the only main >>plugin in the project ? Why these 2 last plugin should not be installed in >>the main plugin repository ? >> >> I make the plugin come with these two plugins so that things work out of > the box. > >> >>- >>- Generated models do not have a sympal prefix, so class names clash >>will occur with some project. How many projects have a Page class ? >> >> >>- Same thing with the table name, they should be prefixed with >>"sympal_*". >> >> This is something that needs to be fixed I suppose. > > >> I have not look deeper in the code, but from the documentation point of >> view there is no way to include actions from another modules into sympal. > > > This is very possible. You accomplish this several ways. You can include > partials/components in to your sympal content. You can link menu items to > your own custom routes, etc. > >> >> >> The demo page looks very nice ! >> >> -- >> Thomas Rabaix >> http://rabaix.net >> >> >> >> > > > -- > Jonathan H. Wage > Open Source Software Developer & Evangelist > http://www.jwage.com > http://www.doctrine-project.org > http://www.symfony-project.org > -- Jonathan H. Wage Open Source Software Developer & Evangelist http://www.jwage.com http://www.doctrine-project.org http://www.symfony-project.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
Re: Re : [symfony-users] sfGuardExtraPlugin
On Mar 20, 7:18 pm, ckemmler wrote: > Thanks! > > Did that. > > I have two problems now > > 1. the README there tells me: > > * Add method `retrieveByUsernameOrEmailAddress` to get a user by > email or username in lib/model/sfGuardPlugin/sfGuardUserPeer.class > e.q. > > [PHP] > static public function retrieveByUsernameOrEmailAddress > ($usernameOrEmail, $isActive = true ) > { > $c = new Criteria(); > $c->add(self::USERNAME, $usernameOrEmail); > $c->add(self::EMAIL, $usernameOrEmail); > $c->add(self::IS_ACTIVE, $isActive); > > return self::doSelectOne($c); > } > > but I don't have a lib/model/sfGuardPlugin/sfGuardUserPeer.class > > What am I supposed to do then? Do you have /plugins/lib/models/sfGuardPlugins/sfGuardUserPeer.class? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
Re: Re : [symfony-users] sfGuardExtraPlugin
On Mar 20, 7:57 pm, ckemmler wrote: > This might be more interesting: I just tried to trigger the register > action by going to: > > http://localhost/web/frontend_dev.php/sfGuardRegister/register > > This got me: > > Fatal error: Class 'sfGuardFormRegister' not found in /eclipse/ > workspace/twittbook/plugins/sfGuardExtraPlugin/modules/sfGuardRegister/ > lib/BasesfGuardRegisterActions.class.php on line 26 > > which seems to indicate that the action is indeed recognized and > executed, but it can't find a class that's defined in the modules lib > directory: sfGuardFormRegister Did you enable the plugin in your apps settings.yml file? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] How can we use the getdefinitionkey function with Doctrine ? How is the key setup ?
Hey, My schema was containing the following : email_address: type: string(255) notnull: true email: true When I do : if ($column->getDefinitionKey('email')) , it works. I want to be able to create other key like the email one above. I tried : city_name: type: string(255) notnull: true cityname: true But, when I do : symfony doctrine:build-model, I get : Invalid schema element named "cityname" at path "cities->columns- >city_name" I search the code to this if email was hardcoded, but it does not seem so. Can someone help me get it work ? Regards, Frédéric. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: How to access sfWebRequest object from the model
There have been lots of great comments here and I have read all of them. Fabian, I was going to deal with a majority of the issues you mentioned by testing if a record was new or not. Based on what everyone is saying though it was wrong for me to place this in the model. I'll tell you guys what I've got so far and you can tell me if things are in the right place. 1. When a password is saved, the setPassword method of the User model converts it into a hash. 2. I will set the ip using the action. The setIp method will convert it into an integer. I know there were some recommendations about creating a method to retrieve the IP from, but I can't figure out a good way to implement a system where the IP is pulled into the User model, rather than Pushed into it. 3. The action will send the user a registration email. I tried to put some of this stuff in the model, because I read in one of the symfony books or tutorials that if an action is over 10 lines it probably needs to be refactored. The action was getting pretty big doing all these things, even though it is indeed calling other classes to perform the work. Benjamin Fabian Lange wrote: > Some more ideas.. some from the more practical side: > > when you put it into save(): > - what happens when you run a script to update the records which invokes > save()? > - what happens if an admin edits and save()s? > - what happens if a save() is triggered by a second save() on a related > object (have a look on how propel internally handles FK relations)? > - what happens when the save trigger is not invoked by the IP-owner? > Without an example this might be hard to get. Assume you have a warehouse > and affiliates can sell stuff from it using their brand. Now you create a > webservice on top of your own online shop, so that affiliates can do B2B > Webserive calls to place orders of their customer. Even in your IP case you > might want store the IP of the real customer, not of the other online shop > server which is performing the webservice call. > > Also, as indicated already, the place to obtain the IP from might be > different in various scenarios. Or lets say you want to postprocess the IP, > lets say for legal reasons add an extra mapping inbetween etc. > > Model objects (class instances) should always deal only with owned data, > that is only with member variables (attributes) > [Note: that can be also other model objects, those it has relations to and > can navigate to] > The advantage of this is that those objects can be reused everywhere, even > if that might not be applicable for you at the moment. > > So in summary: of course you can, but there are so many reasons why it would > be better not to do it. And of course its fine to discuss different options; > cause this is a very good way to learn good design patterns. > > Fabian > > On Sat, Mar 21, 2009 at 12:40 PM, Alan Bem wrote: > > > On Sat, Mar 21, 2009 at 12:05 PM, Lee Bolding wrote: > > > >> > >> is it even possible to overwrite $_SERVER['REMOTE_ADDR']? I'll try it > >> later on. > > > > > > Of course - its a variable. > > > > I don't think ANYBODY would ever use a framework that did that - if > >> they did, they'd have far bigger problems than this ;) > >> > >> As for Quercus, it's not stable - again, you've got far bigger > >> problems than just $_SERVER being a bit flakey. > >> > >> The ONLY place where $_SERVER may be an issue is where you're not > >> using a CGI environment (eg CLI). > > > > > > I 100% agree - what I wanted to show are numerous of posibilities when > > coupling model with outside data can fail. > > I think I achieve that anyway :) > > > > As for get/set - yes - POSSIBLY. > >> > >> However, in this instance - we're talking about an IP address, which > >> is presumably being recorded for security/auditing purposes, which > >> changes the game slightly. Assuming this is the case, our concern is > >> that it gets set, it get's set securely, can't be tampered with, and > >> happens automatically (we don't want a developer to "forget" or decide > >> they don't want to implement it). This argument is really only valid > >> when you're talking about security and/or auditing. The rest of the > >> time, I'd recommend using getters/setters. > > > > > > If you ask me, that "auditing" is not responsibility of model as well. > > > > Allowing IP address property to be "set" introduces an attack vector > >> and also extra code that could fail or introduce further security flaws. > >> > >> My advice would be to make IP address a private variable, create a > >> getter method (no setter), and set the value inside the constructor to > >> the object. This makes it much more secure, and easier to use - > >> setting the IP address doesn't then become an "option" and the > >> responsibility of the developer, it's mandatory, and done > >> automatically, with a valid value every time a new object is created. > >> You can also dispense with logic to handle when this value hasn't been > >>
[symfony-users] Re: How to access sfWebRequest object from the model
On Sat, Mar 21, 2009 at 8:44 PM, Benjamin wrote: > 1. When a password is saved, the setPassword method of the User model > converts it into a hash. > 2. I will set the ip using the action. The setIp method will convert > it into an integer. I know there were some recommendations about > creating a method to retrieve the IP from, but I can't figure out a > good way to implement a system where the IP is pulled into the User > model, rather than Pushed into it. > 3. The action will send the user a registration email. It looks okay. > I tried to put some of this stuff in the model, because I read in one > of the symfony books or tutorials that if an action is over 10 lines > it probably needs to be refactored. The action was getting pretty big > doing all these things, even though it is indeed calling other classes > to perform the work Its called "Fat model, thin controller" but you should be careful with that. Its about reusability and design. The balance between those two is critical. There is one more thing hiding there - that ORM objects aren't necessary proper domain models. But its discussion for separate topic on this list. Benjamin > > Fabian Lange wrote: > > Some more ideas.. some from the more practical side: > > > > when you put it into save(): > > - what happens when you run a script to update the records which invokes > > save()? > > - what happens if an admin edits and save()s? > > - what happens if a save() is triggered by a second save() on a related > > object (have a look on how propel internally handles FK relations)? > > - what happens when the save trigger is not invoked by the IP-owner? > > Without an example this might be hard to get. Assume you have a warehouse > > and affiliates can sell stuff from it using their brand. Now you create a > > webservice on top of your own online shop, so that affiliates can do B2B > > Webserive calls to place orders of their customer. Even in your IP case > you > > might want store the IP of the real customer, not of the other online > shop > > server which is performing the webservice call. > > > > Also, as indicated already, the place to obtain the IP from might be > > different in various scenarios. Or lets say you want to postprocess the > IP, > > lets say for legal reasons add an extra mapping inbetween etc. > > > > Model objects (class instances) should always deal only with owned data, > > that is only with member variables (attributes) > > [Note: that can be also other model objects, those it has relations to > and > > can navigate to] > > The advantage of this is that those objects can be reused everywhere, > even > > if that might not be applicable for you at the moment. > > > > So in summary: of course you can, but there are so many reasons why it > would > > be better not to do it. And of course its fine to discuss different > options; > > cause this is a very good way to learn good design patterns. > > > > Fabian > > > > On Sat, Mar 21, 2009 at 12:40 PM, Alan Bem wrote: > > > > > On Sat, Mar 21, 2009 at 12:05 PM, Lee Bolding > wrote: > > > > > >> > > >> is it even possible to overwrite $_SERVER['REMOTE_ADDR']? I'll try it > > >> later on. > > > > > > > > > Of course - its a variable. > > > > > > I don't think ANYBODY would ever use a framework that did that - if > > >> they did, they'd have far bigger problems than this ;) > > >> > > >> As for Quercus, it's not stable - again, you've got far bigger > > >> problems than just $_SERVER being a bit flakey. > > >> > > >> The ONLY place where $_SERVER may be an issue is where you're not > > >> using a CGI environment (eg CLI). > > > > > > > > > I 100% agree - what I wanted to show are numerous of posibilities when > > > coupling model with outside data can fail. > > > I think I achieve that anyway :) > > > > > > As for get/set - yes - POSSIBLY. > > >> > > >> However, in this instance - we're talking about an IP address, which > > >> is presumably being recorded for security/auditing purposes, which > > >> changes the game slightly. Assuming this is the case, our concern is > > >> that it gets set, it get's set securely, can't be tampered with, and > > >> happens automatically (we don't want a developer to "forget" or decide > > >> they don't want to implement it). This argument is really only valid > > >> when you're talking about security and/or auditing. The rest of the > > >> time, I'd recommend using getters/setters. > > > > > > > > > If you ask me, that "auditing" is not responsibility of model as well. > > > > > > Allowing IP address property to be "set" introduces an attack vector > > >> and also extra code that could fail or introduce further security > flaws. > > >> > > >> My advice would be to make IP address a private variable, create a > > >> getter method (no setter), and set the value inside the constructor to > > >> the object. This makes it much more secure, and easier to use - > > >> setting the IP address doesn't then become an "option" and the > > >> respo
[symfony-users] Re: How to access sfWebRequest object from the model
MySQL has built-in functionality for this with its inet_aton and inet_ntoa functions. I'm not entirely sure how you'd be able to use these from Doctrine or Propel though. PHP also has built-in ip2long and long2ip which achieve the same. I don't understand your push v's pull problem :-/ You said you're going to set IP in the action - presumably something like $user->setIp($_SERVER['REMOTE_ADDR']) I assume this is what you mean by 'push'? if you don't want to use a setter, you'll have to set the property in the constructor for $user like I mentioned before class user { private $ip; public function __construct() { $this->ip = $_SERVER['REMOTE_ADDR']; } pubic function getIp() { return $this->ip; } } On 21 Mar 2009, at 19:44, Benjamin wrote: > 2. I will set the ip using the action. The setIp method will convert > it into an integer. I know there were some recommendations about > creating a method to retrieve the IP from, but I can't figure out a > good way to implement a system where the IP is pulled into the User > model, rather than Pushed into it. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Missing Javascript Libraries after PEAR installation
Hi there, I recently installed symfony on my test server at home (Windows box running WAMP) using PEAR. The installation went well, and everything seemed to be working. However, when I tried running the Ajax tutorial, I noticed it wasn't working for a simple reason - the necessary libraries were not being included. At first I thought it was a simple httpd.conf problem, but when I checked my data folder, I noticed there were no JS files there. All I have is: data/symfony/web/sf/calendar data/symfony/web/sf/sf_admin data/symfony/web/sf/sf_default data/symfony/web/sf/sf_web_debug I could download script.aculo.us (which comes with prototype bundled), but I don't know where exactly the JS files should go. So my question is twofold: 1. why would the PEAR installation not install the JS libraries on the data folder by default? that's odd. 2. if the solution is to actually download the libraries, where should I drop them exactly in my symfony data folder? I know I'll use them in other projects, so it would be better to have a "permanent" solution on this one... Thanks for your time and patience! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Missing Javascript Libraries after PEAR installation
Just did some poking on the HTML code that the Ajax Tutorial was generating and I saw this: So I ran a search for that file on my system and I found it in: C:\wamp\bin\php\php5.2.9-1\PEAR\symfony\plugins\sfProtoculousPlugin\web \js However, my PHP data folder is: C:\wamp\bin\php\php5.2.9-1\data\symfony\web\sf Now I'm even more confused than I were initially. Help! :) On Mar 21, 5:59 pm, Campezzi wrote: > Hi there, > > I recently installed symfony on my test server at home (Windows box > running WAMP) using PEAR. The installation went well, and everything > seemed to be working. However, when I tried running the Ajax tutorial, > I noticed it wasn't working for a simple reason - the necessary > libraries were not being included. > > At first I thought it was a simple httpd.conf problem, but when I > checked my data folder, I noticed there were no JS files there. All I > have is: > > data/symfony/web/sf/calendar > data/symfony/web/sf/sf_admin > data/symfony/web/sf/sf_default > data/symfony/web/sf/sf_web_debug > > I could download script.aculo.us (which comes with prototype bundled), > but I don't know where exactly the JS files should go. > > So my question is twofold: > > 1. why would the PEAR installation not install the JS libraries on the > data folder by default? that's odd. > 2. if the solution is to actually download the libraries, where should > I drop them exactly in my symfony data folder? I know I'll use them in > other projects, so it would be better to have a "permanent" solution > on this one... > > Thanks for your time and patience! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
Re: Re : [symfony-users] sfGuardExtraPlugin
Hey Pixelmeister, Lawrence, this is the setup functoin in my ProjectConfiguration: public function setup() { // for compatibility / remove and enable only the plugins you want $this->enableAllPluginsExcept(array('sfDoctrinePlugin', 'sfCompat10Plugin')); } in settings.yml, I have: .settings: enabled_modules: [home, default, sfGuardAuth, sfGuardGroup, sfGuardPermission, sfGuardUser, sfGuardRegister] And in plugins/sfGuardPlugin/lib/models, there is indeed a sfGuardUserPeer.class, but note that the path is a little bit different from what you say - is it an error from you or is it really meant to be in plugins/lib/models? On Mar 21, 10:03 am, Lawrence Krubner wrote: > On Mar 20, 7:57 pm, ckemmler wrote: > > > This might be more interesting: I just tried to trigger the register > > action by going to: > > >http://localhost/web/frontend_dev.php/sfGuardRegister/register > > > This got me: > > > Fatal error: Class 'sfGuardFormRegister' not found in /eclipse/ > > workspace/twittbook/plugins/sfGuardExtraPlugin/modules/sfGuardRegister/ > > lib/BasesfGuardRegisterActions.class.php on line 26 > > > which seems to indicate that the action is indeed recognized and > > executed, but it can't find a class that's defined in the modules lib > > directory: sfGuardFormRegister > > Did you enable the plugin in your apps settings.yml file? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Missing Javascript Libraries after PEAR installation
Hi, I'm most likely can't help you here since I have never used Script.aculo.us with Symfony. But out of curiosity, which Ajax tutorial? Also, what Symfony version are you using? On Sun, Mar 22, 2009 at 9:59 AM, Campezzi wrote: > > Hi there, > > I recently installed symfony on my test server at home (Windows box > running WAMP) using PEAR. The installation went well, and everything > seemed to be working. However, when I tried running the Ajax tutorial, > I noticed it wasn't working for a simple reason - the necessary > libraries were not being included. > > At first I thought it was a simple httpd.conf problem, but when I > checked my data folder, I noticed there were no JS files there. All I > have is: > > data/symfony/web/sf/calendar > data/symfony/web/sf/sf_admin > data/symfony/web/sf/sf_default > data/symfony/web/sf/sf_web_debug > > I could download script.aculo.us (which comes with prototype bundled), > but I don't know where exactly the JS files should go. > > So my question is twofold: > > 1. why would the PEAR installation not install the JS libraries on the > data folder by default? that's odd. > 2. if the solution is to actually download the libraries, where should > I drop them exactly in my symfony data folder? I know I'll use them in > other projects, so it would be better to have a "permanent" solution > on this one... > > Thanks for your time and patience! > > > > -- Blue Horn Ltd - System Development http://bluehorn.co.nz --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
Re: Re : [symfony-users] sfGuardExtraPlugin
Did you clear your cache after installing the plugin? On Sat, Mar 21, 2009 at 00:57, ckemmler wrote: > > This might be more interesting: I just tried to trigger the register > action by going to: > > http://localhost/web/frontend_dev.php/sfGuardRegister/register > > This got me: > > Fatal error: Class 'sfGuardFormRegister' not found in /eclipse/ > workspace/twittbook/plugins/sfGuardExtraPlugin/modules/sfGuardRegister/ > lib/BasesfGuardRegisterActions.class.php on line 26 > > which seems to indicate that the action is indeed recognized and > executed, but it can't find a class that's defined in the modules lib > directory: sfGuardFormRegister > > It seems that my application doens't know about the plugin and hence > doesn't know of the classes/libraries there declared. > > Am I totally wrong here? And if not, how do I correct this situation. > > Also, I forgot to mention that when I tried to install the plugin the > "normal way", I had the following error in the console: > > No release available for plugin "sfGuardExtraPlugin" > > What does it *really* mean? > > > On Mar 20, 4:18 pm, ckemmler wrote: >> Thanks! >> >> Did that. >> >> I have two problems now >> >> 1. the README there tells me: >> >> * Add method `retrieveByUsernameOrEmailAddress` to get a user by >> email or username in lib/model/sfGuardPlugin/sfGuardUserPeer.class >> e.q. >> >> [PHP] >> static public function retrieveByUsernameOrEmailAddress >> ($usernameOrEmail, $isActive = true ) >> { >> $c = new Criteria(); >> $c->add(self::USERNAME, $usernameOrEmail); >> $c->add(self::EMAIL, $usernameOrEmail); >> $c->add(self::IS_ACTIVE, $isActive); >> >> return self::doSelectOne($c); >> } >> >> but I don't have a lib/model/sfGuardPlugin/sfGuardUserPeer.class >> >> What am I supposed to do then? >> >> 2. Suddenly I get the following ugly warnings on every page: >> >> Warning: call_user_func >> (sfGuardExtraRouting::listenToRoutingLoadConfigurationEvent) >> [function.call-user-func]: First argument is expected to be a valid >> callback in /eclipse/workspace/twittbook/lib/symfony/event/ >> sfEventDispatcher.class.php on line 77 >> >> Warning: session_start() [function.session-start]: Cannot send session >> cache limiter - headers already sent (output started at /eclipse/ >> workspace/twittbook/lib/symfony/event/sfEventDispatcher.class.php:77) >> in /eclipse/workspace/twittbook/lib/symfony/storage/ >> sfSessionStorage.class.php on line 93 >> >> Warning: Cannot modify header information - headers already sent by >> (output started at /eclipse/workspace/twittbook/lib/symfony/event/ >> sfEventDispatcher.class.php:77) in /eclipse/workspace/twittbook/lib/ >> symfony/response/sfWebResponse.class.php on line 335 >> >> Warning: Cannot modify header information - headers already sent by >> (output started at /eclipse/workspace/twittbook/lib/symfony/event/ >> sfEventDispatcher.class.php:77) in /eclipse/workspace/twittbook/lib/ >> symfony/response/sfWebResponse.class.php on line 349 >> >> How do I interpret these? >> >> On Mar 20, 4:04 pm, Loïc Vernet wrote: >> >> > Try by SVN or download the pear package. >> >> > ++ >> >> > >> > De : ckemmler >> > À : symfony users >> > Envoyé le : Vendredi, 20 Mars 2009, 23h58mn 04s >> > Objet : [symfony-users] sfGuardExtraPlugin >> >> > This plugin seems to buy me everything I need. However, I can't >> > install it using plugin:install... >> >> > What about other ways of installing it? How do I know that it's going >> > to work? > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Missing Javascript Libraries after PEAR installation
Hi Sid, I mean the Ajax Tutorial on the symfony home page - http://www.symfony-project.org/tutorial/1_2/symfony-ajax And as you can guess from that URL, I'm using symfony v1.2. cheers! On Mar 21, 6:57 pm, Sid Bachtiar wrote: > Hi, > > I'm most likely can't help you here since I have never used > Script.aculo.us with Symfony. But out of curiosity, which Ajax > tutorial? > > Also, what Symfony version are you using? > > > > On Sun, Mar 22, 2009 at 9:59 AM, Campezzi wrote: > > > Hi there, > > > I recently installed symfony on my test server at home (Windows box > > running WAMP) using PEAR. The installation went well, and everything > > seemed to be working. However, when I tried running the Ajax tutorial, > > I noticed it wasn't working for a simple reason - the necessary > > libraries were not being included. > > > At first I thought it was a simple httpd.conf problem, but when I > > checked my data folder, I noticed there were no JS files there. All I > > have is: > > > data/symfony/web/sf/calendar > > data/symfony/web/sf/sf_admin > > data/symfony/web/sf/sf_default > > data/symfony/web/sf/sf_web_debug > > > I could download script.aculo.us (which comes with prototype bundled), > > but I don't know where exactly the JS files should go. > > > So my question is twofold: > > > 1. why would the PEAR installation not install the JS libraries on the > > data folder by default? that's odd. > > 2. if the solution is to actually download the libraries, where should > > I drop them exactly in my symfony data folder? I know I'll use them in > > other projects, so it would be better to have a "permanent" solution > > on this one... > > > Thanks for your time and patience! > > -- > Blue Horn Ltd - System Developmenthttp://bluehorn.co.nz --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Missing Javascript Libraries after PEAR installation
Possibly your the php.ini for cli didn't have high enough memory_limit. This makes the PEAR installer bail halfway through installation - I guess those are the kind of symptoms you'd get, missing file cos they weren't copied before the installation bailed. Try uninstalling (via PEAR), changing your cli memory_limit to 128M and then reinstalling via PEAR. Windows is a bitch to develop on. I'd recommend you build yourself a Linux VM with VirtualBox (it's free) and save yourself a world of pain :) On 21 Mar 2009, at 20:59, Campezzi wrote: > > Hi there, > > I recently installed symfony on my test server at home (Windows box > running WAMP) using PEAR. The installation went well, and everything > seemed to be working. However, when I tried running the Ajax tutorial, > I noticed it wasn't working for a simple reason - the necessary > libraries were not being included. > > At first I thought it was a simple httpd.conf problem, but when I > checked my data folder, I noticed there were no JS files there. All I > have is: > > data/symfony/web/sf/calendar > data/symfony/web/sf/sf_admin > data/symfony/web/sf/sf_default > data/symfony/web/sf/sf_web_debug > > I could download script.aculo.us (which comes with prototype bundled), > but I don't know where exactly the JS files should go. > > So my question is twofold: > > 1. why would the PEAR installation not install the JS libraries on the > data folder by default? that's odd. > 2. if the solution is to actually download the libraries, where should > I drop them exactly in my symfony data folder? I know I'll use them in > other projects, so it would be better to have a "permanent" solution > on this one... > > Thanks for your time and patience! > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Missing Javascript Libraries after PEAR installation
Hi Lee, Thanks for your answer. I checked my cli php.ini settings and they seemed to be fine - just in case, I uninstalled symfony and installed again, and still got the same issues (even though the installation returns an OK message). I'm going to try VirtualBox, but I don't think it will work - I downloaded the symfony source from symfony- project.org and, browsing the files, I see that the file structure there looks just like my installation does. Any other ideas? Thanks again, Campezzi On Mar 21, 7:30 pm, Lee Bolding wrote: > Possibly your the php.ini for cli didn't have high enough > memory_limit. This makes the PEAR installer bail halfway through > installation - I guess those are the kind of symptoms you'd get, > missing file cos they weren't copied before the installation bailed. > > Try uninstalling (via PEAR), changing your cli memory_limit to 128M > and then reinstalling via PEAR. > > Windows is a bitch to develop on. I'd recommend you build yourself a > Linux VM with VirtualBox (it's free) and save yourself a world of > pain :) > > On 21 Mar 2009, at 20:59, Campezzi wrote: > > > > > Hi there, > > > I recently installed symfony on my test server at home (Windows box > > running WAMP) using PEAR. The installation went well, and everything > > seemed to be working. However, when I tried running the Ajax tutorial, > > I noticed it wasn't working for a simple reason - the necessary > > libraries were not being included. > > > At first I thought it was a simple httpd.conf problem, but when I > > checked my data folder, I noticed there were no JS files there. All I > > have is: > > > data/symfony/web/sf/calendar > > data/symfony/web/sf/sf_admin > > data/symfony/web/sf/sf_default > > data/symfony/web/sf/sf_web_debug > > > I could download script.aculo.us (which comes with prototype bundled), > > but I don't know where exactly the JS files should go. > > > So my question is twofold: > > > 1. why would the PEAR installation not install the JS libraries on the > > data folder by default? that's odd. > > 2. if the solution is to actually download the libraries, where should > > I drop them exactly in my symfony data folder? I know I'll use them in > > other projects, so it would be better to have a "permanent" solution > > on this one... > > > Thanks for your time and patience! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Missing Javascript Libraries after PEAR installation
Hmm... you're missing a directory data/symfony/web/sf/prototype, which contains : css/input_auto_complete_tag.css and js/builder.js js/dragdrop.js js/index.html js/scriptaculous.js js/sound.js js/controls.js js/effects.js js/prototype.js js/slider.js js/unittest.js I wouldn't be surprised if you've also got other files missing... I guess it could be a bad path or directory separator in the PEAR package. I'm out of ideas, other than suggesting you try installing 1.1 and see if that works - if it does, it eliminates your platform and points the finger at the package you've been trying to install. On 21 Mar 2009, at 23:07, Campezzi wrote: > > Hi Lee, > > Thanks for your answer. I checked my cli php.ini settings and they > seemed to be fine - just in case, I uninstalled symfony and installed > again, and still got the same issues (even though the installation > returns an OK message). I'm going to try VirtualBox, but I don't think > it will work - I downloaded the symfony source from symfony- > project.org and, browsing the files, I see that the file structure > there looks just like my installation does. > > Any other ideas? > > Thanks again, > > Campezzi > > > On Mar 21, 7:30 pm, Lee Bolding wrote: >> Possibly your the php.ini for cli didn't have high enough >> memory_limit. This makes the PEAR installer bail halfway through >> installation - I guess those are the kind of symptoms you'd get, >> missing file cos they weren't copied before the installation bailed. >> >> Try uninstalling (via PEAR), changing your cli memory_limit to 128M >> and then reinstalling via PEAR. >> >> Windows is a bitch to develop on. I'd recommend you build yourself a >> Linux VM with VirtualBox (it's free) and save yourself a world of >> pain :) >> >> On 21 Mar 2009, at 20:59, Campezzi wrote: >> >> >> >>> Hi there, >> >>> I recently installed symfony on my test server at home (Windows box >>> running WAMP) using PEAR. The installation went well, and everything >>> seemed to be working. However, when I tried running the Ajax >>> tutorial, >>> I noticed it wasn't working for a simple reason - the necessary >>> libraries were not being included. >> >>> At first I thought it was a simple httpd.conf problem, but when I >>> checked my data folder, I noticed there were no JS files there. >>> All I >>> have is: >> >>> data/symfony/web/sf/calendar >>> data/symfony/web/sf/sf_admin >>> data/symfony/web/sf/sf_default >>> data/symfony/web/sf/sf_web_debug >> >>> I could download script.aculo.us (which comes with prototype >>> bundled), >>> but I don't know where exactly the JS files should go. >> >>> So my question is twofold: >> >>> 1. why would the PEAR installation not install the JS libraries on >>> the >>> data folder by default? that's odd. >>> 2. if the solution is to actually download the libraries, where >>> should >>> I drop them exactly in my symfony data folder? I know I'll use >>> them in >>> other projects, so it would be better to have a "permanent" solution >>> on this one... >> >>> Thanks for your time and patience! > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Missing Javascript Libraries after PEAR installation
Hi again Lee, thanks for answering :) Indeed, installing v1.1 gave me the folder I was missing. Maybe there is something wrong with the 1.2.4 package after all... I wonder how that could be informed to the folks that take care of the project? Kind Regards, Campezzi On Mar 21, 8:28 pm, Lee Bolding wrote: > Hmm... you're missing a directory data/symfony/web/sf/prototype, which > contains : > > css/input_auto_complete_tag.css > and > js/builder.js > js/dragdrop.js > js/index.html > js/scriptaculous.js > js/sound.js > js/controls.js > js/effects.js > js/prototype.js > js/slider.js > js/unittest.js > > I wouldn't be surprised if you've also got other files missing... > > I guess it could be a bad path or directory separator in the PEAR > package. > > I'm out of ideas, other than suggesting you try installing 1.1 and see > if that works - if it does, it eliminates your platform and points the > finger at the package you've been trying to install. > > On 21 Mar 2009, at 23:07, Campezzi wrote: > > > > > Hi Lee, > > > Thanks for your answer. I checked my cli php.ini settings and they > > seemed to be fine - just in case, I uninstalled symfony and installed > > again, and still got the same issues (even though the installation > > returns an OK message). I'm going to try VirtualBox, but I don't think > > it will work - I downloaded the symfony source from symfony- > > project.org and, browsing the files, I see that the file structure > > there looks just like my installation does. > > > Any other ideas? > > > Thanks again, > > > Campezzi > > > On Mar 21, 7:30 pm, Lee Bolding wrote: > >> Possibly your the php.ini for cli didn't have high enough > >> memory_limit. This makes the PEAR installer bail halfway through > >> installation - I guess those are the kind of symptoms you'd get, > >> missing file cos they weren't copied before the installation bailed. > > >> Try uninstalling (via PEAR), changing your cli memory_limit to 128M > >> and then reinstalling via PEAR. > > >> Windows is a bitch to develop on. I'd recommend you build yourself a > >> Linux VM with VirtualBox (it's free) and save yourself a world of > >> pain :) > > >> On 21 Mar 2009, at 20:59, Campezzi wrote: > > >>> Hi there, > > >>> I recently installed symfony on my test server at home (Windows box > >>> running WAMP) using PEAR. The installation went well, and everything > >>> seemed to be working. However, when I tried running the Ajax > >>> tutorial, > >>> I noticed it wasn't working for a simple reason - the necessary > >>> libraries were not being included. > > >>> At first I thought it was a simple httpd.conf problem, but when I > >>> checked my data folder, I noticed there were no JS files there. > >>> All I > >>> have is: > > >>> data/symfony/web/sf/calendar > >>> data/symfony/web/sf/sf_admin > >>> data/symfony/web/sf/sf_default > >>> data/symfony/web/sf/sf_web_debug > > >>> I could download script.aculo.us (which comes with prototype > >>> bundled), > >>> but I don't know where exactly the JS files should go. > > >>> So my question is twofold: > > >>> 1. why would the PEAR installation not install the JS libraries on > >>> the > >>> data folder by default? that's odd. > >>> 2. if the solution is to actually download the libraries, where > >>> should > >>> I drop them exactly in my symfony data folder? I know I'll use > >>> them in > >>> other projects, so it would be better to have a "permanent" solution > >>> on this one... > > >>> Thanks for your time and patience! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
Re: Re : [symfony-users] sfGuardExtraPlugin
uh-ho! Seems I haven't I'm definitely getting one step further, but I suppose it isn't quite good enough yet :-( Thanks anyway! On Mar 21, 2:57 pm, Fási Gábor wrote: > Did you clear your cache after installing the plugin? > > On Sat, Mar 21, 2009 at 00:57, ckemmler wrote: > > > This might be more interesting: I just tried to trigger the register > > action by going to: > > >http://localhost/web/frontend_dev.php/sfGuardRegister/register > > > This got me: > > > Fatal error: Class 'sfGuardFormRegister' not found in /eclipse/ > > workspace/twittbook/plugins/sfGuardExtraPlugin/modules/sfGuardRegister/ > > lib/BasesfGuardRegisterActions.class.php on line 26 > > > which seems to indicate that the action is indeed recognized and > > executed, but it can't find a class that's defined in the modules lib > > directory: sfGuardFormRegister > > > It seems that my application doens't know about the plugin and hence > > doesn't know of the classes/libraries there declared. > > > Am I totally wrong here? And if not, how do I correct this situation. > > > Also, I forgot to mention that when I tried to install the plugin the > > "normal way", I had the following error in the console: > > > No release available for plugin "sfGuardExtraPlugin" > > > What does it *really* mean? > > > On Mar 20, 4:18 pm, ckemmler wrote: > >> Thanks! > > >> Did that. > > >> I have two problems now > > >> 1. the README there tells me: > > >> * Add method `retrieveByUsernameOrEmailAddress` to get a user by > >> email or username in lib/model/sfGuardPlugin/sfGuardUserPeer.class > >> e.q. > > >> [PHP] > >> static public function retrieveByUsernameOrEmailAddress > >> ($usernameOrEmail, $isActive = true ) > >> { > >> $c = new Criteria(); > >> $c->add(self::USERNAME, $usernameOrEmail); > >> $c->add(self::EMAIL, $usernameOrEmail); > >> $c->add(self::IS_ACTIVE, $isActive); > > >> return self::doSelectOne($c); > >> } > > >> but I don't have a lib/model/sfGuardPlugin/sfGuardUserPeer.class > > >> What am I supposed to do then? > > >> 2. Suddenly I get the following ugly warnings on every page: > > >> Warning: call_user_func > >> (sfGuardExtraRouting::listenToRoutingLoadConfigurationEvent) > >> [function.call-user-func]: First argument is expected to be a valid > >> callback in /eclipse/workspace/twittbook/lib/symfony/event/ > >> sfEventDispatcher.class.php on line 77 > > >> Warning: session_start() [function.session-start]: Cannot send session > >> cache limiter - headers already sent (output started at /eclipse/ > >> workspace/twittbook/lib/symfony/event/sfEventDispatcher.class.php:77) > >> in /eclipse/workspace/twittbook/lib/symfony/storage/ > >> sfSessionStorage.class.php on line 93 > > >> Warning: Cannot modify header information - headers already sent by > >> (output started at /eclipse/workspace/twittbook/lib/symfony/event/ > >> sfEventDispatcher.class.php:77) in /eclipse/workspace/twittbook/lib/ > >> symfony/response/sfWebResponse.class.php on line 335 > > >> Warning: Cannot modify header information - headers already sent by > >> (output started at /eclipse/workspace/twittbook/lib/symfony/event/ > >> sfEventDispatcher.class.php:77) in /eclipse/workspace/twittbook/lib/ > >> symfony/response/sfWebResponse.class.php on line 349 > > >> How do I interpret these? > > >> On Mar 20, 4:04 pm, Loïc Vernet wrote: > > >> > Try by SVN or download the pear package. > > >> > ++ > > >> > > >> > De : ckemmler > >> > À : symfony users > >> > Envoyé le : Vendredi, 20 Mars 2009, 23h58mn 04s > >> > Objet : [symfony-users] sfGuardExtraPlugin > > >> > This plugin seems to buy me everything I need. However, I can't > >> > install it using plugin:install... > > >> > What about other ways of installing it? How do I know that it's going > >> > to work? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
Re: Re : [symfony-users] sfGuardExtraPlugin
With Symfony, when there's a problem, first clear cache :-D On Sun, Mar 22, 2009 at 12:56 PM, ckemmler wrote: > > uh-ho! Seems I haven't > > I'm definitely getting one step further, but I suppose it isn't quite > good enough yet :-( > > Thanks anyway! > > On Mar 21, 2:57 pm, Fási Gábor wrote: >> Did you clear your cache after installing the plugin? >> >> On Sat, Mar 21, 2009 at 00:57, ckemmler wrote: >> >> > This might be more interesting: I just tried to trigger the register >> > action by going to: >> >> >http://localhost/web/frontend_dev.php/sfGuardRegister/register >> >> > This got me: >> >> > Fatal error: Class 'sfGuardFormRegister' not found in /eclipse/ >> > workspace/twittbook/plugins/sfGuardExtraPlugin/modules/sfGuardRegister/ >> > lib/BasesfGuardRegisterActions.class.php on line 26 >> >> > which seems to indicate that the action is indeed recognized and >> > executed, but it can't find a class that's defined in the modules lib >> > directory: sfGuardFormRegister >> >> > It seems that my application doens't know about the plugin and hence >> > doesn't know of the classes/libraries there declared. >> >> > Am I totally wrong here? And if not, how do I correct this situation. >> >> > Also, I forgot to mention that when I tried to install the plugin the >> > "normal way", I had the following error in the console: >> >> > No release available for plugin "sfGuardExtraPlugin" >> >> > What does it *really* mean? >> >> > On Mar 20, 4:18 pm, ckemmler wrote: >> >> Thanks! >> >> >> Did that. >> >> >> I have two problems now >> >> >> 1. the README there tells me: >> >> >> * Add method `retrieveByUsernameOrEmailAddress` to get a user by >> >> email or username in lib/model/sfGuardPlugin/sfGuardUserPeer.class >> >> e.q. >> >> >> [PHP] >> >> static public function retrieveByUsernameOrEmailAddress >> >> ($usernameOrEmail, $isActive = true ) >> >> { >> >> $c = new Criteria(); >> >> $c->add(self::USERNAME, $usernameOrEmail); >> >> $c->add(self::EMAIL, $usernameOrEmail); >> >> $c->add(self::IS_ACTIVE, $isActive); >> >> >> return self::doSelectOne($c); >> >> } >> >> >> but I don't have a lib/model/sfGuardPlugin/sfGuardUserPeer.class >> >> >> What am I supposed to do then? >> >> >> 2. Suddenly I get the following ugly warnings on every page: >> >> >> Warning: call_user_func >> >> (sfGuardExtraRouting::listenToRoutingLoadConfigurationEvent) >> >> [function.call-user-func]: First argument is expected to be a valid >> >> callback in /eclipse/workspace/twittbook/lib/symfony/event/ >> >> sfEventDispatcher.class.php on line 77 >> >> >> Warning: session_start() [function.session-start]: Cannot send session >> >> cache limiter - headers already sent (output started at /eclipse/ >> >> workspace/twittbook/lib/symfony/event/sfEventDispatcher.class.php:77) >> >> in /eclipse/workspace/twittbook/lib/symfony/storage/ >> >> sfSessionStorage.class.php on line 93 >> >> >> Warning: Cannot modify header information - headers already sent by >> >> (output started at /eclipse/workspace/twittbook/lib/symfony/event/ >> >> sfEventDispatcher.class.php:77) in /eclipse/workspace/twittbook/lib/ >> >> symfony/response/sfWebResponse.class.php on line 335 >> >> >> Warning: Cannot modify header information - headers already sent by >> >> (output started at /eclipse/workspace/twittbook/lib/symfony/event/ >> >> sfEventDispatcher.class.php:77) in /eclipse/workspace/twittbook/lib/ >> >> symfony/response/sfWebResponse.class.php on line 349 >> >> >> How do I interpret these? >> >> >> On Mar 20, 4:04 pm, Loïc Vernet wrote: >> >> >> > Try by SVN or download the pear package. >> >> >> > ++ >> >> >> > >> >> > De : ckemmler >> >> > À : symfony users >> >> > Envoyé le : Vendredi, 20 Mars 2009, 23h58mn 04s >> >> > Objet : [symfony-users] sfGuardExtraPlugin >> >> >> > This plugin seems to buy me everything I need. However, I can't >> >> > install it using plugin:install... >> >> >> > What about other ways of installing it? How do I know that it's going >> >> > to work? > > > -- Blue Horn Ltd - System Development http://bluehorn.co.nz --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] multiple problems with sfGuardRegister
I'm trying to have this module to work. Being new to symfony/php (from a java background), I'm also suprised that this module isn't more integrated into the platform. 1. to make it work at all I had to manually uncomment the if(...) clause in the sfGuardExtraPlugin config so it now reads: $this->dispatcher->connect('routing.load_configuration', array ('sfGuardExtraRouting', 'listenToRoutingLoadConfigurationEvent')); 2. The only things I could get now is a simplistic register form (w/o captcha); when I hit the "request" button though, I'm having this exception: You must pass an array parameter to the clean() method (this validator can only be used as a post validator). I could get rid of it by commenting out some validators in BasesfGuardFormRegister.class.php, but I don't know why they wouldn't work -> 3. new exception: Call to undefined method BasesfGuardUser::merge So this is referring to the other plugin, sfGuardPlugin, and seems to indicate that the two plugins are not sync'd. Is it possible? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Missing Javascript Libraries after PEAR installation
OK, after looking everywhere, I managed to find a solution. Turns out things changes in 1.2 - the prototype directory is now not located on the web folder, but inside a plugin. That plugin needs to be activated on the command line by issuing the following command: symfony plugin:publish-assets After doing that, symfony seems to set up special redirection rules for the plugins used on the proejct, like for example the / sfProtoculousPlugin directory that my templates kept trying to access. Then, bingo! Things work like magic :P So it seems all that is missing is to add that command to the Ajax Tutorial for 1.2 Thanks for the help :) On Mar 21, 8:51 pm, Campezzi wrote: > Hi again Lee, thanks for answering :) > > Indeed, installing v1.1 gave me the folder I was missing. Maybe there > is something wrong with the 1.2.4 package after all... I wonder how > that could be informed to the folks that take care of the project? > > Kind Regards, > Campezzi > > On Mar 21, 8:28 pm, Lee Bolding wrote: > > > Hmm... you're missing a directory data/symfony/web/sf/prototype, which > > contains : > > > css/input_auto_complete_tag.css > > and > > js/builder.js > > js/dragdrop.js > > js/index.html > > js/scriptaculous.js > > js/sound.js > > js/controls.js > > js/effects.js > > js/prototype.js > > js/slider.js > > js/unittest.js > > > I wouldn't be surprised if you've also got other files missing... > > > I guess it could be a bad path or directory separator in the PEAR > > package. > > > I'm out of ideas, other than suggesting you try installing 1.1 and see > > if that works - if it does, it eliminates your platform and points the > > finger at the package you've been trying to install. > > > On 21 Mar 2009, at 23:07, Campezzi wrote: > > > > Hi Lee, > > > > Thanks for your answer. I checked my cli php.ini settings and they > > > seemed to be fine - just in case, I uninstalled symfony and installed > > > again, and still got the same issues (even though the installation > > > returns an OK message). I'm going to try VirtualBox, but I don't think > > > it will work - I downloaded the symfony source from symfony- > > > project.org and, browsing the files, I see that the file structure > > > there looks just like my installation does. > > > > Any other ideas? > > > > Thanks again, > > > > Campezzi > > > > On Mar 21, 7:30 pm, Lee Bolding wrote: > > >> Possibly your the php.ini for cli didn't have high enough > > >> memory_limit. This makes the PEAR installer bail halfway through > > >> installation - I guess those are the kind of symptoms you'd get, > > >> missing file cos they weren't copied before the installation bailed. > > > >> Try uninstalling (via PEAR), changing your cli memory_limit to 128M > > >> and then reinstalling via PEAR. > > > >> Windows is a bitch to develop on. I'd recommend you build yourself a > > >> Linux VM with VirtualBox (it's free) and save yourself a world of > > >> pain :) > > > >> On 21 Mar 2009, at 20:59, Campezzi wrote: > > > >>> Hi there, > > > >>> I recently installed symfony on my test server at home (Windows box > > >>> running WAMP) using PEAR. The installation went well, and everything > > >>> seemed to be working. However, when I tried running the Ajax > > >>> tutorial, > > >>> I noticed it wasn't working for a simple reason - the necessary > > >>> libraries were not being included. > > > >>> At first I thought it was a simple httpd.conf problem, but when I > > >>> checked my data folder, I noticed there were no JS files there. > > >>> All I > > >>> have is: > > > >>> data/symfony/web/sf/calendar > > >>> data/symfony/web/sf/sf_admin > > >>> data/symfony/web/sf/sf_default > > >>> data/symfony/web/sf/sf_web_debug > > > >>> I could download script.aculo.us (which comes with prototype > > >>> bundled), > > >>> but I don't know where exactly the JS files should go. > > > >>> So my question is twofold: > > > >>> 1. why would the PEAR installation not install the JS libraries on > > >>> the > > >>> data folder by default? that's odd. > > >>> 2. if the solution is to actually download the libraries, where > > >>> should > > >>> I drop them exactly in my symfony data folder? I know I'll use > > >>> them in > > >>> other projects, so it would be better to have a "permanent" solution > > >>> on this one... > > > >>> Thanks for your time and patience! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---