[symfony-users] Re: problem with file upload

2009-03-09 Thread dziobacz

Thx YOU xD !!


On 8 Mar, 21:57, Marijn  wrote:
> Well, you chose to have maximum file size of 1000 bytes... Try the
> following
>
> new sfValidatorFile(array('required' => true, 'mime_types' => array
> ('image/jpeg', 'image/jpg', 'image/png', 'image/gif'), 'max_size' =>
> 2097152), array('max_size' => 'File size of 2MB exceeded',
> 'mime_types' => 'You are only allowed to upload JPG, PNG or GIF
> files.'));
>
> On Mar 8, 8:07 pm, dziobacz  wrote:
>
> > I would like to make very safe upload file: .gif, .jpg and .png but I
> > am new in symfony. Could you tell me is my code safe ? And why I have
> > non stop communicate 'Too big size' - it is my own communicate (see
> > below)?? Sry for some polish names in my code below :)
>
> > class UploadForm extends sfForm
> > {
> >   public function configure()
> >   {
> >     $this->setWidgets(array(
> >       'file'    => new sfWidgetFormInputFile(),
> >     ));
>
> >     $this->widgetSchema->setNameFormat('minifile[%s]');
>
> >     $this->setValidators(array(
> >       'file'    => new sfValidatorFile(array(
> >                 'required'   => true,
> >                 'mime_types' => 'image/jpeg, image/png, image/gif',
> >                 'max_size'       => '1000',
> >           ),
> >           array(
> >           'max_size' => 'Too big size',
> >           'mime_types' => 'Only .jpeg, .png or .gif',
> >           )),
> >     ));
>
> >   }
>
> > }
>
> > public function executeUpload(sfWebRequest $request)
> >   {
> >         $this->form = new UploadForm();
>
> >     if ($request->isMethod('post'))
> >     {
> >       $this->form->bind($request->getParameter('minifile'), 
> > $request->getFiles('minifile'));
>
> >       if ($this->form->isValid())
> >       {
>
> >         $file = $this->form->getValue('file');
>
> >                 $filename = $this->getUser()->getGuardUser()->getId();
> >                 $extension = 
> > $file->getExtension($file->getOriginalExtension());
> >                 $file->save(sfConfig::get('sf_upload_dir').'/'.$filename.
> > $extension);
>
> >                 $id = $this->getUser()->getGuardUser()->getId();
> >                 $nazwa = $filename.$extension;
> >                 $this->profill = 
> > Doctrine::getTable('SfGuardUserProfile')->setUploadPhoto($id, $name);
>
> >       }
> >     }
> >   }
>
> > public function setUploadPhoto($id, $name)
> >   {
> >         $q = Doctrine_Query::create()
> >           ->update('SfGuardUserProfile sgup')
> >           ->set('sgup.photo', '?', $name)
> >           ->where('sgup.user_id = ?', $id);
>
> >         return $q->execute();
> >   }
>
>
--~--~-~--~~~---~--~~
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] sfGuard - how can I make default is_active = 0 ?

2009-03-09 Thread dziobacz

I am making registration users. I have tried change column is_active
in table sf_guard_user to default value=0 but still after registration
new user has is_active=1. What should I do ? It is my code:

First file:

class RegistrationForm extends sfGuardUserForm
{
 public function configure()
 {
   unset(
 $this['id'],
 $this['is_active'],
 $this['is_super_admin'],
 $this['updated_at'],
 $this['groups_list'],
 $this['permissions_list'],
 $this['last_login'],
 $this['created_at'],
 $this['salt'],
 $this['algorithm']
   );


   $this->widgetSchema['password'] = new sfWidgetFormInputPassword
();
   $this->widgetSchema['password_confirmation'] = new
sfWidgetFormInputPassword();
   $this->widgetSchema['name'] = new sfWidgetFormInput();
   $this->widgetSchema['surname'] = new sfWidgetFormInput();
   $this->widgetSchema['email'] = new sfWidgetFormInput();


//validators. I deleted them - code will be too long

 }
}




Second file:

class registrationActions extends sfActions
{

 public function executeIndex(sfWebRequest $request)
 {
   $this->form = new RegistrationForm();
 if ($request->isMethod('post'))
 {
   $this->form->bind($request->getParameter('sf_guard_user'));
   if ($this->form->isValid())
   {

   $conn = Doctrine_Manager::connection();

   $conn->beginTransaction();
   try
   {
   $user = $this->form->save();


$profil = new SfGuardUserProfile();
   $profil -> setUserId($user->getId());
   $profil -> setName($this->form->getValue('name'));
   $profil -> setSurname($this->form->getValue
('surname'));
   $profil -> setEmail($this->form->getValue('email'));
   $profil -> save();

   $conn->commit();
   }
   catch (Exception $e)
 {
   $conn->rollBack();
   throw $e;
 }

   }
 }
 }
}
--~--~-~--~~~---~--~~
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: what is the best way to enable JQuery in Symfony?

2009-03-09 Thread Lee Bolding

and - ofcourse - cleared your cache? ;)

On 9 Mar 2009, at 01:59, prodigital...@vectrbas-d.com wrote:

>
>
>> Hmm. Okay. I copy and pasted what you have here to /apps/frontend/
>> config/view.yml.  I still get nothing in layout.php. And I mean, I  
>> get
>> a blank line, no HTML.
>>
>> Again, I'm trying to avoid setting a value in any action.
>
> Then youve done something wrong because that is the way its done.  
> Did you
> make sure youre indentation was ok in the view.yml (especially since  
> you
> c&p'ed)?
>
> Do you have a view.yml set up on the module youre testing with? Does  
> it
> have values for the the javascripts key? they may be overriding it.  
> Also
> did you make sure you got rid of any of your hacks that might  
> influence
> this?
>
>
> >


--~--~-~--~~~---~--~~
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: sfGuard - how can I make default is_active = 0 ?

2009-03-09 Thread Hugo HAMON

You have to override the save() method of your form to force the
setIsActive(false) inside. The code you have put in your action does
not belong to the controller but to the model, so let's move it in the
save method of your form.
--~--~-~--~~~---~--~~
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: sfGuard - how can I make default is_active = 0 ?

2009-03-09 Thread Gregoire Laporte

But you can notice that even is_active == 0 ,the user can connect !!
It's a bug i think !

> Date: Mon, 9 Mar 2009 02:12:32 -0700
> Subject: [symfony-users] Re: sfGuard - how can I make default is_active = 0 ?
> From: webmas...@apprendre-php.com
> To: symfony-users@googlegroups.com
> 
> 
> You have to override the save() method of your form to force the
> setIsActive(false) inside. The code you have put in your action does
> not belong to the controller but to the model, so let's move it in the
> save method of your form.
> > 

_
Téléphonez gratuitement à tous vos proches avec Windows Live Messenger  !  
Téléchargez-le maintenant !
http://www.windowslive.fr/messenger/1.asp
--~--~-~--~~~---~--~~
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: sfGuard - how can I make default is_active = 0 ?

2009-03-09 Thread dziobacz

Hugo Hamon I don't understand you - what do you mean ? :)

Gregorie Laporte - you have right . strange.. I hope
somebody will correct this in the future ?


On 9 Mar, 10:26, Gregoire Laporte  wrote:
> But you can notice that even is_active == 0 ,the user can connect !!
> It's a bug i think !
>
> > Date: Mon, 9 Mar 2009 02:12:32 -0700
> > Subject: [symfony-users] Re: sfGuard - how can I make default is_active = 0 
> > ?
> > From: webmas...@apprendre-php.com
> > To: symfony-users@googlegroups.com
>
> > You have to override the save() method of your form to force the
> > setIsActive(false) inside. The code you have put in your action does
> > not belong to the controller but to the model, so let's move it in the
> > save method of your form.
>
> _
> Téléphonez gratuitement à tous vos proches avec Windows Live Messenger  !  
> Téléchargez-le maintenant !http://www.windowslive.fr/messenger/1.asp
--~--~-~--~~~---~--~~
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: what is the best way to enable JQuery in Symfony?

2009-03-09 Thread Lee Bolding

Just to clarify - it won't appear in layout.php - it will appear in  
the head section of your Success.php template once it's  
rendered.

You don't need to use any helper for this either. You just have to be  
sure that layout is on, the rest should take care of itself. As I said  
before, it's not rocket science, there's no need for dirty hacks -  
this is something Symfony is very good at :)

The only problem you may encounter is when the javascript filename has  
a . in it - in which case you need to specify the WHOLE filename,  
instead of dropping the .js extension like many examples you see.  
Alternatively, you can rename your jquery filename to something like  
jquery.js

On 9 Mar 2009, at 01:07, Lawrence Krubner wrote:

> Hmm. Okay. I copy and pasted what you have here to /apps/frontend/
> config/view.yml.  I still get nothing in layout.php. And I mean, I get
> a blank line, no HTML.

--~--~-~--~~~---~--~~
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: sfGuard - how can I make default is_active = 0 ?

2009-03-09 Thread Gregoire Laporte

i think you need to change the save method in 
/plugin/sfGuardPlugin/lib/model/pluginSfGuardUser.class.php!

> Date: Mon, 9 Mar 2009 02:35:31 -0700
> Subject: [symfony-users] Re: sfGuard - how can I make default is_active = 0 ?
> From: aaabbbcccda...@gmail.com
> To: symfony-users@googlegroups.com
> 
> 
> Hugo Hamon I don't understand you - what do you mean ? :)
> 
> Gregorie Laporte - you have right . strange.. I hope
> somebody will correct this in the future ?
> 
> 
> On 9 Mar, 10:26, Gregoire Laporte  wrote:
> > But you can notice that even is_active == 0 ,the user can connect !!
> > It's a bug i think !
> >
> > > Date: Mon, 9 Mar 2009 02:12:32 -0700
> > > Subject: [symfony-users] Re: sfGuard - how can I make default is_active = 
> > > 0 ?
> > > From: webmas...@apprendre-php.com
> > > To: symfony-users@googlegroups.com
> >
> > > You have to override the save() method of your form to force the
> > > setIsActive(false) inside. The code you have put in your action does
> > > not belong to the controller but to the model, so let's move it in the
> > > save method of your form.
> >
> > _
> > Téléphonez gratuitement à tous vos proches avec Windows Live Messenger  !  
> > Téléchargez-le maintenant !http://www.windowslive.fr/messenger/1.asp
> > 

_
Découvrez toutes les possibilités de communication avec vos proches
http://www.microsoft.com/windows/windowslive/default.aspx
--~--~-~--~~~---~--~~
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: sfGuard - how can I make default is_active = 0 ?

2009-03-09 Thread dziobacz

Is it something like that: ?? But it doesn't work. :/


class RegistrationForm extends sfGuardUserForm
{

public function save($con = null)
  {

$this->setIsActive(false);
return parent::save($con);

  }


 public function configure()
 {
   unset(
 $this['id'],
 $this['is_active'],
 $this['is_super_admin'],
 $this['updated_at'],
 $this['groups_list'],
 $this['permissions_list'],
 $this['last_login'],
 $this['created_at'],
 $this['salt'],
 $this['algorithm']
   );

   $this->widgetSchema['password'] = new sfWidgetFormInputPassword
();
   $this->widgetSchema['password_confirmation'] = new
sfWidgetFormInputPassword();
   $this->widgetSchema['name'] = new sfWidgetFormInput();
   $this->widgetSchema['surname'] = new sfWidgetFormInput();
   $this->widgetSchema['email'] = new sfWidgetFormInput();

//validators. I deleted them - code will be too long

 }

}








On 9 Mar, 10:43, Gregoire Laporte  wrote:
> i think you need to change the save method in 
> /plugin/sfGuardPlugin/lib/model/pluginSfGuardUser.class.php!
>
>
>
> > Date: Mon, 9 Mar 2009 02:35:31 -0700
> > Subject: [symfony-users] Re: sfGuard - how can I make default is_active = 0 
> > ?
> > From: aaabbbcccda...@gmail.com
> > To: symfony-users@googlegroups.com
>
> > Hugo Hamon I don't understand you - what do you mean ? :)
>
> > Gregorie Laporte - you have right . strange.. I hope
> > somebody will correct this in the future ?
>
> > On 9 Mar, 10:26, Gregoire Laporte  wrote:
> > > But you can notice that even is_active == 0 ,the user can connect !!
> > > It's a bug i think !
>
> > > > Date: Mon, 9 Mar 2009 02:12:32 -0700
> > > > Subject: [symfony-users] Re: sfGuard - how can I make default is_active 
> > > > = 0 ?
> > > > From: webmas...@apprendre-php.com
> > > > To: symfony-users@googlegroups.com
>
> > > > You have to override the save() method of your form to force the
> > > > setIsActive(false) inside. The code you have put in your action does
> > > > not belong to the controller but to the model, so let's move it in the
> > > > save method of your form.
>
> > > _
> > > Téléphonez gratuitement à tous vos proches avec Windows Live Messenger  ! 
> > >  Téléchargez-le maintenant !http://www.windowslive.fr/messenger/1.asp
>
> _
> Découvrez toutes les possibilités de communication avec vos 
> procheshttp://www.microsoft.com/windows/windowslive/default.aspx
--~--~-~--~~~---~--~~
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: sfGuard - how can I make default is_active = 0 ?

2009-03-09 Thread Gregoire Laporte

and with 
$this->setIsActive(0);Which Release of this plugin have you? (1.2?) and which 
file do you edit cause i haven't this code.


> Date: Mon, 9 Mar 2009 03:00:32 -0700
> Subject: [symfony-users] Re: sfGuard - how can I make default is_active = 0 ?
> From: aaabbbcccda...@gmail.com
> To: symfony-users@googlegroups.com
> 
> 
> Is it something like that: ?? But it doesn't work. :/
> 
> 
> class RegistrationForm extends sfGuardUserForm
> {
> 
> public function save($con = null)
>   {
> 
>   $this->setIsActive(false);
>   return parent::save($con);
> 
>   }
> 
> 
>  public function configure()
>  {
>unset(
>  $this['id'],
>  $this['is_active'],
>  $this['is_super_admin'],
>  $this['updated_at'],
>  $this['groups_list'],
>  $this['permissions_list'],
>  $this['last_login'],
>  $this['created_at'],
>  $this['salt'],
>  $this['algorithm']
>);
> 
>$this->widgetSchema['password'] = new sfWidgetFormInputPassword
> ();
>$this->widgetSchema['password_confirmation'] = new
> sfWidgetFormInputPassword();
>$this->widgetSchema['name'] = new sfWidgetFormInput();
>$this->widgetSchema['surname'] = new sfWidgetFormInput();
>$this->widgetSchema['email'] = new sfWidgetFormInput();
> 
> //validators. I deleted them - code will be too long
> 
>  }
> 
> }
> 
> 
> 
> 
> 
> 
> 
> 
> On 9 Mar, 10:43, Gregoire Laporte  wrote:
> > i think you need to change the save method in 
> > /plugin/sfGuardPlugin/lib/model/pluginSfGuardUser.class.php!
> >
> >
> >
> > > Date: Mon, 9 Mar 2009 02:35:31 -0700
> > > Subject: [symfony-users] Re: sfGuard - how can I make default is_active = 
> > > 0 ?
> > > From: aaabbbcccda...@gmail.com
> > > To: symfony-users@googlegroups.com
> >
> > > Hugo Hamon I don't understand you - what do you mean ? :)
> >
> > > Gregorie Laporte - you have right . strange.. I hope
> > > somebody will correct this in the future ?
> >
> > > On 9 Mar, 10:26, Gregoire Laporte  wrote:
> > > > But you can notice that even is_active == 0 ,the user can connect !!
> > > > It's a bug i think !
> >
> > > > > Date: Mon, 9 Mar 2009 02:12:32 -0700
> > > > > Subject: [symfony-users] Re: sfGuard - how can I make default 
> > > > > is_active = 0 ?
> > > > > From: webmas...@apprendre-php.com
> > > > > To: symfony-users@googlegroups.com
> >
> > > > > You have to override the save() method of your form to force the
> > > > > setIsActive(false) inside. The code you have put in your action does
> > > > > not belong to the controller but to the model, so let's move it in the
> > > > > save method of your form.
> >
> > > > _
> > > > Téléphonez gratuitement à tous vos proches avec Windows Live Messenger  
> > > > !  Téléchargez-le maintenant !http://www.windowslive.fr/messenger/1.asp
> >
> > _
> > Découvrez toutes les possibilités de communication avec vos 
> > procheshttp://www.microsoft.com/windows/windowslive/default.aspx
> > 

_
Inédit ! Des Emoticônes Déjantées! Installez les dans votre Messenger ! 
http://www.ilovemessenger.fr/Emoticones/EmoticonesDejantees.aspx
--~--~-~--~~~---~--~~
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: sfGuard - how can I make default is_active = 0 ?

2009-03-09 Thread dziobacz

I don't know which version - I am new in Symfony :D I installed
sfDoctrineGuardPlugin 4. days ago using: php symfony plugin:install
sfDoctrineGuardPlugin.
I am making it in RegistrationForm.class.php and I have an error:
Fatal error: Call to undefined method RegistrationForm::setIsActive()
in C:\Program Files\WebServ\httpd\sf_sandbox\apps\frontend\modules
\registration\lib\RegistrationForm.class.php on line 85
What is going on ?? :O




On 9 Mar, 11:07, Gregoire Laporte  wrote:
> and with
> $this->setIsActive(0);Which Release of this plugin have you? (1.2?) and which 
> file do you edit cause i haven't this code.
>
>
>
> > Date: Mon, 9 Mar 2009 03:00:32 -0700
> > Subject: [symfony-users] Re: sfGuard - how can I make default is_active = 0 
> > ?
> > From: aaabbbcccda...@gmail.com
> > To: symfony-users@googlegroups.com
>
> > Is it something like that: ?? But it doesn't work. :/
>
> > class RegistrationForm extends sfGuardUserForm
> > {
>
> > public function save($con = null)
> >   {
>
> >    $this->setIsActive(false);
> >    return parent::save($con);
>
> >   }
>
> >  public function configure()
> >  {
> >    unset(
> >      $this['id'],
> >      $this['is_active'],
> >      $this['is_super_admin'],
> >      $this['updated_at'],
> >      $this['groups_list'],
> >      $this['permissions_list'],
> >      $this['last_login'],
> >      $this['created_at'],
> >      $this['salt'],
> >      $this['algorithm']
> >    );
>
> >        $this->widgetSchema['password'] = new sfWidgetFormInputPassword
> > ();
> >        $this->widgetSchema['password_confirmation'] = new
> > sfWidgetFormInputPassword();
> >    $this->widgetSchema['name'] = new sfWidgetFormInput();
> >    $this->widgetSchema['surname'] = new sfWidgetFormInput();
> >    $this->widgetSchema['email'] = new sfWidgetFormInput();
>
> > //validators. I deleted them - code will be too long
>
> >  }
>
> > }
>
> > On 9 Mar, 10:43, Gregoire Laporte  wrote:
> > > i think you need to change the save method in 
> > > /plugin/sfGuardPlugin/lib/model/pluginSfGuardUser.class.php!
>
> > > > Date: Mon, 9 Mar 2009 02:35:31 -0700
> > > > Subject: [symfony-users] Re: sfGuard - how can I make default is_active 
> > > > = 0 ?
> > > > From: aaabbbcccda...@gmail.com
> > > > To: symfony-users@googlegroups.com
>
> > > > Hugo Hamon I don't understand you - what do you mean ? :)
>
> > > > Gregorie Laporte - you have right . strange.. I hope
> > > > somebody will correct this in the future ?
>
> > > > On 9 Mar, 10:26, Gregoire Laporte  wrote:
> > > > > But you can notice that even is_active == 0 ,the user can connect !!
> > > > > It's a bug i think !
>
> > > > > > Date: Mon, 9 Mar 2009 02:12:32 -0700
> > > > > > Subject: [symfony-users] Re: sfGuard - how can I make default 
> > > > > > is_active = 0 ?
> > > > > > From: webmas...@apprendre-php.com
> > > > > > To: symfony-users@googlegroups.com
>
> > > > > > You have to override the save() method of your form to force the
> > > > > > setIsActive(false) inside. The code you have put in your action does
> > > > > > not belong to the controller but to the model, so let's move it in 
> > > > > > the
> > > > > > save method of your form.
>
> > > > > _
> > > > > Téléphonez gratuitement à tous vos proches avec Windows Live 
> > > > > Messenger  !  Téléchargez-le maintenant 
> > > > > !http://www.windowslive.fr/messenger/1.asp
>
> > > _
> > > Découvrez toutes les possibilités de communication avec vos 
> > > procheshttp://www.microsoft.com/windows/windowslive/default.aspx
>
> _
> Inédit ! Des Emoticônes Déjantées! Installez les dans votre Messenger 
> !http://www.ilovemessenger.fr/Emoticones/EmoticonesDejantees.aspx
--~--~-~--~~~---~--~~
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: sfGuard - how can I make default is_active = 0 ?

2009-03-09 Thread Gregoire Laporte

try this 
$this['is_active'] = 0;
but i'm not sure.
If you need a good register you can use the plugin sfApply (register with 
email, forgot password, edit profile... and so and so)


> Date: Mon, 9 Mar 2009 03:16:31 -0700
> Subject: [symfony-users] Re: sfGuard - how can I make default is_active = 0 ?
> From: aaabbbcccda...@gmail.com
> To: symfony-users@googlegroups.com
> 
> 
> I don't know which version - I am new in Symfony :D I installed
> sfDoctrineGuardPlugin 4. days ago using: php symfony plugin:install
> sfDoctrineGuardPlugin.
> I am making it in RegistrationForm.class.php and I have an error:
> Fatal error: Call to undefined method RegistrationForm::setIsActive()
> in C:\Program Files\WebServ\httpd\sf_sandbox\apps\frontend\modules
> \registration\lib\RegistrationForm.class.php on line 85
> What is going on ?? :O
> 
> 
> 
> 
> On 9 Mar, 11:07, Gregoire Laporte  wrote:
> > and with
> > $this->setIsActive(0);Which Release of this plugin have you? (1.2?) and 
> > which file do you edit cause i haven't this code.
> >
> >
> >
> > > Date: Mon, 9 Mar 2009 03:00:32 -0700
> > > Subject: [symfony-users] Re: sfGuard - how can I make default is_active = 
> > > 0 ?
> > > From: aaabbbcccda...@gmail.com
> > > To: symfony-users@googlegroups.com
> >
> > > Is it something like that: ?? But it doesn't work. :/
> >
> > > class RegistrationForm extends sfGuardUserForm
> > > {
> >
> > > public function save($con = null)
> > >   {
> >
> > >$this->setIsActive(false);
> > >return parent::save($con);
> >
> > >   }
> >
> > >  public function configure()
> > >  {
> > >unset(
> > >  $this['id'],
> > >  $this['is_active'],
> > >  $this['is_super_admin'],
> > >  $this['updated_at'],
> > >  $this['groups_list'],
> > >  $this['permissions_list'],
> > >  $this['last_login'],
> > >  $this['created_at'],
> > >  $this['salt'],
> > >  $this['algorithm']
> > >);
> >
> > >$this->widgetSchema['password'] = new sfWidgetFormInputPassword
> > > ();
> > >$this->widgetSchema['password_confirmation'] = new
> > > sfWidgetFormInputPassword();
> > >$this->widgetSchema['name'] = new sfWidgetFormInput();
> > >$this->widgetSchema['surname'] = new sfWidgetFormInput();
> > >$this->widgetSchema['email'] = new sfWidgetFormInput();
> >
> > > //validators. I deleted them - code will be too long
> >
> > >  }
> >
> > > }
> >
> > > On 9 Mar, 10:43, Gregoire Laporte  wrote:
> > > > i think you need to change the save method in 
> > > > /plugin/sfGuardPlugin/lib/model/pluginSfGuardUser.class.php!
> >
> > > > > Date: Mon, 9 Mar 2009 02:35:31 -0700
> > > > > Subject: [symfony-users] Re: sfGuard - how can I make default 
> > > > > is_active = 0 ?
> > > > > From: aaabbbcccda...@gmail.com
> > > > > To: symfony-users@googlegroups.com
> >
> > > > > Hugo Hamon I don't understand you - what do you mean ? :)
> >
> > > > > Gregorie Laporte - you have right . strange.. I hope
> > > > > somebody will correct this in the future ?
> >
> > > > > On 9 Mar, 10:26, Gregoire Laporte  wrote:
> > > > > > But you can notice that even is_active == 0 ,the user can connect !!
> > > > > > It's a bug i think !
> >
> > > > > > > Date: Mon, 9 Mar 2009 02:12:32 -0700
> > > > > > > Subject: [symfony-users] Re: sfGuard - how can I make default 
> > > > > > > is_active = 0 ?
> > > > > > > From: webmas...@apprendre-php.com
> > > > > > > To: symfony-users@googlegroups.com
> >
> > > > > > > You have to override the save() method of your form to force the
> > > > > > > setIsActive(false) inside. The code you have put in your action 
> > > > > > > does
> > > > > > > not belong to the controller but to the model, so let's move it 
> > > > > > > in the
> > > > > > > save method of your form.
> >
> > > > > > _
> > > > > > Téléphonez gratuitement à tous vos proches avec Windows Live 
> > > > > > Messenger  !  Téléchargez-le maintenant 
> > > > > > !http://www.windowslive.fr/messenger/1.asp
> >
> > > > _
> > > > Découvrez toutes les possibilités de communication avec vos 
> > > > procheshttp://www.microsoft.com/windows/windowslive/default.aspx
> >
> > _
> > Inédit ! Des Emoticônes Déjantées! Installez les dans votre Messenger 
> > !http://www.ilovemessenger.fr/Emoticones/EmoticonesDejantees.aspx
> > 

_
Inédit ! Des Emoticônes Déjantées! Installez les dans votre Messenger ! 
http://www.ilovemessenger.fr/Emoticones/EmoticonesDejantees.aspx
--~--~-~--~~~---~--~~
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

[symfony-users] Re: sfGuard - how can I make default is_active = 0 ?

2009-03-09 Thread dziobacz

I have changed file action.class.php:
$user = new sfGuardUser();
$uuser->setUsername($this->form->getValue('username'));
$user->setPassword($this->form->getValue('password'));
$user->setIsActive(0);
$user->save();

so I have:

class registrationActions extends sfActions
{

 public function executeIndex(sfWebRequest $request)
 {
   $this->form = new RegistrationForm();
 if ($request->isMethod('post'))
 {
   $this->form->bind($request->getParameter('sf_guard_user'));
   if ($this->form->isValid())
   {

   $conn = Doctrine_Manager::connection();

   $conn->beginTransaction();
   try
   {
   $user = new sfGuardUser();
$uuser->setUsername($this->form->getValue('username'));
$user->setPassword($this->form->getValue('password'));
$user->setIsActive(0);
$user->save();

$profil = new SfGuardUserProfile();
   $profil -> setUserId($user->getId());
   $profil -> setName($this->form->getValue('name'));
   $profil -> setSurname($this->form->getValue
('surname'));
   $profil -> setEmail($this->form->getValue('email'));
   $profil -> save();

   $conn->commit();
   }
   catch (Exception $e)
 {
   $conn->rollBack();
   throw $e;
 }

   }
 }
 }

AND IT WORKS   xD THX for help everybody ! But after
registration I can still log in - bad bug :/ Maybe I should write
somewhere about that ?
--~--~-~--~~~---~--~~
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] Need help with generated classes form filters

2009-03-09 Thread jarod51

Hi

I have an index with a pager. I would like to use generated form
filters to filter my pager (like in admin generator bu in frontend)

I don't know where to start, and i don't find documentation about
this. I'm sure this is pretty simple.

I have now my pager object and my form "objectFormFilter", how do i
make them talk to each other ?

Thank you
--~--~-~--~~~---~--~~
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: Symfony Production Performance improvements

2009-03-09 Thread Gareth McCumskey
I just tried using Propel 1.3 on our application and while I would love to
continue using it (as it seemed to produce a little more efficieny) we can't
use it for now because the servers that the app will run on are Centos 4
with PHP 5.1.x as its maximum version for now. The sysadmins here say that
to force an upgrade to 5.2.x would be a hard task as to retain RedHat
support it means they would need to upgrade to Centos 5.

I am currently looking at the chapter about Optimising symfony and the
function cache seems to be something we cna consider doing in a lot of our
model calls from the action to help speed things up, especially for model
methods that access historical data (i.e. stuff dated in the past that
obviously wont change on subsequent calls) but these are relatively large
coding changes which we will probably only do during our beta development
phase.

I am still looking through more advise recieved from this post and I have to
thank everyone for their input. I honestly didn't expect this response and
it has been fantastic and very helpful.

On Mon, Mar 9, 2009 at 12:49 AM, Crafty_Shadow  wrote:

>
> Symfony 1.1 came by default with Propel 1.2
> You can try upgrading to 1.3 (it isn't really a trivial task, but it
> shouldn't be a big problem)
> There is thorough explanation on the symfony site how to do it:
> http://www.symfony-project.org/cookbook/1_1/en/propel_13
> It should fare a measurable increase in performance. Also, a site that
> makes good use of cache should have caching for absolutely everything
> not session-dependent. I find it hard to imagine a php app, no matter
> how fast, that would run faster than symfony's cached output.
>
> Alvaro:
> Is your plugin based on Propel 1.3?
> If you believe you have made significant improvements to Propel, why
> not suggest them for version 2.0, which is still under heavy
> development?
>
> On Mar 8, 4:33 pm, alvaro  wrote:
> > At the company I developed a symfony plugin to optimize the Propel
> > queries and also the Propel hydrate method, improving even 5 times
> > query speed and also memory usage.
> >
> > The plugins supports joins and thanks to PHP features the plugin
> > returns Propel objects populated with custom AS columns.
> >
> > We are thinking on release it on the following weeks so stay tuned :)
> >
> > Regards,
> >
> > Alvaro
> >
> > On Mar 8, 2009, at 10:20 PM, Gareth McCumskey wrote:
> >
> > > We have put numerous caching techniques into effect, from Cache-
> > > Expires headers to compression of static files like js and html
> > > files. Currently we use symfony 1.1 and Propel as the ORM. We have
> > > identified the bottleneck generally as being the application
> > > processing after the db queries have run to extract the data.
> >
> > > The entire point of my question was to get some info on general tips
> > > and tricks we can try out to see if anything helps or if perhaps we
> > > have missed any obvious issues that may actually be the cause of the
> > > slow performance we are getting. As it is I have gotten quite a few
> > > and look forward to getting into the office tomorrow to try them
> > > out. Anymore is greatly appreciated.
> >
> > > Of course I am looking through the code to see if there is anyway we
> > > can streamline it on that end, but every little bit helps.
> >
> > > Gareth
> >
> > > On Sun, Mar 8, 2009 at 12:27 PM, Crafty_Shadow 
> > > wrote:
> >
> > > Gareth, you didn't mention what version of symfony you were using,
> > > also what ORM (if any).
> > > The best course of optimization will depend on those. Also, as already
> > > mentioned, caching is your best friend.
> >
> > > On Mar 8, 9:43 am, Gareth McCumskey  wrote:
> > > > Well, consider a single database table that looks something like
> > > this:
> >
> > > > From_address
> > > > to_address (possibly multiple addresses comma-seperated)
> > > > headers
> > > > spam_report
> > > > subject
> >
> > > > And we would have millions of those records in the database.
> > > Repeated
> > > > entries, especially on to_address, means the data is hugely
> > > redundant. By
> > > > normalising we are turning a text search across millions of
> > > records with
> > > > redundant repeated data into a text search over a unique list,
> > > then an
> > > > integer search over primary key (which of course is indexed).
> >
> > > > On Sun, Mar 8, 2009 at 9:37 AM, Lawrence Krubner
> > > wrote:
> >
> > > > > On Mar 8, 3:26 am, Gareth McCumskey  wrote:
> > > > > > We had a speed increase because we had a lot of text searches
> > > in the old
> > > > > > system, all going through text fields where the same values
> > > were repeated
> > > > > > over and over. Its therefore a lot faster to search a much
> > > smaller table,
> > > > > > where the text fields are unique, and find the value once,
> > > then use an ID
> > > > > > comparison, being much faster to match integers than text.
> >
> > > > > In sounds like you got a speed boost from doing intelligent
> > > indexing.
> > > >

[symfony-users] Re: sfGuard - how can I make default is_active = 0 ?

2009-03-09 Thread Gregoire Laporte

yes !!
Look here 
http://trac.symfony-project.org/ticket/5891

Good luck :p

> Date: Mon, 9 Mar 2009 03:38:50 -0700
> Subject: [symfony-users] Re: sfGuard - how can I make default is_active = 0 ?
> From: aaabbbcccda...@gmail.com
> To: symfony-users@googlegroups.com
> 
> 
> I have changed file action.class.php:
> $user = new sfGuardUser();
> $uuser->setUsername($this->form->getValue('username'));
> $user->setPassword($this->form->getValue('password'));
> $user->setIsActive(0);
> $user->save();
> 
> so I have:
> 
> class registrationActions extends sfActions
> {
> 
>  public function executeIndex(sfWebRequest $request)
>  {
>$this->form = new RegistrationForm();
>  if ($request->isMethod('post'))
>  {
>$this->form->bind($request->getParameter('sf_guard_user'));
>if ($this->form->isValid())
>{
> 
>$conn = Doctrine_Manager::connection();
> 
>$conn->beginTransaction();
>try
>{
>$user = new sfGuardUser();
>   $uuser->setUsername($this->form->getValue('username'));
>   $user->setPassword($this->form->getValue('password'));
>   $user->setIsActive(0);
>   $user->save();
> 
> $profil = new SfGuardUserProfile();
>$profil -> setUserId($user->getId());
>$profil -> setName($this->form->getValue('name'));
>$profil -> setSurname($this->form->getValue
> ('surname'));
>$profil -> setEmail($this->form->getValue('email'));
>$profil -> save();
> 
>$conn->commit();
>}
>catch (Exception $e)
>  {
>$conn->rollBack();
>throw $e;
>  }
> 
>}
>  }
>  }
> 
> AND IT WORKS   xD THX for help everybody ! But after
> registration I can still log in - bad bug :/ Maybe I should write
> somewhere about that ?
> > 

_
Téléphonez gratuitement à tous vos proches avec Windows Live Messenger  !  
Téléchargez-le maintenant ! 
http://www.windowslive.fr/messenger/1.asp
--~--~-~--~~~---~--~~
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: I18n forms - not everything translated

2009-03-09 Thread Tomasz Ignatiuk
It works and it is great. Thank you :)

2009/3/6 Shinkan 

>
> You have to use the helper trough the sfContext object.
>
> From everywhere :
>
> sfContext::getInstance()->getI18N()->__('The flash message');
>
> So from an action :
>
> $this->getUser()->setFlash('flash', sfContext::getInstance()->getI18N
> ()->__('The flash message') );
>
> To minimify, you can put a protected function in your action, or
> better, in an external tools class.
> Something like :
>
> public static function i18n( $message ) {
>  return sfContext::getInstance()->getI18N()->__( $message );
> }
>
> On 6 mar, 15:23, Tomasz Ignatiuk  wrote:
> > Does anyone know how to translate setFlash notices and erros? A put
> > translation in my message.pl.xml file but it doesn't 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: sfGuard - how can I make default is_active = 0 ?

2009-03-09 Thread dziobacz

WOW - now it works - thx you so much !! :P



On 9 Mar, 11:45, Gregoire Laporte  wrote:
> yes !!
> Look herehttp://trac.symfony-project.org/ticket/5891
>
> Good luck :p
>
>
>
> > Date: Mon, 9 Mar 2009 03:38:50 -0700
> > Subject: [symfony-users] Re: sfGuard - how can I make default is_active = 0 
> > ?
> > From: aaabbbcccda...@gmail.com
> > To: symfony-users@googlegroups.com
>
> > I have changed file action.class.php:
> > $user = new sfGuardUser();
> > $uuser->setUsername($this->form->getValue('username'));
> > $user->setPassword($this->form->getValue('password'));
> > $user->setIsActive(0);
> > $user->save();
>
> > so I have:
>
> > class registrationActions extends sfActions
> > {
>
> >  public function executeIndex(sfWebRequest $request)
> >  {
> >    $this->form = new RegistrationForm();
> >      if ($request->isMethod('post'))
> >      {
> >        $this->form->bind($request->getParameter('sf_guard_user'));
> >        if ($this->form->isValid())
> >        {
>
> >            $conn = Doctrine_Manager::connection();
>
> >            $conn->beginTransaction();
> >            try
> >            {
> >                $user = new sfGuardUser();
> >                    $uuser->setUsername($this->form->getValue('username'));
> >                    $user->setPassword($this->form->getValue('password'));
> >                    $user->setIsActive(0);
> >                    $user->save();
>
> >                 $profil = new SfGuardUserProfile();
> >                $profil -> setUserId($user->getId());
> >                $profil -> setName($this->form->getValue('name'));
> >                $profil -> setSurname($this->form->getValue
> > ('surname'));
> >                $profil -> setEmail($this->form->getValue('email'));
> >                $profil -> save();
>
> >                $conn->commit();
> >            }
> >            catch (Exception $e)
> >              {
> >                $conn->rollBack();
> >                throw $e;
> >              }
>
> >        }
> >      }
> >  }
>
> > AND IT WORKS   xD THX for help everybody ! But after
> > registration I can still log in - bad bug :/ Maybe I should write
> > somewhere about that ?
>
> _
> Téléphonez gratuitement à tous vos proches avec Windows Live Messenger  !  
> Téléchargez-le maintenant ! http://www.windowslive.fr/messenger/1.asp
--~--~-~--~~~---~--~~
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: sfGuard - how can I make default is_active = 0 ?

2009-03-09 Thread isleshocky77

Of lately I've been all about putting everything in the model, it just
makes all the code cleaner.  Anyways, if you're going to want users to
be set as inactive by default more than active you might want to think
about making that field default to false.  Then you would only have to
handle it in the forms which you would actually want the user to be
active.

This can be done by overriding the setTableDefinition method really
easily:

{{{
#/lib/model/doctrine/sfDoctrineGuardPlugin/sfGuardUser.class.php

class sfGuardUser extends PluginsfGuardUser
{
public function setTableDefinition()
{
parent::setTableDefinition();
$this->hasColumn('is_active', 'boolean', null, array('type' =>
'boolean', 'default' => '0'));
}

}
}}}

--
Stephen Ostrow 

On Mar 9, 3:59 am, dziobacz  wrote:
> I am making registration users. I have tried change column is_active
> in table sf_guard_user to default value=0 but still after registration
> new user has is_active=1. What should I do ? It is my code:
>
> First file:
>
> class RegistrationForm extends sfGuardUserForm
> {
>  public function configure()
>  {
>    unset(
>      $this['id'],
>      $this['is_active'],
>      $this['is_super_admin'],
>      $this['updated_at'],
>      $this['groups_list'],
>      $this['permissions_list'],
>      $this['last_login'],
>      $this['created_at'],
>      $this['salt'],
>      $this['algorithm']
>    );
>
>        $this->widgetSchema['password'] = new sfWidgetFormInputPassword
> ();
>        $this->widgetSchema['password_confirmation'] = new
> sfWidgetFormInputPassword();
>    $this->widgetSchema['name'] = new sfWidgetFormInput();
>    $this->widgetSchema['surname'] = new sfWidgetFormInput();
>    $this->widgetSchema['email'] = new sfWidgetFormInput();
>
> //validators. I deleted them - code will be too long
>
>  }
>
> }
>
> Second file:
>
> class registrationActions extends sfActions
> {
>
>  public function executeIndex(sfWebRequest $request)
>  {
>    $this->form = new RegistrationForm();
>      if ($request->isMethod('post'))
>      {
>        $this->form->bind($request->getParameter('sf_guard_user'));
>        if ($this->form->isValid())
>        {
>
>            $conn = Doctrine_Manager::connection();
>
>            $conn->beginTransaction();
>            try
>            {
>                $user = $this->form->save();
>
>                 $profil = new SfGuardUserProfile();
>                $profil -> setUserId($user->getId());
>                $profil -> setName($this->form->getValue('name'));
>                $profil -> setSurname($this->form->getValue
> ('surname'));
>                $profil -> setEmail($this->form->getValue('email'));
>                $profil -> save();
>
>                $conn->commit();
>            }
>            catch (Exception $e)
>              {
>                $conn->rollBack();
>                throw $e;
>              }
>
>        }
>      }
>  }
>
> }
--~--~-~--~~~---~--~~
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] Bind Session(user) between backend and frontend

2009-03-09 Thread saturn1...@hotmail.com

Hello, i have a problem with my session.
I use sfGuardPlugin.
I have 2 apps: backend,frontend.
When i log myself in the frontend, i can't go to the backend without
relog myself.
It's the same when i log mysel in the backend i need to relog me in
the frontend to be loggued.

Could you help myself?
Thx =)
--~--~-~--~~~---~--~~
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] sfSimpleForum , i lost forum_navigation somehow

2009-03-09 Thread Guychmyrat Amanmyradov
Hello.

When i install sfSimpleForumPlugin 


  


was working. I worked on sfSimpleForum a lot.
And now, when i try 

  


nothing happens. What did i wrong ? How can i correct ?
Thank you.



  ___
Yahoo! Türkiye açıldı!  http://yahoo.com.tr
İnternet üzerindeki en iyi içeriği Yahoo! Türkiye sizlere sunuyor!
--~--~-~--~~~---~--~~
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: Symfony Production Performance improvements

2009-03-09 Thread Sumedh

My 2 cents...slow query log in mysql should help a lot...

Please let us know your insights at the end of your exercise... :)

On Mar 9, 3:41 pm, Gareth McCumskey  wrote:
> I just tried using Propel 1.3 on our application and while I would love to
> continue using it (as it seemed to produce a little more efficieny) we can't
> use it for now because the servers that the app will run on are Centos 4
> with PHP 5.1.x as its maximum version for now. The sysadmins here say that
> to force an upgrade to 5.2.x would be a hard task as to retain RedHat
> support it means they would need to upgrade to Centos 5.
>
> I am currently looking at the chapter about Optimising symfony and the
> function cache seems to be something we cna consider doing in a lot of our
> model calls from the action to help speed things up, especially for model
> methods that access historical data (i.e. stuff dated in the past that
> obviously wont change on subsequent calls) but these are relatively large
> coding changes which we will probably only do during our beta development
> phase.
>
> I am still looking through more advise recieved from this post and I have to
> thank everyone for their input. I honestly didn't expect this response and
> it has been fantastic and very helpful.
>
> On Mon, Mar 9, 2009 at 12:49 AM, Crafty_Shadow  wrote:
>
> > Symfony 1.1 came by default with Propel 1.2
> > You can try upgrading to 1.3 (it isn't really a trivial task, but it
> > shouldn't be a big problem)
> > There is thorough explanation on the symfony site how to do it:
> >http://www.symfony-project.org/cookbook/1_1/en/propel_13
> > It should fare a measurable increase in performance. Also, a site that
> > makes good use of cache should have caching for absolutely everything
> > not session-dependent. I find it hard to imagine a php app, no matter
> > how fast, that would run faster than symfony's cached output.
>
> > Alvaro:
> > Is your plugin based on Propel 1.3?
> > If you believe you have made significant improvements to Propel, why
> > not suggest them for version 2.0, which is still under heavy
> > development?
>
> > On Mar 8, 4:33 pm, alvaro  wrote:
> > > At the company I developed a symfony plugin to optimize the Propel
> > > queries and also the Propel hydrate method, improving even 5 times
> > > query speed and also memory usage.
>
> > > The plugins supports joins and thanks to PHP features the plugin
> > > returns Propel objects populated with custom AS columns.
>
> > > We are thinking on release it on the following weeks so stay tuned :)
>
> > > Regards,
>
> > > Alvaro
>
> > > On Mar 8, 2009, at 10:20 PM, Gareth McCumskey wrote:
>
> > > > We have put numerous caching techniques into effect, from Cache-
> > > > Expires headers to compression of static files like js and html
> > > > files. Currently we use symfony 1.1 and Propel as the ORM. We have
> > > > identified the bottleneck generally as being the application
> > > > processing after the db queries have run to extract the data.
>
> > > > The entire point of my question was to get some info on general tips
> > > > and tricks we can try out to see if anything helps or if perhaps we
> > > > have missed any obvious issues that may actually be the cause of the
> > > > slow performance we are getting. As it is I have gotten quite a few
> > > > and look forward to getting into the office tomorrow to try them
> > > > out. Anymore is greatly appreciated.
>
> > > > Of course I am looking through the code to see if there is anyway we
> > > > can streamline it on that end, but every little bit helps.
>
> > > > Gareth
>
> > > > On Sun, Mar 8, 2009 at 12:27 PM, Crafty_Shadow 
> > > > wrote:
>
> > > > Gareth, you didn't mention what version of symfony you were using,
> > > > also what ORM (if any).
> > > > The best course of optimization will depend on those. Also, as already
> > > > mentioned, caching is your best friend.
>
> > > > On Mar 8, 9:43 am, Gareth McCumskey  wrote:
> > > > > Well, consider a single database table that looks something like
> > > > this:
>
> > > > > From_address
> > > > > to_address (possibly multiple addresses comma-seperated)
> > > > > headers
> > > > > spam_report
> > > > > subject
>
> > > > > And we would have millions of those records in the database.
> > > > Repeated
> > > > > entries, especially on to_address, means the data is hugely
> > > > redundant. By
> > > > > normalising we are turning a text search across millions of
> > > > records with
> > > > > redundant repeated data into a text search over a unique list,
> > > > then an
> > > > > integer search over primary key (which of course is indexed).
>
> > > > > On Sun, Mar 8, 2009 at 9:37 AM, Lawrence Krubner
> > > > wrote:
>
> > > > > > On Mar 8, 3:26 am, Gareth McCumskey  wrote:
> > > > > > > We had a speed increase because we had a lot of text searches
> > > > in the old
> > > > > > > system, all going through text fields where the same values
> > > > were repeated
> > > > > > > over and over. Its therefor

[symfony-users] Retrieve data from filter to sfView at once

2009-03-09 Thread santail

Is it possible to gather some data in filter and display result in
template without calling any actions ?
--~--~-~--~~~---~--~~
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: what is the best way to enable JQuery in Symfony?

2009-03-09 Thread sachin jain
Hi I need simple symfony project ..?

apart from that provided by symfony site ..

can any body help on me on this ?


On Mon, Mar 9, 2009 at 1:43 PM, Lee Bolding  wrote:

>
> and - ofcourse - cleared your cache? ;)
>
> On 9 Mar 2009, at 01:59, prodigital...@vectrbas-d.com wrote:
>
> >
> >
> >> Hmm. Okay. I copy and pasted what you have here to /apps/frontend/
> >> config/view.yml.  I still get nothing in layout.php. And I mean, I
> >> get
> >> a blank line, no HTML.
> >>
> >> Again, I'm trying to avoid setting a value in any action.
> >
> > Then youve done something wrong because that is the way its done.
> > Did you
> > make sure youre indentation was ok in the view.yml (especially since
> > you
> > c&p'ed)?
> >
> > Do you have a view.yml set up on the module youre testing with? Does
> > it
> > have values for the the javascripts key? they may be overriding it.
> > Also
> > did you make sure you got rid of any of your hacks that might
> > influence
> > this?
> >
> >
> > >
>
>
> >
>

--~--~-~--~~~---~--~~
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] sfWidgetFormSelectDoubleList and ajax

2009-03-09 Thread maestro

Greetings all,

I'd appreciate some help on the following. I have a problem using
sfWidgetFormSelectDoubleList from the sfFormExtraPlugin plugin on a
form that uses jq_submit_to_remote. sfWidgetFormSelectDoubleList uses
a javascript, that hooks on the submit event, that select the items in
the "associated" select box before doing the submission. Now, the
problem is, with jq_submit_to_remote there is no firing of onsubmit
event (correct me if am wrong) hence no firing of the
sfWidgetFormSelectDoubleList function. Can we say that this widget is
not meant to be used with remote submit? Is there a work around this?

I tried to modify the js to this, but it doesn't work due to the order
in which the event listeners are called. Any help would be
appreciated.

I find the plugin pretty useful but I feel that it can use some more
work to realize its full potential.

cheers,


var sfDoubleList =
{
  init: function(id, className, ajax_submit)
  {
form = sfDoubleList.get_current_form(id);
if(ajax_submit)
{
  //doesn't work on ajax submit where there is no actual submit
event
  //get submit button element
  submit_button = sfDoubleList.get_submit(form);
}

callback = function() {sfDoubleList.submit(form, className); };

if(ajax_submit)
{
  elem = submit_button;
  event_name = "click";
}  else {
  elem = form;
  event_name = "submit";
}

if (elem.addEventListener)
{
  elem.addEventListener(event_name , callback, false);
}
else if (elem.attachEvent)
{
  var r = elem.attachEvent("on"+event_name, callback);
}
  },


--~--~-~--~~~---~--~~
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] Admin generator: actions per record

2009-03-09 Thread HAUSa

In the admin generator, is it possible to disable actions for specific
records?
So, by default, it is possible to remove a record. But for some
records (FK number 5 for example), removal is not 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: Bind Session(user) between backend and frontend

2009-03-09 Thread Yevgeniy A. Viktorov


The first of all, please, check frontend and backend factories and make
sure session_name is same in both.

p.s.
apps/frontend/config/factories.yml
apps/backend/config/factories.yml

Look for
session_name: symfony

saturn1...@hotmail.com wrote:
> Hello, i have a problem with my session.
> I use sfGuardPlugin.
> I have 2 apps: backend,frontend.
> When i log myself in the frontend, i can't go to the backend without
> relog myself.
> It's the same when i log mysel in the backend i need to relog me in
> the frontend to be loggued.
>
> Could you help myself?
> Thx =)
> >
>
>   

--~--~-~--~~~---~--~~
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: Admin generator: actions per record

2009-03-09 Thread Tomasz Ignatiuk

I don't think it is possible to do automatically.
You have to define someway which records can be deleted, for example
by a field in db

1. Copy _list.php from cache directory from your app module.
2. On foreach where the rows are echoed make an if which will say if
list_td_actions partial should be included for this row or not - this
will clear edit link.
3. In delete action you have to check if this record with this PK can
be deleted - because someone can trigger this action by a link.


--~--~-~--~~~---~--~~
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: Admin generator: actions per record

2009-03-09 Thread Alan Bem
Every AG generated module has *GeneratorConfiguration.class.php and
*GeneratorHelper.class.php classes.
I would look there first.

Cheers, Alan "LBO" Bem

On Mon, Mar 9, 2009 at 7:09 PM, Tomasz Ignatiuk wrote:

>
> I don't think it is possible to do automatically.
> You have to define someway which records can be deleted, for example
> by a field in db
>
> 1. Copy _list.php from cache directory from your app module.
> 2. On foreach where the rows are echoed make an if which will say if
> list_td_actions partial should be included for this row or not - this
> will clear edit link.
> 3. In delete action you have to check if this record with this PK can
> be deleted - because someone can trigger this action by a link.
>
>
> >
>

--~--~-~--~~~---~--~~
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] sfDoctrineGuard Plugin and Doctrine 1.1

2009-03-09 Thread isleshocky77

So I've been pulling my hair out for the past few days because I
couldn't figure out why the basic functionality of the sfGuardUser
module wouldn't work in my project. The form would return on save with
a validation error simply stating

"The item has not been saved due to some errors."

At first I had narrowed it down to it was failing on a missing unset
for updated_at which you would think would be at
http://trac.symfony-project.org/browser/plugins/sfGuardPlugin/branches/1.2/lib/form/sfGuardUserAdminForm.class.php#L19

That is the link to the sfGuardPlugin which is missing it as well.

I fixed this in my project and the form then attempted to save but
bombed with an error in doctrine with the link function.

So today I started from scratch, first testing the module with sf1.2
and propel. It worked fine.  Then I moved on to sf1.2 and doctrine,
and it worked fine.  Finally I added in the Doctrine 1.1 as explained
here:
http://www.symfony-project.org/blog/2009/01/12/call-the-expert-using-a-custom-version-of-doctrine

And that's where I duplicated the error message seen below.

I'm not sure why the missing unset doesn't affect the first two cases
as it really should.  The form should be expecting updated_at, but the
admin generator isn't displaying that form field.

But more importantly it looks like the link functionality is broken in
1.1 some how.

Any help with this issue would be greatly appreciated.

--
Stephen Ostrow 

--~--~-~--~~~---~--~~
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] Forms: add values onSave()

2009-03-09 Thread HAUSa

In my Propel generated form I added a field where people can type the
values of a many-to-many relationship, separated by a ";".

Now I'm changing the onSave() function of the form class, because
there I have to add the multiple values entered and add the generated
database id's to the default field for it.

This is my doSave() function in the form class:

public function doSave($con = null){

$aRelations = $this->getValue('link_page_keyword_list');

$aKeywords = array();
$aValues = explode(';', $this->getValue('keywords'));
foreach($aValues as $sKeyword){

$sKeyword = eregi_replace('[[:punct:]]|[[:cntrl:]]|^ +| 
+$', '',
$sKeyword);

if($sKeyword != ''){

$oKeyword = 
KeywordPeer::retrieveByTitle($sKeyword);
if(!$oKeyword){
$oKeyword = new Keyword();
$oKeyword->setTitle($sKeyword);
$oKeyword->save();
}

if(!in_array($oKeyword->getId(), $aRelations)) 
$aRelations[] =
$oKeyword->getId();

}

}

$this['link_page_keyword_list'] = $aRelations;

die(print_r($this->getValue('link_page_keyword_list')));

parent::doSave();

}



If I execute the form now, it says this:

500 | Internal Server Error | LogicException
Cannot update form fields.



Now, why is that, and how do I replace the link_page_keyword_list
values with my own values?
--~--~-~--~~~---~--~~
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: Symfony Production Performance improvements

2009-03-09 Thread Richtermeister

Hi Gareth,

after reading all this I feel your time is most likely best spent in
smart caching, since it sounds like the DB is not your bottleneck.
What's easy to overlook when working with symfony, is that compared to
straight procedural "get data -> display data" scripts, rendering
templates with hydrated objects is slower, albeit more flexible. So,
if your previous site was coded in a bad way, it was probably using a
lot of "view specific" code, so it's hard to compete with that on pure
speed considerations. The only way to mitigate that is by using all
forms of caching, and yes, this may include the function cache
(although I don't like it much). However, the "higher up" you can
cache, i.e. a complete action, the less you have to cache on the model
level.

Just my 2 cents. Good luck,
Daniel





On Mar 9, 8:42 am, Sumedh  wrote:
> My 2 cents...slow query log in mysql should help a lot...
>
> Please let us know your insights at the end of your exercise... :)
>
> On Mar 9, 3:41 pm, Gareth McCumskey  wrote:
>
> > I just tried using Propel 1.3 on our application and while I would love to
> > continue using it (as it seemed to produce a little more efficieny) we can't
> > use it for now because the servers that the app will run on are Centos 4
> > with PHP 5.1.x as its maximum version for now. The sysadmins here say that
> > to force an upgrade to 5.2.x would be a hard task as to retain RedHat
> > support it means they would need to upgrade to Centos 5.
>
> > I am currently looking at the chapter about Optimising symfony and the
> > function cache seems to be something we cna consider doing in a lot of our
> > model calls from the action to help speed things up, especially for model
> > methods that access historical data (i.e. stuff dated in the past that
> > obviously wont change on subsequent calls) but these are relatively large
> > coding changes which we will probably only do during our beta development
> > phase.
>
> > I am still looking through more advise recieved from this post and I have to
> > thank everyone for their input. I honestly didn't expect this response and
> > it has been fantastic and very helpful.
>
> > On Mon, Mar 9, 2009 at 12:49 AM, Crafty_Shadow  wrote:
>
> > > Symfony 1.1 came by default with Propel 1.2
> > > You can try upgrading to 1.3 (it isn't really a trivial task, but it
> > > shouldn't be a big problem)
> > > There is thorough explanation on the symfony site how to do it:
> > >http://www.symfony-project.org/cookbook/1_1/en/propel_13
> > > It should fare a measurable increase in performance. Also, a site that
> > > makes good use of cache should have caching for absolutely everything
> > > not session-dependent. I find it hard to imagine a php app, no matter
> > > how fast, that would run faster than symfony's cached output.
>
> > > Alvaro:
> > > Is your plugin based on Propel 1.3?
> > > If you believe you have made significant improvements to Propel, why
> > > not suggest them for version 2.0, which is still under heavy
> > > development?
>
> > > On Mar 8, 4:33 pm, alvaro  wrote:
> > > > At the company I developed a symfony plugin to optimize the Propel
> > > > queries and also the Propel hydrate method, improving even 5 times
> > > > query speed and also memory usage.
>
> > > > The plugins supports joins and thanks to PHP features the plugin
> > > > returns Propel objects populated with custom AS columns.
>
> > > > We are thinking on release it on the following weeks so stay tuned :)
>
> > > > Regards,
>
> > > > Alvaro
>
> > > > On Mar 8, 2009, at 10:20 PM, Gareth McCumskey wrote:
>
> > > > > We have put numerous caching techniques into effect, from Cache-
> > > > > Expires headers to compression of static files like js and html
> > > > > files. Currently we use symfony 1.1 and Propel as the ORM. We have
> > > > > identified the bottleneck generally as being the application
> > > > > processing after the db queries have run to extract the data.
>
> > > > > The entire point of my question was to get some info on general tips
> > > > > and tricks we can try out to see if anything helps or if perhaps we
> > > > > have missed any obvious issues that may actually be the cause of the
> > > > > slow performance we are getting. As it is I have gotten quite a few
> > > > > and look forward to getting into the office tomorrow to try them
> > > > > out. Anymore is greatly appreciated.
>
> > > > > Of course I am looking through the code to see if there is anyway we
> > > > > can streamline it on that end, but every little bit helps.
>
> > > > > Gareth
>
> > > > > On Sun, Mar 8, 2009 at 12:27 PM, Crafty_Shadow 
> > > > > wrote:
>
> > > > > Gareth, you didn't mention what version of symfony you were using,
> > > > > also what ORM (if any).
> > > > > The best course of optimization will depend on those. Also, as already
> > > > > mentioned, caching is your best friend.
>
> > > > > On Mar 8, 9:43 am, Gareth McCumskey  wrote:
> > > > > > Well, consider a single database table that look

[symfony-users] Update form values onSave()

2009-03-09 Thread HAUSa

In my Propel generated form I added a field where people can type the
values of a many-to-many relationship, separated by a ";".

Now I'm changing the onSave() function of the form class, because
there I have to add the multiple values entered and add the generated
database id's to the default field for it.

This is my doSave() function in the form class:

public function doSave($con = null){

$aRelations = $this->getValue('link_page_keyword_list');

$aKeywords = array();
$aValues = explode(';', $this->getValue('keywords'));
foreach($aValues as $sKeyword){

$sKeyword = eregi_replace('[[:punct:]]|[[:cntrl:]]|^ +| 
+$', '',
$sKeyword);

if($sKeyword != ''){

$oKeyword = 
KeywordPeer::retrieveByTitle($sKeyword);
if(!$oKeyword){
$oKeyword = new Keyword();
$oKeyword->setTitle($sKeyword);
$oKeyword->save();
}

if(!in_array($oKeyword->getId(), $aRelations)) 
$aRelations[] =
$oKeyword->getId();

}

}

$this['link_page_keyword_list'] = $aRelations;

die(print_r($this->getValue('link_page_keyword_list')));

parent::doSave();

}



If I execute the form now, it says this:

500 | Internal Server Error | LogicException
Cannot update form fields.



Now, why is that, and how do I replace the link_page_keyword_list
values with my own values?

--~--~-~--~~~---~--~~
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] Credentials in forms

2009-03-09 Thread HAUSa

Is it possible to use credentials in a form class? I want to hide
several form fields for users which do not have the right credentials.

--~--~-~--~~~---~--~~
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 set the date for sfWidgetFormDateTime?

2009-03-09 Thread tundrax

I have the same problem.
I am trying to set a default value for the datetime widget.

$years = range(date('Y'), date('Y') + 3);
$this->setWidget('starting_at', new sfWidgetFormDateTime(array(
  'date' => array(
'format' => '%year%年 %month%月 %day%日',
'can_be_empty' => false,
'years' => array_combine($years, $years)
),
  'format' => '%date% — %time%',
  'default' => date('Y/m/d H:i', time())
)));

Widget name 'starting_at' is exactly the same as a database table
field.
But when i rename the widget, default value is set fine.

--~--~-~--~~~---~--~~
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 set the date for sfWidgetFormDateTime?

2009-03-09 Thread tundrax

Setting a default vallue works only when I change the name of the
widget.
When the name is exactly the same with the field name in a database
table, it does not work.

$years = range(date('Y'), date('Y') + 3);
$this->setWidget('starting_at', new sfWidgetFormDateTime(array(
  'date' => array(
'format' => '%year%年 %month%月 %day%日',
'can_be_empty' => false,
'years' => array_combine($years, $years)
  ),
  'format' => '%date% — %time%',
  'default' => date('Y/m/d H:i', time())
)));

--~--~-~--~~~---~--~~
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] Setting default value for sfWidgetFormDateTime

2009-03-09 Thread tundrax

Setting a default value works only when I change the name of the
widget.
When the name is exactly the same with the field name in a database
table, it does not work.

$years = range(date('Y'), date('Y') + 3);
$this->setWidget('starting_at', new sfWidgetFormDateTime(array(
  'date' => array(
'format' => '%year%年 %month%月 %day%日',
'can_be_empty' => false,
'years' => array_combine($years, $years)
  ),
  'format' => '%date% — %time%',
  'default' => date('Y/m/d H:i', time())
)));

--~--~-~--~~~---~--~~
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 set a default value for a hidden input?

2009-03-09 Thread CyrilQ

Hello, i was surprised when reading that setDefault does not exist in
symfony 1.1.
I downloaded it and you are right, there is no setDefault on
sfWidgetSchema class, but i found one in sfForm :

  /**
   * Sets a default value for a form field.
   *
   * @param string $nameThe field name
   * @param mixed  $default The default value
   */
  public function setDefault($name, $default)
  {
$this->defaults[$name] = $default;

$this->resetFormFields();
  }

So maybe you should try using $this -> setDefault() in your form class
wich extends sfForm ?



On Mar 7, 3:26 am, Lawrence Krubner  wrote:
> On Mar 6, 7:39 am, Alan Bem  wrote:
>
> > Look at this example:
>
> > $this->setWidget('referer', new sfWidgetFormInputHidden());
> > $this->setDefault('referer',
> > sfContext::getInstance()->getRequest()->getReferer());
>
> Sorry, but that doesn't work. The "setDefault" method is only
> available in symfony 1.2. I'm trying to figure out how to do this in
> symfony 1.1.7
>
>
>
> > On Fri, Mar 6, 2009 at 1:16 PM, Lawrence Krubner 
> > wrote:
>
> > > I've tried this:
>
> > >   $this->widgetSchema['date'] = new sfWidgetFormInputHidden();
> > >   $this->widgetSchema['date']->setDefault(date("Y-m-d h:m:i"));
>
> > > but I get this error:
>
> > > Fatal error: Call to undefined method
> > > sfWidgetFormInputHidden::setDefault() in /home/lawrence/public_html/
> > > bocahoops/lib/form/NewNewsForm.class.php on line 32
>
> > > So I tried this:
>
> > >   $this->widgetSchema['date'] = new sfWidgetFormInputHidden(array(),
> > > array("value", date("Y-m-d h:m:i")));
>
> > > And that didn't work either.
>
> > > How do I set a default value on a hidden input?
>
> > > I'm using Symfony 1.1.7

--~--~-~--~~~---~--~~
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 install sfMediaLibraryPlugin and sfThumbnailPlugin in Symfony 1.2 project?

2009-03-09 Thread Big Al

I've been searching for an answer to this all day with no luck.

Can anyone help shed some light onto whether or not there is soon
going to be Symfony 1.2 compatible versions of sfMediaLibraryPlugin or
sfAssetsLibraryPlugin (or others)?

Thanks,
Al

On Mar 7, 4:12 am, Sid Bachtiar  wrote:
> Anyone got these two working for Symfony 1.2?
>
> --
> 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] symfony sandbox, error

2009-03-09 Thread newbiefornow

hi all, i'm newbie using symfony and i think it's a great framework,
however i'm getting stuck at this. I got installed the sandbox, and
whenever i try to generate a new project there is a sign that says
that "A project named "blog" already exists in this directory."
Evidently, this project actually doesn't exists, does anybody has any
idea how to correct this?

thanks beforehand

--~--~-~--~~~---~--~~
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] Object delete(), only by success

2009-03-09 Thread HAUSa

Hi everybody,

In one of my class models, I added an action on the delete() function:

public function delete(PropelPDO $oCon = null){

$aPages = PagePeer::doSelectFollowing($this->getRank(), $this-
>getPageId());
foreach($aPages as $oPage){
$oPage->setRank($oPage->getRank() - 1);
$oPage->save();
}

return parent::delete($oCon);

}

Now I have a problem. If the object the user is trying to delete is
restricted by a foreign key, the deletion doesn't take place. But, the
code here above is already executed!

Is there a way to prevent this from happening? That above code will
only be executed when the deletion actually will take place?
--~--~-~--~~~---~--~~
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] No se que hacer con esto mira adentro

2009-03-09 Thread gfirem

Descarge el symfony1.2.4.zip y no hacer nada con el. Por todos lados
me dice que tengo que instalarlo con pear y no tengo esa opcion
disponible. Diganme una via ayuda.

--~--~-~--~~~---~--~~
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] sfValidatorAnd - unable to set required message - symfony 1.2

2009-03-09 Thread Benjamin

In the following code I have tried to set the required message in 3
different places.  Regardless of where I put it I still receive the
standard message "Required.".  I was able to solve this in another
module by using a customized callback function rather than the
sfValidatorAnd class, however I feel that this should be working.  Is
this a bug or am I doing something wrong.

'user_name' => new sfValidatorAnd(array(
new sfValidatorString(
array(
'required'  => true,
'min_length'=> 3,
'max_length'=> 30,
),
array(
'required'  => 'A user name is required',
'min_length'=> 'User name is too short (%min_length
% characters minimum)',
'max_length'=> 'User name is too long (%max_length
% characters maximum)',
)),
new sfValidatorRegex(
array(
'pattern'   => '#^[a-z0-9_-]+$#i',
),
array(
'required'  => 'A user name is required',
'invalid'   => 'Your user name can only contain
the characters a to Z, 0 to 9, _ and -',
)),
), array(
'required' => 'A user name is required',
)
),

--~--~-~--~~~---~--~~
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: sfValidatorAnd - unable to set required message - symfony 1.2

2009-03-09 Thread Sid Bachtiar

Try to put "'required' => true" and required message on sfValidatorAnd
and not on the validators inside it.

On Tue, Mar 10, 2009 at 10:27 AM, Benjamin  wrote:
>
> In the following code I have tried to set the required message in 3
> different places.  Regardless of where I put it I still receive the
> standard message "Required.".  I was able to solve this in another
> module by using a customized callback function rather than the
> sfValidatorAnd class, however I feel that this should be working.  Is
> this a bug or am I doing something wrong.
>
> 'user_name' => new sfValidatorAnd(array(
>        new sfValidatorString(
>            array(
>                'required'      => true,
>                'min_length'    => 3,
>                'max_length'    => 30,
>            ),
>            array(
>                'required'      => 'A user name is required',
>                'min_length'    => 'User name is too short (%min_length
> % characters minimum)',
>                'max_length'    => 'User name is too long (%max_length
> % characters maximum)',
>            )),
>        new sfValidatorRegex(
>            array(
>                'pattern'       => '#^[a-z0-9_-]+$#i',
>            ),
>            array(
>                'required'      => 'A user name is required',
>                'invalid'       => 'Your user name can only contain
> the characters a to Z, 0 to 9, _ and -',
>            )),
>    ), array(
>            'required' => 'A user name is required',
>    )
> ),
>
> >
>



-- 
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: sfValidatorAnd - unable to set required message - symfony 1.2

2009-03-09 Thread Benjamin

Ok thank you Sid.  You were right.  Looking at a snippet at
http://snippets.symfony-project.org/snippets/tagged/login/order_by/date
I was able to format it correcty.  Is there any documentation that
tells you how these classes work.  The API documentation doesn't
appear to be very clear.

Here's a working example:

'user_name' => new sfValidatorAnd(array(
new sfValidatorString(
array(
'min_length'=> 3,
'max_length'=> 30,
),
array(
'min_length'=> 'User name is too short (%min_length
% characters minimum)',
'max_length'=> 'User name is too long (%max_length
% characters maximum)',
)),
new sfValidatorRegex(
array(
'pattern'   => '#^[a-z0-9_-]+$#i',
),
array(
'invalid'   => 'Your user name can only contain
the characters a to Z, 0 to 9, _ and -',
)),
), array(
'required' => true,
), array(
'required' => 'Please enter a user name',
)
),


On Mar 9, 4:55 pm, Sid Bachtiar  wrote:
> Try to put "'required' => true" and required message on sfValidatorAnd
> and not on the validators inside it.

> --
> 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] Access to Propel from custom class - "No connection information in your runtime configuration file for datasource"

2009-03-09 Thread tom cowin

I have a class outside of Symfony(but kept in lib/), and is referenced
from a Symfony action. The call to Propel::getConnection() doesn't
work as it appears that self::$configuration is not set. I get the
error message: "No connection information in your runtime
configuration file for datasource". Is there a standard way to set up/
include the configuration within this file/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
-~--~~~~--~~--~--~---



[symfony-users] Re: sfValidatorAnd - unable to set required message - symfony 1.2

2009-03-09 Thread Sid Bachtiar

> Is there any documentation that
> tells you how these classes work.  The API documentation doesn't
> appear to be very clear.

I don't know but I don't think it is in the documentation. I think I
found it out through snippets and looking at the source code.

On Tue, Mar 10, 2009 at 11:04 AM, Benjamin  wrote:
>
> Ok thank you Sid.  You were right.  Looking at a snippet at
> http://snippets.symfony-project.org/snippets/tagged/login/order_by/date
> I was able to format it correcty.  Is there any documentation that
> tells you how these classes work.  The API documentation doesn't
> appear to be very clear.
>
> Here's a working example:
>
> 'user_name' => new sfValidatorAnd(array(
>        new sfValidatorString(
>            array(
>                'min_length'    => 3,
>                'max_length'    => 30,
>            ),
>            array(
>                'min_length'    => 'User name is too short (%min_length
> % characters minimum)',
>                'max_length'    => 'User name is too long (%max_length
> % characters maximum)',
>            )),
>        new sfValidatorRegex(
>            array(
>                'pattern'       => '#^[a-z0-9_-]+$#i',
>            ),
>            array(
>                'invalid'       => 'Your user name can only contain
> the characters a to Z, 0 to 9, _ and -',
>            )),
>    ), array(
>            'required' => true,
>    ), array(
>            'required' => 'Please enter a user name',
>    )
> ),
>
>
> On Mar 9, 4:55 pm, Sid Bachtiar  wrote:
>> Try to put "'required' => true" and required message on sfValidatorAnd
>> and not on the validators inside it.
>
>> --
>> Blue Horn Ltd - System Developmenthttp://bluehorn.co.nz
> >
>



-- 
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] Drop down select boxes are not showing the current value

2009-03-09 Thread Lawrence Krubner

This is worrisome. I'm setting up a site to manage the teams in high
school basketball tournament in Florida. I've got two database tables:

  new_game:
_attributes: { idMethod: native }
id: { type: INTEGER, required: true, autoIncrement: true,
primaryKey: true }
location: { type: INTEGER, foreignTable: new_location,
foreignReference: id, required: true, default: '' }
date: { type: TIMESTAMP, default: '' }
team1: { type: INTEGER, foreignTable: new_team, foreignReference:
id, required: true, default: '' }
team2: { type: INTEGER, foreignTable: new_team, foreignReference:
id, required: true, default: '' }
team1_score: { type: INTEGER, default: '' }
team2_score: { type: INTEGER, default: '' }


  new_team:
_attributes: { idMethod: native }
id: { type: INTEGER, required: true, autoIncrement: true,
primaryKey: true }
teamname: { type: VARCHAR, size: '255' }
teamnumber: { type: INTEGER }
type: { type: VARCHAR, size: '255', required: true, default: '' }


So, as you can see, the game table is suppose to have two fields that
point to the team table. In the form class, both of these are set up
as drop down select boxes:

$this->setWidgets(array(
  'id'  => new sfWidgetFormInputHidden(),
  'location'=> new sfWidgetFormInput(),
  'date'=> new sfWidgetFormInput(),
  'team1'   => new sfWidgetFormPropelSelect(array('model' =>
'NewTeam', 'add_empty' => false)),
  'team2'   => new sfWidgetFormPropelSelect(array('model' =>
'NewTeam', 'add_empty' => false)),
  'team1_score' => new sfWidgetFormInput(),
  'team2_score' => new sfWidgetFormInput(),
));

Please note that I'm using Symfony 1.1, so some of the form widgets
from 1.2 are not available to me.

The game table is not showing the current values in the select boxes.
Is this normal behavior? Seems like a bug. For instance, I've one
entry where team1 has a value of 55, and team2 has a value of 145. I
implemented the __toString method in NewTeam, so that the user can see
the names of the teams:

  public function __toString()
  {
$locationList = NewLocationPeer::doSelect(new Criteria());
$arrayOfLocations = array();

foreach ($locationList as $location):
$id = $location->getId();
$name = $location->getName();

$arrayOfLocations[$id] = $name;
endforeach;

return $arrayOfLocations;
  }

Is this the correct way to implement the __toString method? I could
not find an example of how to do this in the docs.

When I'm creating a new entry in the game table, all works well. The
two drop down select boxes give me a list of all the teams. I choose
the names of the 2 teams who are playing the game, and then the ids
for those teams are put in the database. But when I'm editing an
existing entry, the drop down boxes don't show the current values.

For instance, in one entry, the two teams are these:

6th Man Club
The Beacon Group

But in the drop down select boxes, I only see the first team which
always appears:

The Carters
The Carters

What is going on here?
--~--~-~--~~~---~--~~
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] Bigger or smaller modules ?

2009-03-09 Thread Patrick Fong
Hi Guys,

 

I'm looking for a bit of guidance in the design on my application, mainly
how much to place in a particular module. The case that I am currently
looking at is my user module. As well as the standard, profile, credentials
etc, my user has preferences  and other properties but I am unsure whether
or not I should encapsulate crud for all of these user properties through
one big 'user' module/action or separate them out into separate
modules/actions 'user_profile', 'user_preferences' etc. Is there any
standard approach ?

 

Cheers,
Pat


--~--~-~--~~~---~--~~
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: Drop down select boxes are not showing the current value

2009-03-09 Thread Sid Bachtiar

What's your action code like? For editing...

On Tue, Mar 10, 2009 at 1:52 PM, Lawrence Krubner
 wrote:
>
> This is worrisome. I'm setting up a site to manage the teams in high
> school basketball tournament in Florida. I've got two database tables:
>
>  new_game:
>    _attributes: { idMethod: native }
>    id: { type: INTEGER, required: true, autoIncrement: true,
> primaryKey: true }
>    location: { type: INTEGER, foreignTable: new_location,
> foreignReference: id, required: true, default: '' }
>    date: { type: TIMESTAMP, default: '' }
>    team1: { type: INTEGER, foreignTable: new_team, foreignReference:
> id, required: true, default: '' }
>    team2: { type: INTEGER, foreignTable: new_team, foreignReference:
> id, required: true, default: '' }
>    team1_score: { type: INTEGER, default: '' }
>    team2_score: { type: INTEGER, default: '' }
>
>
>  new_team:
>    _attributes: { idMethod: native }
>    id: { type: INTEGER, required: true, autoIncrement: true,
> primaryKey: true }
>    teamname: { type: VARCHAR, size: '255' }
>    teamnumber: { type: INTEGER }
>    type: { type: VARCHAR, size: '255', required: true, default: '' }
>
>
> So, as you can see, the game table is suppose to have two fields that
> point to the team table. In the form class, both of these are set up
> as drop down select boxes:
>
>    $this->setWidgets(array(
>      'id'          => new sfWidgetFormInputHidden(),
>      'location'    => new sfWidgetFormInput(),
>      'date'        => new sfWidgetFormInput(),
>      'team1'       => new sfWidgetFormPropelSelect(array('model' =>
> 'NewTeam', 'add_empty' => false)),
>      'team2'       => new sfWidgetFormPropelSelect(array('model' =>
> 'NewTeam', 'add_empty' => false)),
>      'team1_score' => new sfWidgetFormInput(),
>      'team2_score' => new sfWidgetFormInput(),
>    ));
>
> Please note that I'm using Symfony 1.1, so some of the form widgets
> from 1.2 are not available to me.
>
> The game table is not showing the current values in the select boxes.
> Is this normal behavior? Seems like a bug. For instance, I've one
> entry where team1 has a value of 55, and team2 has a value of 145. I
> implemented the __toString method in NewTeam, so that the user can see
> the names of the teams:
>
>  public function __toString()
>  {
>        $locationList = NewLocationPeer::doSelect(new Criteria());
>    $arrayOfLocations = array();
>
>    foreach ($locationList as $location):
>                $id = $location->getId();
>                $name = $location->getName();
>
>                $arrayOfLocations[$id] = $name;
>    endforeach;
>
>    return $arrayOfLocations;
>  }
>
> Is this the correct way to implement the __toString method? I could
> not find an example of how to do this in the docs.
>
> When I'm creating a new entry in the game table, all works well. The
> two drop down select boxes give me a list of all the teams. I choose
> the names of the 2 teams who are playing the game, and then the ids
> for those teams are put in the database. But when I'm editing an
> existing entry, the drop down boxes don't show the current values.
>
> For instance, in one entry, the two teams are these:
>
> 6th Man Club
> The Beacon Group
>
> But in the drop down select boxes, I only see the first team which
> always appears:
>
> The Carters
> The Carters
>
> What is going on here?
> >
>



-- 
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: No se que hacer con esto mira adentro

2009-03-09 Thread alvaro

Hi,

This mailing list is english only.

Hola tendrías que buscar una lista de usuarios en español.
Busca en el sitio symfony.es

También en el sitio oficial de symfony podés encontrar todos los  
libros en español.

Saludos,

Álvaro
On Mar 10, 2009, at 4:45 AM, gfirem wrote:

>
> Descarge el symfony1.2.4.zip y no hacer nada con el. Por todos lados
> me dice que tengo que instalarlo con pear y no tengo esa opcion
> disponible. Diganme una via ayuda.
>
> >


--~--~-~--~~~---~--~~
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 customize sfGuard List

2009-03-09 Thread Herman Vega
On Thu, Mar 5, 2009 at 1:34 PM, Herman Vega  wrote:

>
>
> On Thu, Feb 19, 2009 at 10:47 PM, Henrique Boaventura <
> hboavent...@gmail.com> wrote:
>
>>
>> Hi,
>>
>> Anyone knows how to that off the filters panel that appears in the
>> user list of the sfGuard plugin?
>>
>
> Hi,
>
> You must edit the generator.yml file, located in config directory of your
> sfGuardUser module extension.
>
> This option:
>
> filter:
>   display: []
>

Also, u can try adding this in your css file : "#sf_admin_bar
{display:none;}"


>
> Regards,
>
>
>>
>> Henrique Boaventura
>> hboavent...@gmail.com
>> http://www.hboaventura.com
>>
>> >>
>>
>
>
> --
> Herman  Vega  Jara
> hvegax[a]gmail.com
>



-- 
Herman  Vega  Jara
hvegax[a]gmail.com

--~--~-~--~~~---~--~~
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: Credentials in forms

2009-03-09 Thread Herman Vega
On Mon, Mar 9, 2009 at 9:25 AM, HAUSa <
jeroen_heeft_behoefte_aan_r...@hotmail.com> wrote:

>
> Is it possible to use credentials in a form class? I want to hide
> several form fields for users which do not have the right credentials.
>

hasCredential('permission_edit')) :?>




>
> >
>


-- 
Herman  Vega  Jara
hvegax[a]gmail.com

--~--~-~--~~~---~--~~
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: Drop down select boxes are not showing the current value

2009-03-09 Thread Lawrence Krubner



On Mar 9, 9:13 pm, Sid Bachtiar  wrote:
> What's your action code like? For editing...


Good question. I haven't changed the code, it is the default generated
by the Propel crud generator:

  public function executeEdit($request)
  {
$this->form = new NewGameForm(NewGamePeer::retrieveByPk($request-
>getParameter('id')));
  }


Do I need to implement some magic to get the right values to the drop
down select boxes?




> On Tue, Mar 10, 2009 at 1:52 PM, Lawrence Krubner
>
>
>
>  wrote:
>
> > This is worrisome. I'm setting up a site to manage the teams in high
> > school basketball tournament in Florida. I've got two database tables:
>
> >  new_game:
> >    _attributes: { idMethod: native }
> >    id: { type: INTEGER, required: true, autoIncrement: true,
> > primaryKey: true }
> >    location: { type: INTEGER, foreignTable: new_location,
> > foreignReference: id, required: true, default: '' }
> >    date: { type: TIMESTAMP, default: '' }
> >    team1: { type: INTEGER, foreignTable: new_team, foreignReference:
> > id, required: true, default: '' }
> >    team2: { type: INTEGER, foreignTable: new_team, foreignReference:
> > id, required: true, default: '' }
> >    team1_score: { type: INTEGER, default: '' }
> >    team2_score: { type: INTEGER, default: '' }
>
> >  new_team:
> >    _attributes: { idMethod: native }
> >    id: { type: INTEGER, required: true, autoIncrement: true,
> > primaryKey: true }
> >    teamname: { type: VARCHAR, size: '255' }
> >    teamnumber: { type: INTEGER }
> >    type: { type: VARCHAR, size: '255', required: true, default: '' }
>
> > So, as you can see, the game table is suppose to have two fields that
> > point to the team table. In the form class, both of these are set up
> > as drop down select boxes:
>
> >    $this->setWidgets(array(
> >      'id'          => new sfWidgetFormInputHidden(),
> >      'location'    => new sfWidgetFormInput(),
> >      'date'        => new sfWidgetFormInput(),
> >      'team1'       => new sfWidgetFormPropelSelect(array('model' =>
> > 'NewTeam', 'add_empty' => false)),
> >      'team2'       => new sfWidgetFormPropelSelect(array('model' =>
> > 'NewTeam', 'add_empty' => false)),
> >      'team1_score' => new sfWidgetFormInput(),
> >      'team2_score' => new sfWidgetFormInput(),
> >    ));
>
> > Please note that I'm using Symfony 1.1, so some of the form widgets
> > from 1.2 are not available to me.
>
> > The game table is not showing the current values in the select boxes.
> > Is this normal behavior? Seems like a bug. For instance, I've one
> > entry where team1 has a value of 55, and team2 has a value of 145. I
> > implemented the __toString method in NewTeam, so that the user can see
> > the names of the teams:
>
> >  public function __toString()
> >  {
> >        $locationList = NewLocationPeer::doSelect(new Criteria());
> >    $arrayOfLocations = array();
>
> >    foreach ($locationList as $location):
> >                $id = $location->getId();
> >                $name = $location->getName();
>
> >                $arrayOfLocations[$id] = $name;
> >    endforeach;
>
> >    return $arrayOfLocations;
> >  }
>
> > Is this the correct way to implement the __toString method? I could
> > not find an example of how to do this in the docs.
>
> > When I'm creating a new entry in the game table, all works well. The
> > two drop down select boxes give me a list of all the teams. I choose
> > the names of the 2 teams who are playing the game, and then the ids
> > for those teams are put in the database. But when I'm editing an
> > existing entry, the drop down boxes don't show the current values.
>
> > For instance, in one entry, the two teams are these:
>
> > 6th Man Club
> > The Beacon Group
>
> > But in the drop down select boxes, I only see the first team which
> > always appears:
>
> > The Carters
> > The Carters
>
> > What is going on here?
>
> --
> 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: Bigger or smaller modules ?

2009-03-09 Thread Lawrence Krubner



On Mar 9, 9:05 pm, "Patrick Fong"  wrote:
> Hi Guys,
>
> I'm looking for a bit of guidance in the design on my application, mainly
> how much to place in a particular module. The case that I am currently
> looking at is my user module. As well as the standard, profile, credentials
> etc, my user has preferences  and other properties but I am unsure whether
> or not I should encapsulate crud for all of these user properties through
> one big 'user' module/action or separate them out into separate
> modules/actions 'user_profile', 'user_preferences' etc. Is there any
> standard approach ?


I've been wondering the same, mostly about apps. Apparenty most
developers prefer to have 2 apps:  a frontend and a backend. For my
first two symfony projects, I simply did these as two modules inside
of one app.

My current project has 27 database tables, so I created 27 modules. I
then created 2 extra modules: "dashboard" for the backend and
"content" for the frontend. I then grouped the 27 modules on the
dashboard. On the dashboard, I probably caused myself 30 minutes of
extra work, because I had to set security for each of the 27 modules
individually, instead of being able to lock them down at the level of
the app. Otherwise, I haven't seen much of a downside to keeping
everything in one app.

It would be good to know what is considered best practice in this
area. One of the main purposes of using framework like CakePHP or
symfony or Ruby On Rails is to have a project that works like other
projects. Especially where PHP is concerned, I think most large firms
are embracing frameworks as a way to escape the anarchy that was
previously associated with PHP projects.





--~--~-~--~~~---~--~~
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: Bigger or smaller modules ?

2009-03-09 Thread Sid Bachtiar

> I probably caused myself 30 minutes of
> extra work, because I had to set security for each of the 27 modules
> individually, instead of being able to lock them down at the level of
> the app.

Why couldn't you set it from security.yml of the app level?

In the apps/yourapp/config/security.yml you can write

default:
  security: on

And that will lock all modules in the app.

On Tue, Mar 10, 2009 at 4:04 PM, Lawrence Krubner
 wrote:
>
>
>
> On Mar 9, 9:05 pm, "Patrick Fong"  wrote:
>> Hi Guys,
>>
>> I'm looking for a bit of guidance in the design on my application, mainly
>> how much to place in a particular module. The case that I am currently
>> looking at is my user module. As well as the standard, profile, credentials
>> etc, my user has preferences  and other properties but I am unsure whether
>> or not I should encapsulate crud for all of these user properties through
>> one big 'user' module/action or separate them out into separate
>> modules/actions 'user_profile', 'user_preferences' etc. Is there any
>> standard approach ?
>
>
> I've been wondering the same, mostly about apps. Apparenty most
> developers prefer to have 2 apps:  a frontend and a backend. For my
> first two symfony projects, I simply did these as two modules inside
> of one app.
>
> My current project has 27 database tables, so I created 27 modules. I
> then created 2 extra modules: "dashboard" for the backend and
> "content" for the frontend. I then grouped the 27 modules on the
> dashboard. On the dashboard, I probably caused myself 30 minutes of
> extra work, because I had to set security for each of the 27 modules
> individually, instead of being able to lock them down at the level of
> the app. Otherwise, I haven't seen much of a downside to keeping
> everything in one app.
>
> It would be good to know what is considered best practice in this
> area. One of the main purposes of using framework like CakePHP or
> symfony or Ruby On Rails is to have a project that works like other
> projects. Especially where PHP is concerned, I think most large firms
> are embracing frameworks as a way to escape the anarchy that was
> previously associated with PHP projects.
>
>
>
>
>
> >
>



-- 
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: Drop down select boxes are not showing the current value

2009-03-09 Thread Sid Bachtiar

>  public function __toString()
>  {
>$locationList = NewLocationPeer::doSelect(new Criteria());
>$arrayOfLocations = array();
>
>foreach ($locationList as $location):
>$id = $location->getId();
>$name = $location->getName();
>
>$arrayOfLocations[$id] = $name;
>endforeach;
>
>return $arrayOfLocations;
>  }

The __toString function is supposed to return a string, not an array.
I think your code is returning an array.

Try:

public function __toString()
{
  return $this->getName(); // returns the new team name
}

On Tue, Mar 10, 2009 at 1:52 PM, Lawrence Krubner
 wrote:
>
> This is worrisome. I'm setting up a site to manage the teams in high
> school basketball tournament in Florida. I've got two database tables:
>
>  new_game:
>    _attributes: { idMethod: native }
>    id: { type: INTEGER, required: true, autoIncrement: true,
> primaryKey: true }
>    location: { type: INTEGER, foreignTable: new_location,
> foreignReference: id, required: true, default: '' }
>    date: { type: TIMESTAMP, default: '' }
>    team1: { type: INTEGER, foreignTable: new_team, foreignReference:
> id, required: true, default: '' }
>    team2: { type: INTEGER, foreignTable: new_team, foreignReference:
> id, required: true, default: '' }
>    team1_score: { type: INTEGER, default: '' }
>    team2_score: { type: INTEGER, default: '' }
>
>
>  new_team:
>    _attributes: { idMethod: native }
>    id: { type: INTEGER, required: true, autoIncrement: true,
> primaryKey: true }
>    teamname: { type: VARCHAR, size: '255' }
>    teamnumber: { type: INTEGER }
>    type: { type: VARCHAR, size: '255', required: true, default: '' }
>
>
> So, as you can see, the game table is suppose to have two fields that
> point to the team table. In the form class, both of these are set up
> as drop down select boxes:
>
>    $this->setWidgets(array(
>      'id'          => new sfWidgetFormInputHidden(),
>      'location'    => new sfWidgetFormInput(),
>      'date'        => new sfWidgetFormInput(),
>      'team1'       => new sfWidgetFormPropelSelect(array('model' =>
> 'NewTeam', 'add_empty' => false)),
>      'team2'       => new sfWidgetFormPropelSelect(array('model' =>
> 'NewTeam', 'add_empty' => false)),
>      'team1_score' => new sfWidgetFormInput(),
>      'team2_score' => new sfWidgetFormInput(),
>    ));
>
> Please note that I'm using Symfony 1.1, so some of the form widgets
> from 1.2 are not available to me.
>
> The game table is not showing the current values in the select boxes.
> Is this normal behavior? Seems like a bug. For instance, I've one
> entry where team1 has a value of 55, and team2 has a value of 145. I
> implemented the __toString method in NewTeam, so that the user can see
> the names of the teams:
>
>  public function __toString()
>  {
>        $locationList = NewLocationPeer::doSelect(new Criteria());
>    $arrayOfLocations = array();
>
>    foreach ($locationList as $location):
>                $id = $location->getId();
>                $name = $location->getName();
>
>                $arrayOfLocations[$id] = $name;
>    endforeach;
>
>    return $arrayOfLocations;
>  }
>
> Is this the correct way to implement the __toString method? I could
> not find an example of how to do this in the docs.
>
> When I'm creating a new entry in the game table, all works well. The
> two drop down select boxes give me a list of all the teams. I choose
> the names of the 2 teams who are playing the game, and then the ids
> for those teams are put in the database. But when I'm editing an
> existing entry, the drop down boxes don't show the current values.
>
> For instance, in one entry, the two teams are these:
>
> 6th Man Club
> The Beacon Group
>
> But in the drop down select boxes, I only see the first team which
> always appears:
>
> The Carters
> The Carters
>
> What is going on here?
> >
>



-- 
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: Bigger or smaller modules ?

2009-03-09 Thread Lawrence Krubner



On Mar 9, 11:11 pm, Sid Bachtiar  wrote:
> > I probably caused myself 30 minutes of
> > extra work, because I had to set security for each of the 27 modules
> > individually, instead of being able to lock them down at the level of
> > the app.
>
> Why couldn't you set it from security.yml of the app level?

Because I only had one app in the entire project, and it included the
public-facing portion of the site - the portion of the site that the
public was suppose to see. If I locked down the app, I'd also be
locking down the project, and I'd be cutting the public off from
seeing what they are suppose to see. I could then go through, one by
one, and open up those modules that the public should see, but that
would cost me about the same delay that doing it the opposite way also
cost me.

--- lawrence







>
> In the apps/yourapp/config/security.yml you can write
>
> default:
>   security: on
>
> And that will lock all modules in the app.
>
> On Tue, Mar 10, 2009 at 4:04 PM, Lawrence Krubner
>
>
>
>  wrote:
>
> > On Mar 9, 9:05 pm, "Patrick Fong"  wrote:
> >> Hi Guys,
>
> >> I'm looking for a bit of guidance in the design on my application, mainly
> >> how much to place in a particular module. The case that I am currently
> >> looking at is my user module. As well as the standard, profile, credentials
> >> etc, my user has preferences  and other properties but I am unsure whether
> >> or not I should encapsulate crud for all of these user properties through
> >> one big 'user' module/action or separate them out into separate
> >> modules/actions 'user_profile', 'user_preferences' etc. Is there any
> >> standard approach ?
>
> > I've been wondering the same, mostly about apps. Apparenty most
> > developers prefer to have 2 apps:  a frontend and a backend. For my
> > first two symfony projects, I simply did these as two modules inside
> > of one app.
>
> > My current project has 27 database tables, so I created 27 modules. I
> > then created 2 extra modules: "dashboard" for the backend and
> > "content" for the frontend. I then grouped the 27 modules on the
> > dashboard. On the dashboard, I probably caused myself 30 minutes of
> > extra work, because I had to set security for each of the 27 modules
> > individually, instead of being able to lock them down at the level of
> > the app. Otherwise, I haven't seen much of a downside to keeping
> > everything in one app.
>
> > It would be good to know what is considered best practice in this
> > area. One of the main purposes of using framework like CakePHP or
> > symfony or Ruby On Rails is to have a project that works like other
> > projects. Especially where PHP is concerned, I think most large firms
> > are embracing frameworks as a way to escape the anarchy that was
> > previously associated with PHP projects.
>
> --
> 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: Symfony Production Performance improvements

2009-03-09 Thread Gareth McCumskey
Thanks for that. I have actually been looking at the function cache amongst
others and there is a lot we can do there as our DB records, once inserted,
are not likely to change. In fact if they do it means we are having a
problem as we store email data for a number of companies in them. Therefore
function caching and even memory caching records as we extract them from db
would probably help us a lot. It does mean more work code-wise and isn't a
"quick-fix", so we plan to start looking at this once we hit Beta where
performance will be a major requirement.

The old system is faster simply because it follows no design pattern except
procedural and that is where its speed lies. There are no ORM's, classes or
anything like that, and SQL queries are sent straight through to the
database using handcoded, dynamic SQL queries as opposed to an ORM generated
one and the resultsets are manipulated directly in each "view". In fact
there are only views, there is little seperation of business logic and
presentation.

The reason we need symfony for this new version is that we are going to be
adding more advanced features that would "complicate" the product beyond
what a procedural style would allow us to maintain. We are already
struggling to keep the older system maintained and enhanced for our
customers as it is. symfony, Propel and even Prototype with scriptaculous
help alleviate these maintenance and extensibility issues.

On Mon, Mar 9, 2009 at 9:13 PM, Richtermeister  wrote:

>
> Hi Gareth,
>
> after reading all this I feel your time is most likely best spent in
> smart caching, since it sounds like the DB is not your bottleneck.
> What's easy to overlook when working with symfony, is that compared to
> straight procedural "get data -> display data" scripts, rendering
> templates with hydrated objects is slower, albeit more flexible. So,
> if your previous site was coded in a bad way, it was probably using a
> lot of "view specific" code, so it's hard to compete with that on pure
> speed considerations. The only way to mitigate that is by using all
> forms of caching, and yes, this may include the function cache
> (although I don't like it much). However, the "higher up" you can
> cache, i.e. a complete action, the less you have to cache on the model
> level.
>
> Just my 2 cents. Good luck,
> Daniel
>
>
>
>
>
> On Mar 9, 8:42 am, Sumedh  wrote:
> > My 2 cents...slow query log in mysql should help a lot...
> >
> > Please let us know your insights at the end of your exercise... :)
> >
> > On Mar 9, 3:41 pm, Gareth McCumskey  wrote:
> >
> > > I just tried using Propel 1.3 on our application and while I would love
> to
> > > continue using it (as it seemed to produce a little more efficieny) we
> can't
> > > use it for now because the servers that the app will run on are Centos
> 4
> > > with PHP 5.1.x as its maximum version for now. The sysadmins here say
> that
> > > to force an upgrade to 5.2.x would be a hard task as to retain RedHat
> > > support it means they would need to upgrade to Centos 5.
> >
> > > I am currently looking at the chapter about Optimising symfony and the
> > > function cache seems to be something we cna consider doing in a lot of
> our
> > > model calls from the action to help speed things up, especially for
> model
> > > methods that access historical data (i.e. stuff dated in the past that
> > > obviously wont change on subsequent calls) but these are relatively
> large
> > > coding changes which we will probably only do during our beta
> development
> > > phase.
> >
> > > I am still looking through more advise recieved from this post and I
> have to
> > > thank everyone for their input. I honestly didn't expect this response
> and
> > > it has been fantastic and very helpful.
> >
> > > On Mon, Mar 9, 2009 at 12:49 AM, Crafty_Shadow 
> wrote:
> >
> > > > Symfony 1.1 came by default with Propel 1.2
> > > > You can try upgrading to 1.3 (it isn't really a trivial task, but it
> > > > shouldn't be a big problem)
> > > > There is thorough explanation on the symfony site how to do it:
> > > >http://www.symfony-project.org/cookbook/1_1/en/propel_13
> > > > It should fare a measurable increase in performance. Also, a site
> that
> > > > makes good use of cache should have caching for absolutely everything
> > > > not session-dependent. I find it hard to imagine a php app, no matter
> > > > how fast, that would run faster than symfony's cached output.
> >
> > > > Alvaro:
> > > > Is your plugin based on Propel 1.3?
> > > > If you believe you have made significant improvements to Propel, why
> > > > not suggest them for version 2.0, which is still under heavy
> > > > development?
> >
> > > > On Mar 8, 4:33 pm, alvaro  wrote:
> > > > > At the company I developed a symfony plugin to optimize the Propel
> > > > > queries and also the Propel hydrate method, improving even 5 times
> > > > > query speed and also memory usage.
> >
> > > > > The plugins supports joins and thanks to PHP features the plugin
> > >

[symfony-users] password - minimum 1 number - sfValidatorRegex

2009-03-09 Thread dziobacz

Password should be ok when user write minimum 1 number - so regular
expression should be: '[0-9]{1,}'
I checked it on this website: http://www.regextester.com/ (you must
choose 'preg') and password: pass200 is correct but in symfony it
isn't correct, I see non stiop: 'Minimum 1 number !!' when I write
pass200 - here is my validator - what is wrong ?


$this->validatorSchema->setPostValidator(new sfValidatorAnd(array(

 ..

'password' => new sfValidatorRegex(array('pattern' => '[0-9]{1,}'),
array('invalid' => 'Minimum 1 number !!')),

 )));



--~--~-~--~~~---~--~~
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] what background image do people normally use for sfWidgetFormJqueryDate?

2009-03-09 Thread Lawrence Krubner

I've implemented this widget on a form:

http://www.symfony-project.org/book/forms/1_2/en/A-Widgets#chapter_a_sub_sfwidgetformjquerydate

I am surprised that this doesn't have any background. It is
transparent, and it looks wrong. Check out this screenshot:

http://lawrence.sds5.com/date_widget_looks_wrong.gif

What image do people normally use as a background?


--~--~-~--~~~---~--~~
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: what background image do people normally use for sfWidgetFormJqueryDate?

2009-03-09 Thread Lawrence Krubner



On Mar 10, 2:10 am, Lawrence Krubner  wrote:
> I've implemented this widget on a form:
>
> http://www.symfony-project.org/book/forms/1_2/en/A-Widgets#chapter_a_...
>
> I am surprised that this doesn't have any background. It is
> transparent, and it looks wrong. Check out this screenshot:
>
> http://lawrence.sds5.com/date_widget_looks_wrong.gif
>
> What image do people normally use as a background?

Also, on this page:

http://www.symfony-project.org/book/forms/1_2/en/A-Widgets#chapter_a_sub_sfwidgetformjquerydate

This bit of info is offered:

Option  Description
image   The image path to represent the widget (false by default)
config  A JavaScript array that configures the JQuery date widget
culture The user culture


I'm wondering about the array that can be passed to the config of the
date widget? I tried to look up this date widget, but I got too many
results:

http://www.google.com/search?q=JQuery+date+widget&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a

Where should I look for information?

--~--~-~--~~~---~--~~
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: Symfony Production Performance improvements

2009-03-09 Thread Gareth McCumskey
I have actually come across a rather interesting way to use the memory cache
as specified in the book (
http://www.symfony-project.org/book/1_1/18-Performance#chapter_18_sub_caching_data_in_the_server
)

The way it is described to store data in the cache needs three things; a
unique name that can be easily determined, the value related to that name
and how long that value stays cached. In our application, our database
records will very very rarely see any updates. Once records are inserted
they are only ever retrieved making them ideal for caching. But we cannot
store every database record into memory. We do have queries that run very
frequently, however, and each Criteria object i sunique for each query with
the various values and so on. The problem is you cannot store an object,
like the Criteria object that is built up before you run a Propel query with
doSelect or similar methods. So, if you serialize the Criteria object, you
have a string. But this is a very long string (one of the serialized
Criteria objects I tested with was over 1000 characters long). But you can
convert it to a hash value. Naturally there is one problem with a hash; the
possibility that two different string would create the same hash. So create
two hashes and concatenate them, an SHA1 hash and an MD5 hash. This can then
be the name of the item you are storing in memory. Run the DB query and you
have the value of the query, which can then also be stored into the cache.

As a brief example for what I mean by overriding the doSelect method for a
model class:

private static function doSelect($c)
{
   $serialized_c = serialize($c);
   $md5_serialized = md5($serialized_c);
   $sha1_serialized = sha1($serialized_c);

   $cache = new sfAPCCache();

   if ($cache->has('doSelect'.$md5_serialized.$sha1_serialized))
   {
  $query_value =
$cache->get('doSelect'.$md5_serialized.$sha1_serialized);
   }
   else
   {
  $query_value = parent::doSelect($c);
  $cache->set('doSelect'.$md5_serialized.$sha1_serialized, $query_value,
60);
   }

   return $query_value;
}

Any comments would be great on this or any problems with doing this kind of
thing that I may not have seen please feel free to let me know

On Tue, Mar 10, 2009 at 8:06 AM, Gareth McCumskey wrote:

> Thanks for that. I have actually been looking at the function cache amongst
> others and there is a lot we can do there as our DB records, once inserted,
> are not likely to change. In fact if they do it means we are having a
> problem as we store email data for a number of companies in them. Therefore
> function caching and even memory caching records as we extract them from db
> would probably help us a lot. It does mean more work code-wise and isn't a
> "quick-fix", so we plan to start looking at this once we hit Beta where
> performance will be a major requirement.
>
> The old system is faster simply because it follows no design pattern except
> procedural and that is where its speed lies. There are no ORM's, classes or
> anything like that, and SQL queries are sent straight through to the
> database using handcoded, dynamic SQL queries as opposed to an ORM generated
> one and the resultsets are manipulated directly in each "view". In fact
> there are only views, there is little seperation of business logic and
> presentation.
>
> The reason we need symfony for this new version is that we are going to be
> adding more advanced features that would "complicate" the product beyond
> what a procedural style would allow us to maintain. We are already
> struggling to keep the older system maintained and enhanced for our
> customers as it is. symfony, Propel and even Prototype with scriptaculous
> help alleviate these maintenance and extensibility issues.
>
>
> On Mon, Mar 9, 2009 at 9:13 PM, Richtermeister  wrote:
>
>>
>> Hi Gareth,
>>
>> after reading all this I feel your time is most likely best spent in
>> smart caching, since it sounds like the DB is not your bottleneck.
>> What's easy to overlook when working with symfony, is that compared to
>> straight procedural "get data -> display data" scripts, rendering
>> templates with hydrated objects is slower, albeit more flexible. So,
>> if your previous site was coded in a bad way, it was probably using a
>> lot of "view specific" code, so it's hard to compete with that on pure
>> speed considerations. The only way to mitigate that is by using all
>> forms of caching, and yes, this may include the function cache
>> (although I don't like it much). However, the "higher up" you can
>> cache, i.e. a complete action, the less you have to cache on the model
>> level.
>>
>> Just my 2 cents. Good luck,
>> Daniel
>>
>>
>>
>>
>>
>> On Mar 9, 8:42 am, Sumedh  wrote:
>> > My 2 cents...slow query log in mysql should help a lot...
>> >
>> > Please let us know your insights at the end of your exercise... :)
>> >
>> > On Mar 9, 3:41 pm, Gareth McCumskey  wrote:
>> >
>> > > I just tried using Propel 1.3 on our application and while I would
>> l