[symfony-users] Re: Web Debug toolbar disappeared

2009-08-22 Thread Alexandre SALOME
Check in your actions and templates for something like
sfConfig::set('sf_web_debug', false);

Grep "sf_web_debug" over your project.

And double check your settings.yml. Copy it here if you can't find
sfConfig::set('sf_web_debug in any file of project.



2009/8/22 Tommaso D'Argenio 

> Hi All,
> I've a problem, after a while my debug toolbar disappeared from the
> frontend .. while it is still working fine in the backend. I suspect this is
> because
> I'm making massive use of Ajax in the frontend which somehow have
> completely wiped out the toolbar .. I can't even find the code if I look at
> the
> source HTML generated...
>
> the web_debug option in settings.yml is turned on for the dev environment
> and the same is for the backend. But it works only in the latest and not
> in the first.
>
> How I can solve this?
>
> thanks
> cheers
> T.
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Web Debug toolbar disappeared

2009-08-24 Thread Alexandre SALOME
Any call to "exit" in frontend controler ?

2009/8/23 Hellmich Dennis 

> The usual debugging workflow would be, to deactivate all jQuery/Ajax
> plugins and start with minimal working example to identify the broken code.
> Because the WebDebug Toolbar is usually at the end of the html-code, you
> could look, if the - and the -tag are closed regularly.
> Otherwise you would have an error in your php which doesn't throw a visible
> error message...
>
>
> Cheers
> Dennis
>
> Am 23.08.2009 um 11:15 schrieb Tommaso D'Argenio:
>
> Hi,
> yes of course I'm calling frontend_dev.php, works fine though if I call
> backend_dev.php
>
> It must be after I've enabled Ajax or installed few JQUERY plugin ... but
> don't know where to look at
> to enable it again. :(
>
> thanks
> cheers
>
> 2009/8/22 Hellmich Dennis 
>
>> Stupid question:  are you calling frontend_dev.php and not frontend.php?
>>
>> Best,
>> Dennis
>>
>> Am 22.08.2009 um 16:01 schrieb Tommaso D'Argenio:
>>
>> Hi Alexandre,
>> I had the same thought but couldn't fine any of those commands in any of
>> the files, have scanned the whole
>> directory for it.
>>
>> the settings.yml is this:
>> prod:
>>   .settings:
>> no_script_name: on
>> logging_enabled:off
>> web_debug:  on
>>
>> dev:
>>   .settings:
>> error_reporting:
>> web_debug:  on
>> cache:  off
>> no_script_name: off
>> etag:   off
>> compressed: off
>>
>> test:
>>   .settings:
>> error_reporting:> ?>
>> cache:  off
>> web_debug:  off
>> no_script_name: off
>> etag:   off
>> all:
>>   .actions:
>> error_404_module:   main   # To be called when a 404 error is
>> raised
>> error_404_action:   error404  # Or when the requested URL doesn't
>> match any route
>>
>> login_module:   sfGuardAuth   # To be called when a
>> non-authenticated user
>> login_action:   signin # Tries to access a secure page
>>
>> secure_module:  sfGuardAuth   # To be called when a user
>> doesn't have
>>     secure_action:  secure# The credentials required for an
>> action
>>   .settings:
>>  compressed: on
>> cache:  on
>>  etag:   off
>>  rich_text_js_dir:   js/tiny_mce
>>  enabled_modules:[default, sfGuardAuth]
>>
>> I can't see any error in it ...
>>
>> any thoughts/idea is much appreciated.
>>
>> cheers
>> T.
>>
>>
>> 2009/8/22 Alexandre SALOME 
>>
>>> Check in your actions and templates for something like
>>> sfConfig::set('sf_web_debug', false);
>>>
>>> Grep "sf_web_debug" over your project.
>>>
>>> And double check your settings.yml. Copy it here if you can't find
>>> sfConfig::set('sf_web_debug in any file of project.
>>>
>>>
>>>
>>> 2009/8/22 Tommaso D'Argenio 
>>>
>>> Hi All,
>>>> I've a problem, after a while my debug toolbar disappeared from the
>>>> frontend .. while it is still working fine in the backend. I suspect this 
>>>> is
>>>> because
>>>> I'm making massive use of Ajax in the frontend which somehow have
>>>> completely wiped out the toolbar .. I can't even find the code if I look at
>>>> the
>>>> source HTML generated...
>>>>
>>>> the web_debug option in settings.yml is turned on for the dev
>>>> environment and the same is for the backend. But it works only in the 
>>>> latest
>>>> and not
>>>> in the first.
>>>>
>>>> How I can solve this?
>>>>
>>>> thanks
>>>> cheers
>>>> T.
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Alexandre Salomé -- alexandre.sal...@gmail.com
>>>
>>>
>>>
>>
>>
>>
>>
>>
>>
>>
>
>
>
>
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: sfForm->save() for an update

2009-08-31 Thread Alexandre SALOME
2 solutions :

- check the id field is set and be sure it is rendered in form (hidden field
: $form->renderHiddenFields())
- Add id to parameters : $this->form->bind(array_merge(array('id' => $id),
$request->getParameter($this->form->getName(;

Good luck



2009/8/31 krishan 

>
> Friends I am facing a problem for updating a record in table in many
> steps.
> In each step I save the submitted data.
>
> This is my code
>
> $this->form = new ProfileForm();
> $this->form->bind($request->getParameter($this->form->getName()));
>
> if ($this->form->isValid()) {
>$this->form->setOption('id', $request->getParameter('id'));
>$php_profile = $this->form->save();
> }
>
> when I run $this->form->save(); function it adds a new record in
> database. But I want it to update the record provided with the id.
> Does anyone knows how to do that. I tried o use $this->form->setNew
> (false); but does not work with $this object...
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: sfcryptocaptcha plugin problem.

2009-09-04 Thread Alexandre SALOME
Hello,

  Could you copy/paste your form class code ?

The plugin sfCryptoCaptcha is very complicated

Maybe you should consider using the
sfFormExtraPluginand
especially the sfWidgetFormRecaptcha and the sfValidatorReCaptcha.

It uses reCaptcha.




2009/9/4 Avani 

>
> Hi All,
>
> I have registration form in my project.
>
> For that, I have used "sfcryptocaptcha plugin"  for captcha.
>
> Everything works fine in my local machine. But when I upload files, it
> is not working in live.
>
> It is not displaying captcha image. also not giving any erros.
>
> My url is  guest.php/signup/index.
>
> But when I do  guest_dev.php/signup/index...  then it displays
> captcha...
>
> Wht is wrong with this?
>
> Is ther any permission problem?
>
> Pls help me.
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Propel route problem

2009-10-09 Thread Alexandre SALOME
Sure, your configuration is OK.

Maybe the routing match another route before this one.

Please check in the logs and tell us,

look if you do you have any other rule that could catch your url before ?

Use the task *./symfony app:routes websites* to get the list of the app
routes.

Alexandre



2009/10/9 HAUSa 

>
> Can someone help me with this please?
> It's really becoming an obstacle in my development process now... :(
>
> On 8 okt, 21:01, HAUSa 
> wrote:
> > I have this route:
> >
> > user_activate:
> >   url: /user/activate/:id
> >   class:   sfPropelRoute
> >   options: { model: User, type: object }
> >   param:   { module: user, action: activate }
> >
> > Now, in the page where that route leads to, I have a form. The form is
> > being sent to that route again:
> > 
> >
> > But, when I post that form, I get this error message:
> > Fatal error: Call to undefined method sfRoute::getObject() in /home/
> > snuber/domains/snuber.net/public_html/apps/website/modules/user/
> > actions/actions.class.php on line 30
> >
> > It is still the very same URL! The route should work, shouldn't it?
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Unable to perform DELETE ALL operation: a foreign key constraint fails

2009-10-09 Thread Alexandre SALOME
I use to execute propel:drop-db & propel:build-db (or similar) to fix the
problem :)

2009/10/8 basos 

>
>  Unable to perform DELETE ALL operation. [wrapped: SQLSTATE[23000]:
> Integrity constraint violation: 1451 Cannot delete or update a parent
> row: a foreign key constraint fails (`pw_catsub`, CONSTRAINT
> `pw_catsub_FK_1` FOREIGN KEY (`category_id`) REFERENCES `pw_catsub`
> (`id`))]
>
>
>   I get the above message when trying to re-insert the fixtures data
> on the database (e.g. rerun symphony propel:data-load ). The
> aforementioned foreign key is onDelete: restrict(ed). This is a table
> with self-reference (e.g. the foreignTable is the same table) and it
> implements a category-subcategory item modeling.
>
>   I expect for the data-load script to delete all the old values in
> the opposite direction they were inserted before reinserting. By
> examining sfPropelData.class.php this seems to be the case. Also by
> deleting the records manualy in the oposite order as they are created
> no error happens. So i think there is some bug that doesn't follow the
> ordering rule, and i cannot point out.
>
>
> 
> help data:
>
> table:
>  pw_catsub:
>id: ~
>name: { type:varchar(255), required: true,
> index:unique }
>category_id:{ type: integer, foreignTable: pw_catsub,
> foreignReference: id, default: null, onDelete: restrict }
>
> fixture:
> PwCatsub:
>nature: { name: nature }
>news: { name: news }
> # subs
>politics:  { category_id: news, name: politics }
>economy:{ category_id: news, name: economy }
>
>
> -
> basos
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Propel route problem

2009-10-09 Thread Alexandre SALOME
1 => true in routing parameters...

Strange...

Try adding :

*requirements*:
id: \d+


Finally :

user_activate:
  url: /user/activate/:id
  class:   sfPropelRoute
  options: { model: User, type: object }
  param:   { module: user, action: activate }
  requirements:
id: \d+

2009/10/9 NairuS 

>
>
> 2009/10/9 HAUSa 
>
>>
>> Hey, this is weird! I checked the log like you said Alexandre, and it
>> matches just the default one...
>>
>> Oct 09 10:17:36 symfony [info] {sfPatternRouting} Connect
>> sfPropelRoute "user_activate" (/user/activate/:id)
>> Oct 09 10:17:36 symfony [info] {sfPatternRouting} Connect
>> sfPropelRoute "user_edit" (/user/edit/:id)
>> Oct 09 10:17:36 symfony [info] {sfPatternRouting} Connect sfRoute
>> "homepage" (/)
>> Oct 09 10:17:36 symfony [info] {sfPatternRouting} Connect sfRoute
>> "default_index" (/:module)
>> Oct 09 10:17:36 symfony [info] {sfPatternRouting} Connect sfRoute
>> "default" (/:module/:action/*)
>> Oct 09 10:17:36 symfony [info] {sfPatternRouting} Match route
>> "default" (/:module/:action/*) for /user/activate/1 with parameters
>> array (  1 => true,  'module' => 'user',  'action' => 'activate',)
>>
>> But why doesn't it match "user_active"? The URL is correct!
>> /website_dev.php/user/activate/1
>>
>>
>> On 9 okt, 10:15, HAUSa 
>> wrote:
>> > Ah, the URL problem is solved. I had to use url_for('user_activate',
>> > $user), and not url_for('@user_activate', $user) (mind the @).
>> >
>>
>
> Yep it's true.
>
> Sorry! With this syntax :
>   > url_for('@user_activate?id=' . $user->getId())
>
> it must work too.
>
>
>> > But, the form problem still remains.
>> > When I submit my form, it says
>> > "Fatal error: Call to undefined method sfRoute::getObject() in /home/
>> > snuber/domains/snuber.net/public_html/apps/website/modules/user/
>> > actions/actions.class.php on line 59"
>> >
>> > This is my form now:
>> > 
>> >
>> > On 9 okt, 09:50, Alexandre SALOME  wrote:
>> >
>> > > Sure, your configuration is OK.
>> >
>> > > Maybe the routing match another route before this one.
>> >
>> > > Please check in the logs and tell us,
>> >
>> > > look if you do you have any other rule that could catch your url
>> before ?
>> >
>> > > Use the task *./symfony app:routes websites* to get the list of the
>> app
>> > > routes.
>> >
>> > > Alexandre
>> >
>> > > 2009/10/9 HAUSa 
>> >
>> > > > Can someone help me with this please?
>> > > > It's really becoming an obstacle in my development process now... :(
>> >
>> > > > On 8 okt, 21:01, HAUSa 
>> > > > wrote:
>> > > > > I have this route:
>> >
>> > > > > user_activate:
>> > > > >   url: /user/activate/:id
>> > > > >   class:   sfPropelRoute
>> > > > >   options: { model: User, type: object }
>> > > > >   param:   { module: user, action: activate }
>> >
>> > > > > Now, in the page where that route leads to, I have a form. The
>> form is
>> > > > > being sent to that route again:
>> > > > > 
>> >
>> > > > > But, when I post that form, I get this error message:
>> > > > > Fatal error: Call to undefined method sfRoute::getObject() in
>> /home/
>> > > > > snuber/domains/snuber.net/public_html/apps/website/modules/user/
>> > > > > actions/actions.class.php on line 30
>> >
>> > > > > It is still the very same URL! The route should work, shouldn't
>> it?
>> >
>> > > --
>> > > Alexandre Salomé -- alexandre.sal...@gmail.com
>>
>>
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Propel route problem

2009-10-12 Thread Alexandre SALOME
For the route, use :

url_for('@user_activate', $user);

Could you try a simple thing ?

Change your URL : set something like /user-activate/:id

Does it works like this ?

2009/10/12 HAUSa 

>
> With the requirements it works, the url_for('@user_activate?id=' .
> $user->getId()) didn't have any effect.
> But what is the difference with the requirements? It's strange that it
> doesn't take the user_activate route in first place, because I placed
> it on top of my routing.yml document...
>
>
> On 9 okt, 18:18, Alexandre SALOME  wrote:
> > 1 => true in routing parameters...
> >
> > Strange...
> >
> > Try adding :
> >
> > *requirements*:
> > id: \d+
> >
> > Finally :
> >
> > user_activate:
> >   url: /user/activate/:id
> >   class:   sfPropelRoute
> >   options: { model: User, type: object }
> >   param:   { module: user, action: activate }
> >   requirements:
> > id: \d+
> >
> > 2009/10/9 NairuS 
> >
> >
> >
> >
> >
> > > 2009/10/9 HAUSa 
> >
> > >> Hey, this is weird! I checked the log like you said Alexandre, and it
> > >> matches just the default one...
> >
> > >> Oct 09 10:17:36 symfony [info] {sfPatternRouting} Connect
> > >> sfPropelRoute "user_activate" (/user/activate/:id)
> > >> Oct 09 10:17:36 symfony [info] {sfPatternRouting} Connect
> > >> sfPropelRoute "user_edit" (/user/edit/:id)
> > >> Oct 09 10:17:36 symfony [info] {sfPatternRouting} Connect sfRoute
> > >> "homepage" (/)
> > >> Oct 09 10:17:36 symfony [info] {sfPatternRouting} Connect sfRoute
> > >> "default_index" (/:module)
> > >> Oct 09 10:17:36 symfony [info] {sfPatternRouting} Connect sfRoute
> > >> "default" (/:module/:action/*)
> > >> Oct 09 10:17:36 symfony [info] {sfPatternRouting} Match route
> > >> "default" (/:module/:action/*) for /user/activate/1 with parameters
> > >> array (  1 => true,  'module' => 'user',  'action' => 'activate',)
> >
> > >> But why doesn't it match "user_active"? The URL is correct!
> > >> /website_dev.php/user/activate/1
> >
> > >> On 9 okt, 10:15, HAUSa 
> > >> wrote:
> > >> > Ah, the URL problem is solved. I had to use url_for('user_activate',
> > >> > $user), and not url_for('@user_activate', $user) (mind the @).
> >
> > > Yep it's true.
> >
> > > Sorry! With this syntax :
> > >   > url_for('@user_activate?id=' . $user->getId())
> >
> > > it must work too.
> >
> > >> > But, the form problem still remains.
> > >> > When I submit my form, it says
> > >> > "Fatal error: Call to undefined method sfRoute::getObject() in
> /home/
> > >> > snuber/domains/snuber.net/public_html/apps/website/modules/user/
> > >> > actions/actions.class.php on line 59"
> >
> > >> > This is my form now:
> > >> > 
> >
> > >> > On 9 okt, 09:50, Alexandre SALOME 
> wrote:
> >
> > >> > > Sure, your configuration is OK.
> >
> > >> > > Maybe the routing match another route before this one.
> >
> > >> > > Please check in the logs and tell us,
> >
> > >> > > look if you do you have any other rule that could catch your url
> > >> before ?
> >
> > >> > > Use the task *./symfony app:routes websites* to get the list of
> the
> > >> app
> > >> > > routes.
> >
> > >> > > Alexandre
> >
> > >> > > 2009/10/9 HAUSa 
> >
> > >> > > > Can someone help me with this please?
> > >> > > > It's really becoming an obstacle in my development process
> now... :(
> >
> > >> > > > On 8 okt, 21:01, HAUSa <
> jeroen_heeft_behoefte_aan_r...@hotmail.com>
> > >> > > > wrote:
> > >> > > > > I have this route:
> >
> > >> > > > > user_activate:
> > >> > > > >   url: /user/activate/:id
> > >> > > > >   class:   sfPropelRoute
> > >> > > > >   options: { model: User, type: object }
> > >> > > > >   param:   { module: user, action: activate }
> >
> > >> > > > > Now, in the page where that route leads to, I have a form. The
> > >> form is
> > >> > > > > being sent to that route again:
> > >> > > > >  action="/website_dev.php/user/
> > >> > > > > activate/1" method="post" enctype="multipart/form-data">
> >
> > >> > > > > But, when I post that form, I get this error message:
> > >> > > > > Fatal error: Call to undefined method sfRoute::getObject() in
> > >> /home/
> > >> > > > > snuber/domains/
> snuber.net/public_html/apps/website/modules/user/
> > >> > > > > actions/actions.class.php on line 30
> >
> > >> > > > > It is still the very same URL! The route should work,
> shouldn't
> > >> it?
> >
> > >> > > --
> > >> > > Alexandre Salomé -- alexandre.sal...@gmail.com
> >
> > --
> > Alexandre Salomé -- alexandre.sal...@gmail.com
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Outputing dynamic image fail

2009-10-12 Thread Alexandre SALOME
You must disable the debug bar :

sfConfig::set('sf_web_debug', false);

Alexandre

2009/10/12 Ahmed 

>
> Hi all;
> I use symfony 1.2.9
> I have a strange error in ouputing image with symfony , so i have a
> simple function to create image
> public static function genCaptcha($pass){
>  $image = ImageCreatetruecolor(100, 20);
>  $clr_white = ImageColorAllocate($image, 255, 255, 255);
>  $clr_black = ImageColorAllocate($image, 0, 0, 0);
>  imagefill($image, 0, 0, $clr_black);
>
>  // *** Set the image height and width ***
>  imagefontheight(15);
>  imagefontwidth(15);
>
>  // *** Add the passcode in white to the image ***
>  imagestring($image, 5, 30, 3, $pass, $clr_white);
>
>  // *** Throw in some lines to trick those cheeky bots!
> ***
>  imageline($image, 5, 1, 50, 20, $clr_white);
>  imageline($image, 60, 1, 96, 20, $clr_white);
>  imageline($image, 5, 1, 100, 50, $clr_white);
>  // *** Output the newly created image in jpeg format ***
>  imagejpeg($image);
>
>  // *** Clear up some memory... ***
>  imagedestroy($image);
> }
>
> And in the action i write:
> public function executeShowCaptcha(sfWebRequest $request)
> {
>  $response = $this->getResponse();
>  $response->setContentType('image/jpeg');
>
>  myTools::genCaptcha(uniqid());
>
>  $this->setLayout(false);
>
>  return sfView::NONE;
> }
> i use it in a template like this 
> But i dont see any image in my template and whene i try to point it
> directly on the url like :
> http://127.0.0.1/test/frontend_dev.php/home/showCaptcha
> also i dont see the generated image
>
> NOTE: this script work outside symfony
> Thanks.
> Cordially  Ahmed
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Outputing dynamic image fail

2009-10-12 Thread Alexandre SALOME
Hum...

Have a look at this : http://forum.symfony-project.org/index.php/m/52933/ -
it talks about files ending with blank characters.

If it doesn't work, call exit; instead of return sfView::NONE;:)


2009/10/12 Ahmed 

>
> Hi, Thanks for reply
>
> it dosn't work men,
> i have the same output.
> (0x0 empty image)
>
> On 12 oct, 11:17, Alexandre SALOME  wrote:
> > You must disable the debug bar :
> >
> > sfConfig::set('sf_web_debug', false);
> >
> > Alexandre
> >
> > 2009/10/12 Ahmed 
> >
> >
> >
> >
> >
> > > Hi all;
> > > I use symfony 1.2.9
> > > I have a strange error in ouputing image with symfony , so i have a
> > > simple function to create image
> > > public static function genCaptcha($pass){
> > >  $image = ImageCreatetruecolor(100, 20);
> > >  $clr_white = ImageColorAllocate($image, 255, 255, 255);
> > >  $clr_black = ImageColorAllocate($image, 0, 0, 0);
> > >  imagefill($image, 0, 0, $clr_black);
> >
> > >  // *** Set the image height and width ***
> > >  imagefontheight(15);
> > >  imagefontwidth(15);
> >
> > >  // *** Add the passcode in white to the image ***
> > >  imagestring($image, 5, 30, 3, $pass, $clr_white);
> >
> > >  // *** Throw in some lines to trick those cheeky bots!
> > > ***
> > >  imageline($image, 5, 1, 50, 20, $clr_white);
> > >  imageline($image, 60, 1, 96, 20, $clr_white);
> > >  imageline($image, 5, 1, 100, 50, $clr_white);
> > >  // *** Output the newly created image in jpeg format ***
> > >  imagejpeg($image);
> >
> > >  // *** Clear up some memory... ***
> > >  imagedestroy($image);
> > > }
> >
> > > And in the action i write:
> > > public function executeShowCaptcha(sfWebRequest $request)
> > > {
> > >  $response = $this->getResponse();
> > >  $response->setContentType('image/jpeg');
> >
> > >  myTools::genCaptcha(uniqid());
> >
> > >  $this->setLayout(false);
> >
> > >  return sfView::NONE;
> > > }
> > > i use it in a template like this 
> > > But i dont see any image in my template and whene i try to point it
> > > directly on the url like :
> > >http://127.0.0.1/test/frontend_dev.php/home/showCaptcha
> > > also i dont see the generated image
> >
> > > NOTE: this script work outside symfony
> > > Thanks.
> > > Cordially  Ahmed
> >
> > --
> > Alexandre Salomé -- alexandre.sal...@gmail.com
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Help with sfWidgetFormInputSWFUploadPlugin and admin generator

2009-10-12 Thread Alexandre SALOME
Consider the controler/action performed by the Ajax Request. It should
return the file list, not the form page.

2009/10/12 Arnold Ispan 

> Solved the issue but now there is another one :)
>
> After the upload is successfull how can i prevent the response of the
> server from showing up in the widget like in the image below:
>
> http://img176.imageshack.us/img176/6093/imgr.jpg
>
>
> Thank You
>
> On Mon, Oct 12, 2009 at 3:04 PM, ispanarnold wrote:
>
>>
>> Hello,
>>
>> I'm working on a project where i require multiple file upload and i am
>> using sfWidgetFormInputSWFUploadPlugin.
>> All works well except that after the upload finishes i get an "Errors
>> occured during upload", "An HTTP error occured: 401 Unauthorized",
>> after looking into I saw that in the widget i am redirected to the
>> Login page.
>>
>> My question is how should i fix it? How can i pass the session to the
>> flash.
>>
>> Any help is appreciated. Thank you
>>
>>
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Help with mixins!! Adding new actions in a module with the event dispatcher (MIXINS)

2009-10-12 Thread Alexandre SALOME
You should create a class myActions that extends sfActions, with your new
action.

Then module classes extends myActions instead of sfActions, so they have the
method.

Alexandre

2009/10/12 Jaime Suez 

> I'm using 1.2.
>
> I'm using the new way, with listeners and the event dispatcher.
>
> I found that there come implemented 3 kind of events in the controller:
>
> *controller
> *  change_action   notify   sfController
> module, action
>  method_not_found   notifyUntil   sfController method, arguments
>  page_not_found   notify   sfController module, action
> I was thinking that maybe 'page_not_found' or 'method_not_found' will work
> for adding a new action to many modules, but they didn't.
>
> Any thanks will be very grateful.
>
>
>
>
> On Mon, Oct 12, 2009 at 6:34 AM, Lee Bolding  wrote:
>
>>
>> What version of Symfony are you using?
>>
>> I think mixins were replaced by the event system as of Symfony 1.1
>>
>> On 12 Oct 2009, at 06:36, jaime wrote:
>>
>> >
>> > Hi!
>> >
>> > I'm trying to add new actions to some modules with mixins and the
>> > event dispatcher.
>> >
>> > I find the controller.page_not_found notify, but it didn't work.
>> >
>> > Someone knows if there is a way to add new actions with some mixin??
>> > >
>>
>>
>>
>>
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Help with sfWidgetFormInputSWFUploadPlugin and admin generator

2009-10-12 Thread Alexandre SALOME
Actually, it uses the same URL for sending the files. So it post values to
document/edit URL.

You have to create a new action dedicated to this action, and set it's URL
in the options of your widget (in your form).

Copy/paste the code of your form configuration for more help.

Alexandre.

2009/10/12 Arnold Ispan 

> Hello,
>
>
> Thank for the answer, but this is an admin generated action, that on
> success return the form with the success message
>
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Propel route problem

2009-10-13 Thread Alexandre SALOME
Hu !

Add in requirements : sf_method: [get, post]

By default, i think only get is accepted, so it skip the route.

This should fix the problem


2009/10/13 HAUSa 

>
> With url_for('@user_activate', $user); I got an error, but without the
> @ it works.
>
> Now I changed the route to this:
>
> user_activate:
>  url: /user-activate/:id
>  class:   sfPropelRoute
>  options: { model: User, type: object }
>  param:   { module: user, action: activate }
>
> When I type in the URL (/website_dev.php/user-activate/1), it shows
> the page correctly. Then, when I submit a form to the exact same URL,
> it says "Action "useractivate/1" does not exist.".
> I guess the fact that it searches for a module named useractivate and
> a action that is named 1, means that it takes the default route yet
> again. On a form submit, it just doesn't recognize the route class
> "user_activate"!
>
> This is really weird!
>
>
>
> On 12 okt, 12:10, Alexandre SALOME  wrote:
> > For the route, use :
> >
> > url_for('@user_activate', $user);
> >
> > Could you try a simple thing ?
> >
> > Change your URL : set something like /user-activate/:id
> >
> > Does it works like this ?
> >
> > 2009/10/12 HAUSa 
> >
> >
> >
> >
> >
> > > With the requirements it works, the url_for('@user_activate?id=' .
> > > $user->getId()) didn't have any effect.
> > > But what is the difference with the requirements? It's strange that it
> > > doesn't take the user_activate route in first place, because I placed
> > > it on top of my routing.yml document...
> >
> > > On 9 okt, 18:18, Alexandre SALOME  wrote:
> > > > 1 => true in routing parameters...
> >
> > > > Strange...
> >
> > > > Try adding :
> >
> > > > *requirements*:
> > > > id: \d+
> >
> > > > Finally :
> >
> > > > user_activate:
> > > >   url: /user/activate/:id
> > > >   class:   sfPropelRoute
> > > >   options: { model: User, type: object }
> > > >   param:   { module: user, action: activate }
> > > >   requirements:
> > > > id: \d+
> >
> > > > 2009/10/9 NairuS 
> >
> > > > > 2009/10/9 HAUSa 
> >
> > > > >> Hey, this is weird! I checked the log like you said Alexandre, and
> it
> > > > >> matches just the default one...
> >
> > > > >> Oct 09 10:17:36 symfony [info] {sfPatternRouting} Connect
> > > > >> sfPropelRoute "user_activate" (/user/activate/:id)
> > > > >> Oct 09 10:17:36 symfony [info] {sfPatternRouting} Connect
> > > > >> sfPropelRoute "user_edit" (/user/edit/:id)
> > > > >> Oct 09 10:17:36 symfony [info] {sfPatternRouting} Connect sfRoute
> > > > >> "homepage" (/)
> > > > >> Oct 09 10:17:36 symfony [info] {sfPatternRouting} Connect sfRoute
> > > > >> "default_index" (/:module)
> > > > >> Oct 09 10:17:36 symfony [info] {sfPatternRouting} Connect sfRoute
> > > > >> "default" (/:module/:action/*)
> > > > >> Oct 09 10:17:36 symfony [info] {sfPatternRouting} Match route
> > > > >> "default" (/:module/:action/*) for /user/activate/1 with
> parameters
> > > > >> array (  1 => true,  'module' => 'user',  'action' => 'activate',)
> >
> > > > >> But why doesn't it match "user_active"? The URL is correct!
> > > > >> /website_dev.php/user/activate/1
> >
> > > > >> On 9 okt, 10:15, HAUSa <
> jeroen_heeft_behoefte_aan_r...@hotmail.com>
> > > > >> wrote:
> > > > >> > Ah, the URL problem is solved. I had to use
> url_for('user_activate',
> > > > >> > $user), and not url_for('@user_activate', $user) (mind the @).
> >
> > > > > Yep it's true.
> >
> > > > > Sorry! With this syntax :
> > > > >   > url_for('@user_activate?id=' . $user->getId())
> >
> > > > > it must work too.
> >
> > > > >> > But, the form problem still remains.
> > > > >> > When I submit my form, it says
> > > > >> > "Fatal error: Call to undefined method sfRoute::

[symfony-users] Re: Performance isset vs strlen

2009-10-14 Thread Alexandre SALOME
:)

2009/10/14 Fabian Lange 

>
> Hi,
> I am suprised that this is measurable that good. I can reproduce it.
> isset runs in 15% of the time as strlen.
>
> I tried wrapping this into a function:
> function hasXChars($string, $x){
>  return isset($string[$x-1]);
> }
>
> -> speed boost gone. slower than strlen.
>
> The implication is that coders would be required to understand
> isset($user[5]) and recognize that this checks for a string having at
> least 6 chars.
>
> And because i think that is difficult to understand I would not do it,
> unless somebody can point me to  a playe where thousands of strlens
> are made.
>
> I will check my xdebug traces, but i doubt i see this case
>
> Fabian
>
>
> On Wed, Oct 14, 2009 at 4:32 PM, roberto german puentes diaz
>  wrote:
> > Hi to all, here i send you a script for compare isset vs strlen.
> > Maybe symfony can gain something with this!
> >
> > if (isset($username[5])) {
> > //That's OK!;
> > }
> >
> > is more faster than
> >
> > if (strlen($username) == 5) {
> > //That's OK!;
> > }
> >
> > Sure, there are cases where ask or know the lenght, strlen will be
> better.
> > Or we need know that 5 is the last position of the last caracter, etc
> > But isset is a constructor of lenguage and that's why is very faster,
> >
> > execute a FOR of 1000 cicles
> > (strlen) 2.3571428571429
> >
> > (isset) 0.42424242424242
> >
> >
> >
> > where symfony could use something like that
> > sfCultureInfo.class.php
> > sfDateFormat.class.php
> > Inline.php
> > etc
> > it's something
> >
> > --
> > Cr. Puentes Diaz
> > MP 10.12726.9
> > Córdoba - Argentina
> >
> > www.puentesdiaz.com.ar/blog/
> > www.puentesdiaz.com.ar/blog/novedades
> > www.twitter.com/puentesdiaz
> > Linux User n° 441474
> > Ubuntu/Symfony/Eclipse Rocks!
> >
> > Sign for Free License for Project Zero
> > http://www.petitiononline.com/zerogpl/
> >
> > >
> >
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: sfDoctrineGuard : backend login ILOD

2009-10-15 Thread Alexandre SALOME
Maybe a problem with your application security.

Disable all is_secure: true from your security.yml and re-enable them one by
one to understand.

Alexandre

2009/10/15 aymeric 

>
> Yes, it is the first route in /backend/config/routing.yml  :
> homepage:
>  url:   /
>  param: { module: article, action: index }
>
> I am really lost here, I checked all my error logs and they all are 4
> to 10 days old, no clue in there.
>
> On 14 oct, 22:40, Casey  wrote:
> > do you have an @homepage route?
> >
> > On Oct 14, 8:32 am, aymeric  wrote:
> >
> >
> >
> > > ILOD : infinite loop of death
> >
> > > I'm at day 13 in Jobeet for Doctrine and I try to secure my backend.
> > > I couldn't get PEAR working so I installed sfDoctrineGuard by hand
> > > (manual download, manual unpacking in /plugins).
> >
> > > I followed the tutorial and when I try to log in has "username:
> > > admin , password: admin" I get ... the login page.
> >
> > > I have cleared the cache several times, sfGuard.yml fixtures have been
> > > loaded in the DB. But the ILOD is there.
> >
> > > Any idea?
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: [Solved by computer magic]: sfDoctrineGuard : backend login ILOD

2009-10-15 Thread Alexandre SALOME
No, it was due to fact that sfGuard redirect you to your referer after
logging.

Alexandre

2009/10/15 aymeric 

>
> There is only one "is_secure: true" for the entire backend (in /
> backend/config/security.yml).
>
> The problem has solved itself during the night. The first thing I did
> this morning was to answer to Casey (upper in the discussion) and then
> I tried to log in my backend  and it miraculously worked.
>
> The classic IT problem solver : turn off and on your computer.
>
> This is as enlightening as turning on the TV by smashing a potatoe.
>
> On 15 oct, 09:51, Alexandre SALOME  wrote:
> > Maybe a problem with your application security.
> >
> > Disable all is_secure: true from your security.yml and re-enable them one
> by
> > one to understand.
> >
> > Alexandre
> >
> > 2009/10/15 aymeric 
> >
> >
> >
> >
> >
> >
> >
> > > Yes, it is the first route in /backend/config/routing.yml  :
> > > homepage:
> > >  url:   /
> > >  param: { module: article, action: index }
> >
> > > I am really lost here, I checked all my error logs and they all are 4
> > > to 10 days old, no clue in there.
> >
> > > On 14 oct, 22:40, Casey  wrote:
> > > > do you have an @homepage route?
> >
> > > > On Oct 14, 8:32 am, aymeric  wrote:
> >
> > > > > ILOD : infinite loop of death
> >
> > > > > I'm at day 13 in Jobeet for Doctrine and I try to secure my
> backend.
> > > > > I couldn't get PEAR working so I installed sfDoctrineGuard by hand
> > > > > (manual download, manual unpacking in /plugins).
> >
> > > > > I followed the tutorial and when I try to log in has "username:
> > > > > admin , password: admin" I get ... the login page.
> >
> > > > > I have cleared the cache several times, sfGuard.yml fixtures have
> been
> > > > > loaded in the DB. But the ILOD is there.
> >
> > > > > Any idea?
> >
> > --
> > Alexandre Salomé -- alexandre.sal...@gmail.com
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: How to custom frontend for sfguarduser

2009-10-15 Thread Alexandre SALOME
N :) Please... don't touch to plugins...

A smartest solution :

Create a mySfGuardUserForm :

class mySfGuardUserForm extends sfGuardUserForm
{
  public function configure()
  {
parent::configure();
// do your stuff here
  }
}

Generate a new admin module in your application, and specify in the
generator.yml to use mySfGuardUserPlugin :

generator:
  param:
config:
  form:
class:mySfGuardUserPlugin

Good luck,

Alexandre

2009/10/15 Alexandru-Emil Lupu 

> you don't need to do that ...
> in your / plugins/sfGuard/modules/sfGuardAuth/actions/actions.class.php
> writhe this:
>
> public function theExtendedMethod($request){
>
> parent::theExtendedMethod($request);
> $this->form->setLabels(array(
> 'username'=> 'foo',
> 'password'=> 'moo',
> 'password_again' => 'boo'
> ));
>
> }
>
> Alecs
>
>
> On Thu, Oct 15, 2009 at 8:34 PM, g0d br  wrote:
>
>> Hi,
>>
>> I just want to customize the labels username, password and password_again
>>
>> so far i created the module user
>>
>> php symfony propel:generate-module frontend user sfGuardUser
>>
>> but how do i proceed to cutomize the label if the lib/form class do not
>> existe.
>>
>>
>> Thank you
>>
>> celso
>>
>>
>>
>
>
> --
> As programmers create bigger & better idiot proof programs, so the universe
> creates bigger & better idiots!
> I am on web:  http://www.alecslupu.ro/
> I am on twitter: http://twitter.com/alecslupu
> I am on linkedIn: http://www.linkedin.com/in/alecslupu
> Tel: (+4)0748.543.798
>
>
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: sf1.2 routes fail in sf1.3

2009-10-15 Thread Alexandre SALOME
Could you try removing - from your segment separator ?

  url: /books-by-:author.html
  param: { module: books, action: list }
  options:
segment_separators:   [/, .]

2009/10/15 Jonathan Franks 

>
> in sf1.2, i could write a route like this...
>
> >   url: /books-by-:author.html
> >   param: { module: books, action: list }
> >   options:
> > segment_separators:   [/, ., -]
>
> and it would match...
>
> > /books-by-jon.html
> > /books-by-jon-franks.html
>
> but in sf1.3, it only matches...
>
> > /books-by-jon.html
>
>
> is this a deliberate change?
>
> Regards
>
> Jonathan
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: One Application, Several Domains, Shared session

2009-10-16 Thread Alexandre SALOME
http://www.lmgtfy.com/?q=share+session+subdomains+symfony&l=1

The first result


2009/10/16 kev 

>
> Hi all,
>
> I checked on the forums and in this list, but failed to find any post
> presenting my current issue!
> We have several domains using the same application (the user culture
> depends of the domain name currently being browsed),
> and we would like to share sessions when the end user jumps from one
> domain to another. Ideally we would like the session id NOT to appear
> in the url...
>
> Do you think this is doable? If so, any hint on how you would do
> that?!
>
> Thanks!
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Specify connection parameters (databases.yml) in PHP

2009-10-16 Thread Alexandre SALOME
.htaccess in root folder :

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ! ^/web/*
RewriteRule  .* /web [QSA, L]

Or something like this


2009/10/16 Davide Borsatto 

>
> I'm pushing for this... For a very long time.. :)
> Something will change (soon I hope), but for this project, we're still
> using that hosting. Let's say this is a "temporary solution", waiting
> for better times. :)
>
> On Oct 16, 9:47 am, Gareth McCumskey  wrote:
> > Why not consider an alternative hosting? If you like to fiddle and mess
> > around, I use a service called Linode that allows me to setup my own
> server
> > with the software I want and full root access to my machine, etc. Pretty
> > much they give you a virtualised machine, you install the OS, and all
> other
> > software and then transfer domain when you're ready for it.
> >
> >
> >
> > On Fri, Oct 16, 2009 at 9:18 AM, Davide Borsatto 
> wrote:
> >
> > > I don't have multiple connections or something like that :)
> >
> > > The point is that my crappy company hosting does not allow me to put
> > > stuff outside the default root directory (httpdocs in my case), so i
> > > have to leave the file "public". Writing the connection parameters in
> > > PHP would be a solution, but now comes in my mind that I could tell
> > > apache not to allow to enter that directory... :)
> >
> > > On Oct 15, 4:16 pm, Gareth McCumskey  wrote:
> > > > So for a fuller example:
> >
> > > > databases.yml:
> >
> > > > all:
> > > >   propel:
> > > > class: sfPropelDatabase
> > > > param:
> > > >   dsn: 'mysql://pinpoint:p1np0...@196.37.40.73/pinpoint'
> >
> > > >   somedomain.org:
> > > > class: sfPropelDatabase
> > > > param:
> > > >   dsn: 'mysql://pinpoint:p1np0...@localhost/pinpoint'
> >
> > > >   somedomain.com:
> > > > class: sfPropelDatabase
> > > > param:
> > > >   dsn: 'mysql://pinpoint:p1np0...@196.37.40.73/pinpoint'
> >
> > > > In your Model classes overwrite calls to database by putting inside
> the
> > > > file:
> >
> > > > TableNamePeer
> >
> > > > public static function doSelect(Criteria $criteria, $con = null)
> > > > {
> > > > parent::doSelect($criteria,
> Propel::getConnection(str_replace("www.",
> > > > "", sfRequest::getHost(;
> >
> > > > }
> >
> > > > On Wed, Oct 14, 2009 at 5:47 PM, Carlos Jorge Andrade <
> >
> > > > carlos.andr...@gmail.com> wrote:
> >
> > > > > On 14, Oct 2009, at 13:48 , Gareth McCumskey wrote:
> >
> > > > > > First thing that goes through my mind is why you would want to do
> > > > > > that? databases.yml is where all database connections are defined
> > > > > > and you can create as many as you like in there.
> >
> > > > > Imagine the exact same codebase to power two different sites.
> > > > > Like somesite.com and somesite.org, one document root... depending
> on
> > > > > the domain accessed, the db connection would change. How would one
> do
> > > > > that ?
> >
> > > > >
> http://www.lampjunkie.com/2008/04/using-multiple-databases-in-symfony.
> > > ..
> >
> > > > > > On Wed, Oct 14, 2009 at 1:04 PM, Davide Borsatto <
> lloy...@gmail.com>
> > > > > > wrote:
> >
> > > > > > Hi everybody,
> >
> > > > > > Is there a way to specify the connection parameters (those
> normally
> > > > > > specified in databases.yml) via PHP? Maybe in the
> > > ProjectConfiguration
> > > > > > class, but how?
> >
> > > > > > --
> > > > > > Gareth McCumskey
> > > > > >http://garethmccumskey.blogspot.com
> > > > > > twitter: @garethmcc
> >
> > > > --
> > > > Gareth McCumskeyhttp://garethmccumskey.blogspot.com
> > > > twitter: @garethmcc
> >
> > --
> > Gareth McCumskeyhttp://garethmccumskey.blogspot.com
> > twitter: @garethmcc
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: filter a doctrine query

2009-10-16 Thread Alexandre SALOME
Create a Doctrine Behavior, like SoftDelete.

You will find lot of informations on the subject by reading the Doctrine
documentation (on the website) :

http://www.doctrine-project.org/documentation/manual/1_1/en/behaviors

Alexandre

2009/10/16 mbernasocchi 

>
> Hi, I was wondering if it is possible (I think I read it somewhere but
> I can't find it any more) to automatically filter all results of a
> query by a given parameter (as in soft delete).
> many of my classes have an is_abuse field and I'd like to filter (not
> show) all results that have it set to true without having to set a
> where clause in each query.
>
> thanks a lot Marco
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: One Application, Several Domains, Shared session

2009-10-16 Thread Alexandre SALOME
Warning : Session Fixation <http://en.wikipedia.org/wiki/Session_fixation>.

Maybe you should create a cross-application database with a table :

user_id  : integer
token: varchar(32)
created_at   : datetime

And use it to secure the transition from application to another. A simple
check would be "created less than 30 seconds ago".

Also take care that nobody can steal the session by passing the user a link,
or other hack techniques.

Give your solution here, we will give you a feedback.

Alexandre

2009/10/16 Jacob Coby 

>
> Cookies can't be shared across domains (only subdomains).  You'll have
> to  pass a session id between the domains.  I don't know if the
> standard symfony session handler can handle picking up an existing
> session based on a url param or if you'll have to use a custom session
> handler.
>
> On Oct 16, 2009, at 10:31 AM, kev wrote:
>
> >
> > @Alexandre : this seems to be for ONE domain and several subdomains...
> > this is not what i am trying to do!
> >
> > Thanks anyway.
> >
> > On Oct 16, 12:08 pm, Alexandre SALOME 
> > wrote:
> >> http://www.lmgtfy.com/?q=share+session+subdomains+symfony&l=1
> >>
> >> The first result
> >>
> >> 2009/10/16 kev 
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>> Hi all,
> >>
> >>> I checked on the forums and in this list, but failed to find any
> >>> post
> >>> presenting my current issue!
> >>> We have several domains using the same application (the user culture
> >>> depends of the domain name currently being browsed),
> >>> and we would like to share sessions when the end user jumps from one
> >>> domain to another. Ideally we would like the session id NOT to
> >>> appear
> >>> in the url...
> >>
> >>> Do you think this is doable? If so, any hint on how you would do
> >>> that?!
> >>
> >>> Thanks!
> >>
> >> --
> >> Alexandre Salomé -- alexandre.sal...@gmail.com
> > >
>
> --
> Jacob Coby
>
>
>
>
>
>
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Output escaping using htmlspecialchars should not double escape?

2009-10-19 Thread Alexandre SALOME
Check your settings.yml in config folder of your application. There is an
escaping strategy that can be enabled by default.

Make some debug to see if your variable during the process are as expected.

Alexandre


2009/10/19 gunnarlium 

>
> Hi!
>
> I have a problem with variables being double escaped when passed to a
> partial. I'm experiencing this issue for example with the & character.
> In the source code it ends up as &. This problem goes away if
> I hack EscapingHelper.php to add a fourth variable false to the
> htmlspecialchars.
>
> Why is this not the default options? Seems more sensible to me (at
> least for this use case)?
>
> Would it make sense to make configureable?
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Check form

2009-10-19 Thread Alexandre SALOME
Other solution : create a form and embed them in it :

class myForm extends sfForm
{
  public function configure()
  {
$this->embedForm(...);
$this->embedForm(...);
  }
}

Alexandre

2009/10/19 Alan Bem 

> Create 2 form-processing actions - one for each form - in your module and
> set its URLs for both forms - in their action attribute - respectively.
>
> Alan
>
>
> On Mon, Oct 19, 2009 at 8:13 PM, Eno  wrote:
>
>>
>> On Mon, 19 Oct 2009, HAUSa wrote:
>>
>> >
>> > Because I want the users to be able to use both forms in the same
>> > windows / screen.
>> >
>>
>> Is possible to have more than one form in a page that psot to different
>> URLs.
>>
>>
>> --
>>
>>
>>
>>
>>
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: .ext on the generated routes

2009-10-19 Thread Alexandre SALOME
Try this :

url_for('@homepage?sf_format=html')

Alexandre

2009/10/19 Alexandru-Emil Lupu 

> Hi there!
> It is any chance to automatically append to the generated urls a custom
> sf_format extension, without passing it as argument to the url functions
> (url_for, link_to etc)
>
> i mean i have this route:
>
> Homepage:
>   url: /index.:sf_format
>   params: .
>   requirements:
> sf_format: (?:html)
>
> when i use url_for(__('Home page'), '@homepage'), to render the url like:
> index.html
>
> Thanks.
>
> Alecs
>
> --
> As programmers create bigger & better idiot proof programs, so the universe
> creates bigger & better idiots!
> I am on web:  http://www.alecslupu.ro/
> I am on twitter: http://twitter.com/alecslupu
> I am on linkedIn: http://www.linkedin.com/in/alecslupu
> Tel: (+4)0748.543.798
>
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Optimizing Lots of Routes

2009-10-19 Thread Alexandre SALOME
Hello,

  You should reduce the number of URL, 3500 routes is not a normal
behavior... maybe you didn't made the proper way.

  You "generate" routes ???

What are them ?


2009/10/19 Jacob Coby 

>
> Hi all,
>
> I've been working on a symfony 1.2 app that includes a CMS.
> Unfortunately, the CMS system generates approximately 3000 routes
> programmatically across 4 different module/actions.   Unfortunately
> there is no sort of pattern to the routes and the cms uses the routing
> system to generate the final url.  For example, cms/index?id=23 would
> get translated to /about_us.  And cms/subpage?id=56 would get
> translated to /another_page.
>
> This generates a 6.5mb routing cache which expands to well over 64mb
> once running in PHP (I had to set the memory limit to 128mb just to
> get it running).  With a small EC2 instance (256mb), the site
> immediately starts to eat up the 200mb free and marches towards the
> swap of death.
>
> I tried writing a custom routing object that would query the database
> to do the routing, but it doesn't solve the problem of needing to
> generate the urls from page IDs.
>
> Does anyone have suggestions on how to get this routing system under
> control?
>
> Thanks,
> --
> Jacob Coby
>
>
>
>
>
>
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Routing with email addresses in URLs

2009-10-19 Thread Alexandre SALOME
Does it enter the action ?

try adding some debug code (echo "ok";exit;) at the beginning of
executeIndex method. Does it works ?

What does log files tell ? Which route did it matches ?

What kind of error do you have in development environment ? Stack trace ?

Good luck,

Alexandre

2009/10/19 Alexandru-Emil Lupu 

> try to md5 the email address. i guess it would be better .. and also would
> fix your problem ...
> i do not know why would you met that problem ..
>
> On Mon, Oct 19, 2009 at 8:50 PM, Eno  wrote:
>
>>
>>
>> In one of our apps, we have a routing rule with an email address in it:
>>
>> unsubscribeform:
>>  url:  /unsubscribe/email/:email
>>  param: { module: subscribe, action: index }
>>
>> So URLs will be like:
>>
>> http://www.domain.com/unsubscribe/email/e...@example.com
>>
>> This route worked fine in symfony 1.0, but in 1.2 we get a 404 error. We
>> also tried urlencoding the email address - this works in Firefox but IE
>> and Chrome url-decode before sending the HTTP request so it breaks.
>>
>> Any ideas on what's going on here?
>>
>>
>>
>> --
>>
>>
>>
>>
>>
>>
>
>
> --
> As programmers create bigger & better idiot proof programs, so the universe
> creates bigger & better idiots!
> I am on web:  http://www.alecslupu.ro/
> I am on twitter: http://twitter.com/alecslupu
> I am on linkedIn: http://www.linkedin.com/in/alecslupu
> Tel: (+4)0748.543.798
>
>
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: .ext on the generated routes

2009-10-19 Thread Alexandre SALOME
Look at this :
http://groups.google.com/group/symfony-users/browse_thread/thread/b8991d26a8bfc82f?pli=1

2009/10/19 Alexandru-Emil Lupu 

> hi!
> thanks, but this is exactly what i do not want to do (to pass to each
> url_for / link_to a sf_format parameter ).
>
> "automatically append to the generated urls a custom sf_format extension,
> *without **passing it as argument *to the url functions (url_for, link_to
> etc)"
>
> Alecs
>
> On Tue, Oct 20, 2009 at 12:13 AM, Alexandre SALOME <
> alexandre.sal...@gmail.com> wrote:
>
>> Try this :
>>
>> url_for('@homepage?sf_format=html')
>>
>> Alexandre
>>
>> 2009/10/19 Alexandru-Emil Lupu 
>>
>> Hi there!
>>> It is any chance to automatically append to the generated urls a custom
>>> sf_format extension, without passing it as argument to the url functions
>>> (url_for, link_to etc)
>>>
>>> i mean i have this route:
>>>
>>> Homepage:
>>>   url: /index.:sf_format
>>>   params: .
>>>   requirements:
>>> sf_format: (?:html)
>>>
>>> when i use url_for(__('Home page'), '@homepage'), to render the url like:
>>> index.html
>>>
>>> Thanks.
>>>
>>> Alecs
>>>
>>> --
>>> As programmers create bigger & better idiot proof programs, so the
>>> universe creates bigger & better idiots!
>>> I am on web:  http://www.alecslupu.ro/
>>> I am on twitter: http://twitter.com/alecslupu
>>> I am on linkedIn: http://www.linkedin.com/in/alecslupu
>>> Tel: (+4)0748.543.798
>>>
>>>
>>>
>>>
>>
>>
>> --
>> Alexandre Salomé -- alexandre.sal...@gmail.com
>>
>>
>>
>
>
> --
> As programmers create bigger & better idiot proof programs, so the universe
> creates bigger & better idiots!
> I am on web:  http://www.alecslupu.ro/
> I am on twitter: http://twitter.com/alecslupu
> I am on linkedIn: http://www.linkedin.com/in/alecslupu
> Tel: (+4)0748.543.798
>
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: embed forms and use_fields

2009-10-19 Thread Alexandre SALOME
Hello,

So I want to show/hide the form fields dynamically in the controller
dependent to the action

You are right :

your form will contains every fields : widgets and validators. Your
validator schema is simple and have strict rules for login and password.
Others are facultative.

So, set your two fields as required, leave the others as "free".

And create two templates :

One for registering, with show/hide
One other for profile, without show/hide

You can separate the two logical with isNew() method. isNew = insert =create
= registering // not isNew = update = edit = profile


About show/hide, you must consider the forms in two separate scopes :

1 - defining fields and rules on them to allow only some kind of values
: widgetSchema & validatorSchema

2 - displaying fields... This is not form but templating !

Have fun,

Alexandre

2009/10/19 mintao 

>
> Imagine this scenario (I think that's pretty common, so I don't
> understand why I can't find any solution):
>
> 1. For the subscription process I only have 2 mandatory fields
> "username" and "email". The password is created automatically.
>
> 2. Later, when the user is subscribed, he/she has the possibility to
> complete his/her profile with additional information like first name,
> last name, skype, etc.
>
> 3. For the login process I just need the username and password field
> to be displayed.
>
> So I want to show/hide the form fields dynamically in the controller
> dependent to the action. So I only need to know how to access the
> fields of an embedded form (which contains additional information to
> sfUserGuard).
>
> Best,
> Florian
>
>
> On Oct 19, 12:12 am, mintao  wrote:
> > if there's a field called "last_name" in the embedded form called
> > "profile", how can I access this?
> >
> > On 18 Okt., 11:15, geoffroy  wrote:
> >
> > > Hie,
> >
> > > I think you have ti unset() fields like :
> >
> > > class signForm extends PluginsfGuardUserForm
> > > {
> > >   public function configure()
> > >   {
> > > $form = new sfGuardUserProfileForm();
> > > $this->embedForm('profile', $form);
> >
> > > unset(
> > >   $this['filed_u_dont_want1],
> > >   $this['filed_u_dont_want2'],
> > > );
> > >   }
> >
> > > }
> >
> > > Or try to unset() fields in your sfGuardProfileForm extend class.
> >
> > > Geo
> >
> > > On Oct 17, 11:35 pm, mintao  wrote:
> >
> > > > Hi folks,
> >
> > > > it's really no fun for a newbie to configure the symfony forms. I'm
> > > > using 1.3Alpha2 and activated the plugin sfDoctrineUserGuard. The
> > > > description of this plugin is so old that nearly nothing of the
> > > > described steps worked.
> > > > So 3 days later I'm trying to set up a sign up form. Therefore I use
> > > > the sfGuardUserForm and  an embedded ProfileForm:
> >
> > > > class signForm extends PluginsfGuardUserForm
> > > > {
> > > >   public function configure()
> > > >   {
> > > > $form = new sfGuardUserProfileForm();
> > > > $this->embedForm('profile', $form);
> > > > $this->useFields(array(
> > > > 'username',
> > > > 'profile.email',
> > > > ));
> > > >   }
> >
> > > > }
> >
> > > > As you can imagine, I try only to display a username and  an email
> > > > field. The username is part of the plugin, the email is part of the
> > > > embedded form.
> >
> > > > My question: my version doesn't work. How can I display fields of
> > > > embedded forms?
> >
> >
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Caching strategy: 'with_layout: true' + filter to add dynamics

2009-10-19 Thread Alexandre SALOME
Have you tried to cache only partials/fragments ?

If the cache.yml doesn't fill your needs, you can create more specific
caching in your partials with cache() and cache_save() methods.

Example :

http://www.php.net/md5>($user->getEmail()), 86400)): ?>
  
// Your amazingly huge iteration processes here
  
  



Alexandre

2009/10/19 SA 

>
> Hello,
> we are developing a news website which mostly consists of constantly
> changing, but fully cacheable content, the only dynamic parts are ads
> which have to be selected randomly and user panel.
>
> We couldn't cache the pages with layout and had to include these
> components in the layout. The layout includes other components and
> actions that are cached in memcached. Profiling shows that even if the
> component is cached its a pretty costly operation to include it when
> you have many.
>
> This gives an idea of caching an action with layout and replacing
> dynamic parts of the page in a filter. Dynamic parts are marked by
> markers such as  or  include_ad_slot:main_slot -->. We tried this strategy and overhead
> added by this filters preg_match and replace seems to be minor -
> site's performance increased by 50%. I can't see any drawback in this
> now and I don't feel comfortable with it. :)
>
> What do you think of this strategy? Are we reinventing the wheel? Can
> we achieve this in a more 'standard' way?
>
> Please comment. Thanks.
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: loading old schema.yml with not existing table

2009-10-19 Thread Alexandre SALOME
Symfony 1.3 offers new tasks for removing old classes :

http://www.symfony-project.org/tutorial/1_3/en/whats-new#chapter_64a8dd2fac010cece60fe956d341725f_sub_new_tasks

Sure, you have to master your model, and know that when you're removing a
class from your schema, you have to remove the generated files.

But now you know ;)

Alexandre

2009/10/19 mini_alexander 

>
> I make that and then everything is ok but I thought that there is more
> comfortable way - maybe some command which I could write in console xD
>
> On 19 Paź, 16:19, Gareth McCumskey  wrote:
> > So go to your models folder and delete them. If you don't nothing bad
> > happens, those files just wont get used is all.
> >
> >
> >
> > On Mon, Oct 19, 2009 at 3:57 PM, mini_alexander 
> wrote:
> >
> > > Yes but Symfony doesn't delete old models.
> >
> > > On 19 Paź, 15:12, Gareth McCumskey  wrote:
> > > > Did you remember to clear cache after altering your schema.yml?
> >
> > > > On Mon, Oct 19, 2009 at 10:32 AM, mini_alexander <
> aoohra...@gmail.com
> > > >wrote:
> >
> > > > > In old schema.yml I had some table, then I deleted this table from
> > > > > schema.yml but this table is still creating when I write in
> console:
> > > > > php symfony doctrine:build-all-reload
> >
> > > > > I must delete from /lib/filter, /lib/form and /lib/model all files
> > > > > which have got in name, name this table and then after:
> > > > > php symfony doctrine:build-all-reload
> >
> > > > > everything is ok - I have in database tables from new schema.yml
> > > > > without this table, but it isn't comfortable - is other way ?
> >
> > > > --
> > > > Gareth McCumskeyhttp://garethmccumskey.blogspot.com
> > > > twitter: @garethmcc
> >
> > --
> > Gareth McCumskeyhttp://garethmccumskey.blogspot.com
> > twitter: @garethmcc
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: i18n form layout

2009-10-19 Thread Alexandre SALOME
It's possible.

Create your form formatted. OK, it's done

Now, register it in your widgetSchema with addFormFormatter (or something
like this) and enable it with setFormFormatter (or something like this).


2009/10/19 HAUSa 

>
> It is possible to make an own formatter for my forms. See the example:
>
> class kmFormFormatter extends sfWidgetFormSchemaFormatterTable{
>
>protected $rowFormat = '%label%%field%
> %hidden_fields%%error%%help%';
>protected $errorListFormatInARow = '%errors%';
>protected $errorRowFormatInARow  = '%error%';
>protected $helpFormat= '%help%';
>
> }
>
> Is it possible to change the formatter that generates the i18n fields?
> And how do I do that?
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Unset i18n field

2009-10-19 Thread Alexandre SALOME
I18n fields are not in the form, the in the i18nform.

Example :

CmsPageForm has embed CmsPageI18nForm

So go to your CmsPageI18nForm and unset "title" or "content" field.

Alexandre

2009/10/19 HAUSa 

>
> In my form class, I can unset several fields.
> But how can I unset an i18n field?
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: sfGuardAuth function Signin and StatusCode

2009-10-19 Thread Alexandre SALOME
symfony provides 2 special routes :

- signin
- secure

You can define them in "settings.yml" of your apps/.../config folder. They
will escape from the security filter, and you should consider them apart
from your website map.

These routes defines :

   - *signin* : You have to connect to continue. You will be redirected to
   referer, who redirected you to here, because you are Unauthorized.
   - *secure* : You don't have enough credentials. You already loggued in,
   but you are not "strong enough"

These pages are not aimed to be referenced.

If you want to create a referenceable page for signin/registering, an
"OK-page" you should create a new one who will not return the 401 code.

Default symfony/guardPlugin is 401.

** WARNING : This is just my opinion **

Alexandre


2009/10/19 Bertrand Zuchuat 

>
> Hi,
>
> Why, the signin page of sfGuardAuth module return a 401 status code
> and not 200 (on load -> /signin) ?
>
> For me, if the page is OK, the status returned is 200.
>
> Thank you.
>
> Bertrand
>
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Routing with email addresses in URLs

2009-10-19 Thread Alexandre SALOME
And what about logs ?

Do they talk of your route ?

Does it works with an URL with some text instead of mail ?

/unsubscribe/email/test for example.

Alexandre

2009/10/19 Eno 

>
> On Mon, 19 Oct 2009, Alexandre SALOME wrote:
>
> > Does it enter the action ?
>
> Doesn't get that far, because the module and action name don't appear to
> get matched at all.
>
> > What does log files tell ? Which route did it matches ?
> >
> >
> > What kind of error do you have in development environment ? Stack trace ?
>
> Yeah, sfError404Exception:
>
> 404 | Not Found | sfError404Exception
> Empty module and/or action after parsing the URL
> "/unsubscribe/email/e...@example.com" (/).
> stack trace
>
>* at ()
>  in SF_SYMFONY_LIB_DIR/controller/sfFrontWebController.class.php line
> 44 ...
>  41.
>  42.   if (empty($moduleName) || empty($actionName))
>  43.   {
>  44. throw new sfError404Exception(sprintf('Empty
> module and/or action after parsing the URL "%s" (%s/%s).',
> $request->getPathInfo(), $moduleName, $actionName));
>  45.   }
>  46.
>  47.   // make the first request
>* at sfFrontWebController->dispatch() in
> SF_SYMFONY_LIB_DIR/util/sfContext.class.php line 159 ...
> 156.*/
> 157.   public function dispatch()
> 158.   {
> 159. $this->getController()->dispatch();
> 160.   }
> 161.
> 162.   /**
>* at sfContext->dispatch()
>  in /home/web/htdocs/index.php line 10 ...
>
>
>
> Which isn't very useful :-)
>
>
> --
>
>
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Optimizing Lots of Routes

2009-10-19 Thread Alexandre SALOME
Check if your symfony is up to date. Some improvements were made in routing
system.

Read carefully the reference guide about routing :
http://www.symfony-project.org/reference/1_2/en/05-Factories#chapter_05_routing

Identify what could be done to optimize the loading/caching of your routes.
(I don't have your factories.yml file in head).

Maybe rewriting the sfPatternRouting could be a solution.

Sure, this is an expert problem !

Alexandre

2009/10/20 Frank Stelzer 

>
> Hi,
> In my pretty easy CMS application i have written a own configuration
> handler, which is called very early during a request.
> This request fetches all cms pages from the database and adds all
> according routes to the routing.
> In this way you could use the link_to and url_for helpers as you are
> used to.
> 3000 routes, that hurts :) for this reason i split another application
> into smaller applications and share other code in there.
>
> Frank
>
>
> Am 19.10.2009 um 22:38 schrieb Jacob Coby:
>
> >
> > Hi all,
> >
> > I've been working on a symfony 1.2 app that includes a CMS.
> > Unfortunately, the CMS system generates approximately 3000 routes
> > programmatically across 4 different module/actions.   Unfortunately
> > there is no sort of pattern to the routes and the cms uses the routing
> > system to generate the final url.  For example, cms/index?id=23 would
> > get translated to /about_us.  And cms/subpage?id=56 would get
> > translated to /another_page.
> >
> > This generates a 6.5mb routing cache which expands to well over 64mb
> > once running in PHP (I had to set the memory limit to 128mb just to
> > get it running).  With a small EC2 instance (256mb), the site
> > immediately starts to eat up the 200mb free and marches towards the
> > swap of death.
> >
> > I tried writing a custom routing object that would query the database
> > to do the routing, but it doesn't solve the problem of needing to
> > generate the urls from page IDs.
> >
> > Does anyone have suggestions on how to get this routing system under
> > control?
> >
> > Thanks,
> > --
> > Jacob Coby
> >
> >
> >
> >
> >
> >
> >
> > >
>
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Email address in URL leads to problem

2009-10-19 Thread Alexandre SALOME
This discussion is similar to this one :
http://groups.google.com/group/symfony-users/browse_thread/thread/a001363810c7a5d5/efd5f207f46253ad?hl=en&lnk=gst&q=email+route#efd5f207f46253ad

Please continue the discussion in the foreign, to find a solution faster.

Thanks,

Alexandre

2009/10/20 Sid Bachtiar 

>
> http://bluehorn.co.nz/2008/12/04/how-to-handle-dot-in-symfony-url/
>
> On Tue, Oct 20, 2009 at 1:47 PM, Steve Sanyal 
> wrote:
> >
> > Just a clarification.  This is a routing issue.  It does not seem like
> > symfony can parse the URL properly because it includes an email
> > address as one of the parameters.
> >
> > Regards,
> > Steve
> >
> > On Oct 19, 8:30 pm, Steve Sanyal  wrote:
> >> Hi,
> >>
> >> In my registration module, I have a URL which has the username
> >> embedded in it.  However, if the username itself is an email address
> >> it does not seem that this approach works:
> >>
> >> https://myapp/frontend_dev.php/registration/test%40example.com/xsdfsd.
> ..
> >>
> >> I get the following error:
> >>
> >> Empty module and/or action after parsing the URL
> >>
> >> Has anyone encountered this and is there a remedy other than not
> >> allowing usernames with email addresses in them?
> >>
> >> Thanks,
> >> Steve
> > >
> >
>
>
>
> --
> Blue Horn Ltd - System Development
> http://bluehorn.co.nz
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Test:All under Windows

2009-10-20 Thread Alexandre SALOME
A fixaround would be to create a batch :

c:\windows\system32\php.bat

that contains

"c:\program files\\php.exe" %1 %2 %3 %4 %5 %6 %7 %8 %9

But the best thing is to fix the symfony.bat file.

Try replacing lines 22 to 26 with :

IF EXIST ".\symfony" (
  "%PHP_COMMAND%" -d html_errors=off -d open_basedir= -q ".\symfony" %1 %2
%3 %4 %5 %6 %7 %8 %9
) ELSE (
  "%PHP_COMMAND%" -d html_errors=off -d open_basedir= -q
"%SCRIPT_DIR%\symfony" %1 %2 %3 %4 %5 %6 %7 %8 %9
)

If it fixes the problem, tell me, I will submit a patch to symfony.

Alexandre

2009/10/20 Gareth McCumskey 

> Wih I could offer more help. Its a shame you don't code on a *nix box
>
> On Tue, Oct 20, 2009 at 11:55 AM, ridcully wrote:
>
>>
>> Our Problems seem there is a space in the directoryname C:\program
>> file where the PHP executable lies.
>>
>> Google says it's a bug in symfony, is any workaround there?
>>
>> THX
>> Joerg
>>
>>
>> On Oct 20, 9:55 am, Gareth McCumskey  wrote:
>> > This is a path setting in windows. Look at the symfony.bat file and put
>> the
>> > correct path to your PHP executable.
>> >
>> > On Tue, Oct 20, 2009 at 9:50 AM, ridcully 
>> wrote:
>> >
>> > > Hi,
>> >
>> > > our test task failed under Windows, it says 'Unable to find PHP
>> > > executable'.
>> >
>> > > All other symfony task works, only the test task failed.
>> >
>> > > The Search Path is right and we're using 1.2.9 with doctrine.
>> >
>> > --
>> > Gareth McCumskeyhttp://garethmccumskey.blogspot.com
>> > twitter: @garethmcc
>>
>>
>
>
> --
> Gareth McCumskey
>
> http://garethmccumskey.blogspot.com
> twitter: @garethmcc
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Retrieving data from different models after a join. Unknowns methods

2009-10-21 Thread Alexandre SALOME
Hello,

  You can use $p->getQuestion() and $p->getInterview().

2009/10/21 cosmy 

>
> Hi all.
> I'm trying to get field values in my View after having done multiple
> joins between some tables (models) but i don't know how to do..
> I have three tables: Interview, Answer and Question.
> I want to show a single interview with all the Questions and the
> Answers related to that Interview (by the way, every Answer has got a
> related Question).
>
> So in my actions i have:
>  public function executeShow(sfWebRequest $request)
>  {
>$this->interview = Doctrine::getTable('Interview')->find($request-
> >getParameter('id'));
>$this->answers = Doctrine::getTable('Interview')->getAnswers
> ($request->getParameter('id'));
>$this->forward404Unless($this->interview);
>  }
>
> And in my InterviewTable.class.php:
>public function getAnswers($id){
>$q = Doctrine_Query::create()
>->from('Answer a')
>->leftJoin('a.Question q')
>->leftJoin('a.Interview i')
>->where('a.idInterview = ?', $id );
>
>return $q->execute();
>}
>
> But how do i do to get a parameter of Question in the View code?
>
> If i do:
>   
>getAnswerField() ?>
>getQuestionField() ?>">
>
>
> it gives me this error:
> Unknown method Answer::getQuestionField
>
> Of Course - i say - QuestionField is in Question model not in Answer
> one!! but i don't know how to make it works..
>
> Thank you in advance and sorry for my poor english. I hope you have
> understood what i want to say..
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: sfValidatorEmail and sfValidatorFile: always "Invalid"

2009-10-21 Thread Alexandre SALOME
The value returned by filters widgets are arrays :

array(
  [text] => "."
  [is_empty] => true/false
)

And sfValidatorEmail excepts a string.

You can use sfValidatorSchemaFilter class to filter a value :

$validator = new sfValidatorSchemaFilter("my_email_field", new
sfValidatorEmail());

I didn't try this, so I hope it will works ;) Otherwise, the answer is very
similar. Have a look at generated code.

Alexandre

2009/10/20 tirengarfio 

>
> Hi,
>
> I have created the backend for the sfGuardUser module.
>
> Then I have added the Profile fields to the filter using this tutorial
> (in spanish):
>
>
> http://jsangil.blogspot.com/2009/09/modificacion-de-filtros-en-symfony-para.html
>
> Now i have problems when i use "sfValidatorEmail" and
> "sfValidatorFile": after pushing Filter the text "Invalid" appears
> next to the field. It doesnt care if the field is empty or not or if
> the email is written correctly.
>
> Here you have the code:
>
>  
> /**
>  * sfGuardUser filter form.
>  *
>  * @packagefilters
>  * @subpackage sfGuardUser *
>  * @versionSVN: $Id: sfDoctrineFormFilterTemplate.php 11675
> 2008-09-19 15:21:38Z fabien $
>  */
> class sfGuardUserFormFilter extends PluginsfGuardUserFormFilter
> {
>  public function configure()
>  {
>
>  //Widgets para el filtro de los perfiles
>  $this->widgetSchema['nombre_apellidos'] = new sfWidgetFormFilterInput
> (array(
>  'with_empty' => false
>  ));
>
>
>  $this->widgetSchema['email'] = new sfWidgetFormFilterInput(array(
>  'with_empty' => false
>  ));
>
>  $this->widgetSchema['fotografia'] = new sfWidgetFormFilterInput(array
> (
>  'with_empty' => false
>  ));
>
>  // Validadores
>  $this->validatorSchema['nombre_apellidos'] = new sfValidatorPass
> (array(
>  'required' => false
>  ));
>
>
>  $this->validatorSchema['email'] = new sfValidatorPass(array(
>  'required' => false
>  ));
>
>  $this->validatorSchema['fotografia'] = new sfValidatorPass(array(
>  'required' => false
>  ));
>
>
>
>  }
>
>  public function addNombreApellidosColumnQuery(Doctrine_Query $query,
> $field, $values)
>  {
>//Se comprueba que no sea nulo el valor del campo del filtro
>if ($values['text'] != '') {
>  $query->from('sfGuardUser u')
>->innerJoin('u.Profile us')
>->andWhere("us.nombre_apellidos LIKE ?", '%'.$values
> ['text'].'%');
>}
>
>  }
>
>
>
> public function addEmailColumnQuery(Doctrine_Query $query, $field,
> $values)
> {
>
>  if ($values['text'] != '') {
>  $query->from('sfGuardUser u')
>->innerJoin('u.Profile us')
>->andWhere("us.email LIKE ?", '%'.$values['text'].'%');
>  }
>
> }
>
>
> public function addFotografiaColumnQuery(Doctrine_Query $query,
> $field, $values)
> {
>
>  if ($values['text'] != '') {
>  $query->from('sfGuardUser u')
>->innerJoin('u.Profile us')
>->andWhere("us.fotografia LIKE ?", '%'.$values['text'].'%');
>  }
>
> }
>
>
> public function getFields()
> {
>  return parent::getFields() + array(
>  'nombre_apellidos' => 'Text',
>  'email' => 'Text',
>  'fotografia' => 'Text'
>  );
> }
>
> }
>
> Any idea?
>
> Javi
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: doctrine blob field

2009-10-21 Thread Alexandre SALOME
Isn't it an escaping problem ?

Update a simple text file with "Hello World". Use it for
your tests and look at generated file & headers (and tell us :).

Alexandre

2009/10/16 David Régade 

>
> Hi,
>
> I use symfony with doctrine and I try to store some binary data in my
> MySQL database. So I defined a class with a blob field like this:
>
> File:
>  columns:
>id:
>  type: integer
>  primary: true
>  unsigned: true
>  notnull: true
>  autoincrement: true
>name:
>  type: string(255)
>size:
>  type: integer
>  unsigned: true
>  notnull: true
>mime_type:
>  type: string(255)
>binary_data:
>  type: blob
>
> I generate a module for this class. But unfortunatelly I can't access
> binary_data field in templates. binary_data field is ok in actions but
> never in templates.
> I try to create an action to download a file. Here is my action:
>
> public function executeGetFile(sfWebRequest $request) {
>$this->forward404Unless( $this->file = Doctrine::getTable('File')-
> >find(array($file_id)), sprintf('Object file does not exist (%s).',
> array( $file_id )) );
>
>$this->getResponse()->setHttpHeader('Content-Type', $this->file-
> >mime_type, true);
>$this->getResponse()->setHttpHeader('Content-Disposition',
> 'attachment; filename="'.$this->file->name.'"', true);
>
> //file_put_contents("/tmp/titi.pdf", $this->file->binary_data);
> }
>
> Here is my template:
> binary_data;
>
>
> No data is echoed, Is there a reason for that ?
>
> Regards
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: popup

2009-10-22 Thread Alexandre SALOME
Speak french, or go to symfony-fr.

Alexandre

Le 21 octobre 2009 17:47, hhaythem  a écrit :

>
> bonsoir tout le monde,
>
> je suis nouveau sur ce forum et débutant avec symfony, voila en bref
> j'ai besoin d'un peu d'aide concernant la création des fenêtres popup
> avec l'admin generator de symfony.
>
> pour être plus claire j'ai crée un object_action "addcomment" dans le
> generator.yml et par la suite je ne sais pas quoi mettre au niveau de
> la fonction addcomment() dans le fichier action.class.php pour que ce
> contrôle ouvre une fenêtre popup pour que je puisse saisir un
> commentaire.
>
> je vous remercie d'avance.
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: popup

2009-10-22 Thread Alexandre SALOME
What I wanted to say was : speak english :)

Le 23 octobre 2009 00:35, Alexandre SALOME  a
écrit :

> Speak french, or go to symfony-fr.
>
> Alexandre
>
> Le 21 octobre 2009 17:47, hhaythem  a écrit :
>
>
>> bonsoir tout le monde,
>>
>> je suis nouveau sur ce forum et débutant avec symfony, voila en bref
>> j'ai besoin d'un peu d'aide concernant la création des fenêtres popup
>> avec l'admin generator de symfony.
>>
>> pour être plus claire j'ai crée un object_action "addcomment" dans le
>> generator.yml et par la suite je ne sais pas quoi mettre au niveau de
>> la fonction addcomment() dans le fichier action.class.php pour que ce
>> contrôle ouvre une fenêtre popup pour que je puisse saisir un
>> commentaire.
>>
>> je vous remercie d'avance.
>>
>> >>
>>
>
>
> --
> Alexandre Salomé -- alexandre.sal...@gmail.com
>



-- 
Alexandre Salomé -- alexandre.sal...@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: having trouble customizing the admin generator

2009-10-22 Thread Alexandre SALOME
You should add widget/validator to your form.



2009/10/22 ashton 

>
> Hi,
> I'm trying to add a method ('endTime') that doesn't exist in the
> model, it's essentially a convenience method to set just the time part
> of time_ts which is a timestamp.  It shows up properly in the list,
> however, the widget is never populated with a value in the edit page.
> As far as I can tell, getEndTime never even gets called when loading
> the edit page, because when I put a 'die()' in there, execution never
> stops (although it does on the list page)
> Thx!
>
> Game.class.php
>public function getEndTime($format = 'H:i') {
>return date($format, strtotime($this->getEndTs()));
>}
>
>public function setEndTime($time) {
>$this->setEndTs($this->getDate().' '.$time);
>}
>
> generator:
>  class: sfDoctrineGenerator
>  param:
>model_class:   Game
>theme: jroller
>non_verbose_templates: true
>with_show: false
>singular:  ~
>plural:~
>route_prefix:  game
>with_doctrine_route: 1
>
>config:
>  actions: ~
>  fields:
>league_id: { label: League }
>field_id:  { label: Field }
>home_team_id:  { label: Home Team }
>away_team_id:  { label: Away Team }
>game_status_id:{ label: Status }
>start_ts:
>  label: Start
>  help: The day and time the this game starts
>end_ts:
>  label: End
>  help: The date and time that this game ends
>end_time:
>  label: End
>  help: The time that this game ends
>  list:
>display: [field, =game_status, home_team_id, away_team_id,
> start_ts, end_ts, end_time, score]
>
>  filter: ~
>  form:
>display: [field_id, game_status_id, home_team_id,
> away_team_id, start_ts, end_ts, end_time]
>  edit: ~
>  new:  ~
>
> symfony 1.2 / doctrine
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Editing imported data via form in unsaved object

2009-10-22 Thread Alexandre SALOME
Hello,

  Is it the generated form or did you add some code ? (copy/paste it if yes)

  Can you give us the POST variables too ?

  Can you give us the form names, the schema ?

  Thanks,

Alexandre

2009/10/22 phil0 

>
> I am importing some data from an external data source. For that I
> decided to load the data into a model object, and then pass that to a
> form (generated by Doctrine).
>
> The object that I am editing is has a many-to-many relation, so it
> seems that Doctrine saves the data temporarily and then deletes it
> again. This is not a problem as performance is not an issue for this
> backend functionality.
>
> The problem arises when the form is submitted. The "id" of the object
> is - because it was temporarily saved - set to an integer, but this no
> longer exists because Doctrine deleted it. This makes the form
> validation fail because the "id" is not empty and it doesn't exist in
> the database. This results in an "Id: Invalid." error on the id field.
>
> I would prefer not to save the object before editing it using the
> form, as the user might regret the import and therefore just go back.
> This would result in unedited data in the database.
>
> I hope that I clarified my problem enough - if you need sample code
> just tell me.
> I use symfony 1.3 and the Doctrine version that is in the 1.3 svn.
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Unit testing with fake model classes

2009-10-22 Thread Alexandre SALOME
In my opinion, you should rewrite your model with events.

Events-oriented model would be better for unit testing.

Alexandre

2009/10/22 Henning Glatter-Gotz 

>
> David,
>
> Thanks so much for pointing this out. At first glance this looks fantastic.
> I am more used to the xUnit family of testing frameworks because that is
> what I learned first and probably the reason I was a bit disappointed when
> reading the lime doc.
>
> In any case, I will definitely look into this. It does not solve all my
> problems, but it offers a whole bunch of useful things. And the rest is
> probably fixable by some refactoring of my code.
>
> Thanks
> Henning
>
> -Original Message-
> From: symfony-users@googlegroups.com [mailto:
> symfony-us...@googlegroups.com] On Behalf Of david
> Sent: Thursday, October 22, 2009 3:49 PM
> To: symfony-users@googlegroups.com
> Subject: [symfony-users] Re: Unit testing with fake model classes
>
>
> Take a look at the lime plugin - which extends lime - it appears to
> support auto-creation of mock objects.
>
> http://webmozarts.com/2009/06/30/easy-unit-testing/
>
> On Thu, 22 Oct 2009 21:32:13 +0200, Henning Glatter-Gotz
>  wrote:
>
> > Thomas,
> >
> >
> > Thanks for your reply.
> >
> > Not sure if that would be practical:
> >
> >
> > Class MyClass
> >
> > {
> >
> >:
> >
> >:
> >
> >public function doSomething($parameters)
> >
> >{
> >
> >   :
> >
> >   //do a bunch of processing
> >
> >   :
> >
> >   $db = new MyModel();
> >
> >   :
> >
> >   // set model properties
> >
> >   :
> >
> >   $db->save();
> >
> >   :
> >
> >   return some_status;
> >
> >}
> >
> >:
> >
> > }
> >
> >
> > I would like to unit test the method doSomething. Problem is when
> > running in production mode I want it to construct an object of type
> > MyModel and actually save the data to the database.
> >
> > However, when running a unit test, I need the line
> >
> >
> > $db = new MyModel();
> >
> >
> > to be
> >
> >
> > $db = new MyModelFake();
> >
> >
> > I see two ways around this:
> >
> >
> > 1.   Pass in the model objects to be used either as a parameter to
> > the method or in the constructor. That way I can pass in the real thing
> > in production and a fake one in test mode. The problem with this is,
> > that if you have a lot of dependencies you end up passing in a tone of
> > objects. What if you need 3 instances of the same object? Just does not
> > seem very “clean”.
> >
> >
> >
> > 2.   Use a factory:
> > $db = ModelFactory->getMyModel();
> > then you could just pass in a reference to the factory and when you
> > construct the factory you tell it whether to construct real model
> > objects or fake ones.
> >
> >
> > PHPUnit has a really cool feature for this, it will create Mock objects
> > for you based on the real object, so there is not even any hand coding
> > necessary. Does Lime have something like this?
> >
> >
> > Thanks
> >
> > Henning
> >
> >
> > From: symfony-users@googlegroups.com
> > [mailto:symfony-us...@googlegroups.com] On Behalf Of Thomas Rabaix
> > Sent: Thursday, October 22, 2009 3:05 PM
> > To: symfony-users@googlegroups.com
> > Subject: [symfony-users] Re: Unit testing with fake model classes
> >
> >
> > You can open a transaction and just rollback at the end.
> >
> > On Thu, Oct 22, 2009 at 8:58 PM, Henning Glatter-Gotz
> >  wrote:
> >
> > Hi,
> >
> >
> > I have a class I would like to unit/functional test that uses several
> > propel model classes that are used to write to the db (in this scenario
> > I am not getting any data out of the db). At this point I am not worried
> > about checking if data actually ends up in the db, I will rely on propel
> > to do its job.
> >
> >
> > So what I really want is the ability to inject fake model objects that
> > do not actually write to the database when I am running a unit test. The
> > fake model could be a class derived from the actual model where the save
> > method is overridden and simply returns 0 (or whatever other value I
> > want) and does nothing else.
> >
> >
> > The problem I am having is how to go about injecting the fakes. I don’t
> > really want to have to pass a reference of all model objects into my
> > object because I sometimes need multiple instances of the same class. So
> > what I would need is for the class I am testing to know which model
> > class to instantiate (MyModelReal or MyModelFake).
> >
> > To follow a good design principle of decoupling dependencies it would
> > probably be a good idea to not even have the model object construction
> > inside my object in the first place, but rather use a factory that knows
> > how to construct model objects and is environment aware (if running in
> > test it would construct fakes and otherwise the ‘real’ models).
> >
> >
> > I know of http://components.symfony-project.org/dependency-injection/.
> > It is not part of sf 1.2.x. Has anyone used this in sf 1.2.x?
> >
> > Does anyone have other suggesti

[symfony-users] Re: js for module/action and authorized user

2009-10-22 Thread Alexandre SALOME
In your template :

hasCredentials(...)): ?>



2009/10/21 Konrad 

>
> Hi,
>
> does anybody know how to include specific js script (file) for
> specific module/action only for authorized users in a nice/proper way?
>
> thx in advance.
> Konrad
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: fcgi apache mod_rewrite problems aka No Input file specified.

2009-10-22 Thread Alexandre SALOME
If you have problem with Apache, please go to Apache group.

2009/10/20 Jesse 

>
> So we have the following problem when trying to switch over to fcgi
> rather than mod_php
>
> I can get all normal symfony routes etc working fine. The only issue
> is when we try to do special rewrites for certain paths using
> mod_rewrite. For instance: (from .htaccess in the webroot)
>
> RewriteRule ^celebrities/$ index.php/celebrities [L]
>
> What I think happens is that fcgi is set to catch anything ending
> in .php
>
> Mod_rewrite catches that url and then redirects apache to
>
> index.php/celebrities
>
> When that happens apache fires off the fcgi process to parse index.php/
> celebrities
>
> Then php responds with:
>
> "No Input file specified."
>
> Meaning it can't find the php file
>
> I have tried forcing php to look for the index.php file in the webroot
> by setting the
>
> doc_root="/usr/local/apache2/htdocs/web"
>
> variable in the php.ini but that didn't do anything.
>
> I have also tried to set the
>
> cgi.fix_pathinfo=1 also in the php.ini (tried both 1 and 0)
>
> And the
>
> FcgidFixPathinfo 1 in the httpd.conf (again tried both 1 and 0)
>
> And that didn't help either.
>
> I think that php is finding the docroot fine though because going to
> normal index.php or any route in symfony that does not have a
> mod_rewrite rule pointing it to So we have the following problem when
> trying to switch over to fcgi rather than mod_php
>
> I can get all normal symfony routes etc working fine. The only issue
> is when we try to do special rewrites for certain paths using
> mod_rewrite. For instance: (from .htaccess in /www/web/)
>
> RewriteRule ^celebrities/$ index.php/celebrities [L]
>
> What I think happens is that fcgi is set to catch anything ending
> in .php
>
> Mod_rerite catches that url first and then redirects apache to
>
> index.php/celebrities
>
> When that happens apache fires off the fcgi process to parse index.php/
> celebrities
>
> Then php responds with:
>
> No Input file specified.
>
> Meaning it can't find the php file
>
> I have tried forcing php to look for the index.php file in the webroot
> by setting the doc_root=/usr/local/apache2/htdocs/web
>
> Variable but that didn't do anything.
>
> I have also tried to set the
>
> cgi.fix_pathinfo=1 in the php ini (tried both 1 and 0)
>
> And the
>
> FcgidFixPathinfo 1 in the httpd.conf (again tried both 1 and 0)
>
> And that didn't help either.
>
> I think that php is finding the docroot fine though because going to
> normal index.php or any route in symfony that does NOT have a
> mod_rewrite rule pointing it to index.php/blah works fine. I can only
> imagine that php is confused by the index.phpSLASH (SLASH being /
> obviously)
>
> Other people (using other frameworks software etc that use a
> querystring ie index.php?path=blah are able to use the above settings
> successfully albeit in a number of different combinations. All of
> which I have tried)
>
> Is there anyway to get symfony to work somehow with a ? Rather than
> a / when NOT using "pretty/clean/nice/short" urls
>
> Like could we setup symfony to recognize index.php?path=celebrities
>
> I think if we can do that we are golden.
>
> FYI the reason for the mod_rewrite rules in the first place is because
> there are also DIRECTORIES in the webroot that have the same name as
> those paths ie "/www/web/celebrities/". So without the rewrite rules
> apache throws a blank page because there is no index file in those
> directories.
>  works fine. I can only imagine that php is confused by the
> index.phpSLASH (SLASH being / obviously)
>
> Other people (using other frameworks software etc that use a
> querystring ie index.php?path=blah are able to use the above settings
> successfully albeit in a number of different combinations. All of
> which I have tried)
>
> Is there anyway to get symfony to work somehow with a ? Rather than
> a / when NOT using "pretty/clean/nice/short" urls
>
> Like could we setup symfony to recognize index.php?path=celebrities
>
> FYI the reason for the mod_rewrite rules in the first place is because
> there are also DIRECTORIES in the webroot that have the same name as
> those paths ie "/www/web/celebrities/". So without the rewrite rules
> apache throws a blank page because there is no index file in those
> directories.
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: feed cache and sf_foramt

2009-10-22 Thread Alexandre SALOME
You can do that using cache() and cache_save() methods in your template :


   


Refer to doc.

Alexandre

2009/10/20 shin 

>
> Hello,
>
> I would like to use cache, but only for feed.
> I have an action called "list". and it has two templates, which are
> html and atom.
>
> listSuccess.php
> listSuccess.atom.php
>
> I want atom to cache, but not html.
>
> Has anybody dones this?
>
> --
> shin
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Readonly fields in Admin generator

2009-10-22 Thread Alexandre SALOME
You should remove widget/validator from the form and use a partial in your
form to display value.

Alexandre

2009/10/21 Morris 

>
> Hello,
>
> I'm a beginner with Symfony. Intend to use version 1.3 (currently
> working with alpha1) to develop an admin interface to a website with
> 4-5 tables.
>
> I have generated the backend application with the admin-generator and
> is working fine, but I need that the user can see some fields but I
> don't want him to change anything there. In one screen that happen
> with all the values so I could just overwrite the edit action to don't
> perform any action at all, just a message to the user that this screen
> is just readonly. I know that this is an awful workaround and I'm
> quite sure that there are many other ways of doing this but I can't
> find any other. Furthermore this will not work for other screen where
> some fields are editable and other are readonly.
>
> So, please any comment would help and remember that I'm a beginner so
> maybe I have forgotten a basic issue that will help me out...
>
> Thank you.
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: publication application

2009-10-22 Thread Alexandre SALOME
To publish a project, just ZIP it ;)

There is no magic method, you have deploy method, it allows you to export
your project to a remote server.

No freeze task.

2009/10/20 a b 

>
> I want to publish project.
> Should I write command: symfony project:freeze ?? Because here:
> http://www.symfony-project.org/jobeet/1_2/Doctrine/en/23
> there is nothing about freeze so I don't know.
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: file upload problem?

2009-10-22 Thread Alexandre SALOME
First, refactor your code :

Actions

class myModelActions extends sfActions
{
  public function executeIndex($request)
  {
$this->form = new WebsiteForm();
if ($request->isMethod('post'))
  {
$this->form->bind($request->getParameter('website'),
$request->getFiles('website'));
   if ($this->form->isValid())
   {
 $this->form->save();

$this->redirect('website/show?id='.$this->form->getObject()->getId());
   }
}
  }
}

Forms

class myModelForm extends myBaseModelForm
{
  public function updateObject($values)
  {
parent::updateObject($values);
if ($values === null)
{
  $values = $this->values;
}
$file = $values['file'];
// $file should be a sfValidatedFile
$this->getObject()->setUploadFile($file);
  }
}

Model

class myModel extends myBaseModel
{
  protected $pendingUploadFile = null;

  public function setUploadFile($file)
  {
$this->pendingUploadFile();
  }

  public function preSave()
  {
if ($this->pendingUploadFile !== null)
{
   // do your stuff here
}
  }
}

Not sure it will works if you copy/paste, but the idea is here.

Alex'


2009/10/20 mel_06 <06melc...@gmail.com>

>
> i'm just new to symfony, i'm working with file upload and everytime i
> upload a file the output is "csrf token: Required."
>
> here's my code:
>
> my action
>
> public function executeIndex($request)
> {
> $this->form = new WebsiteForm();
> if ($request->isMethod('post'))
> {
> $this->form->bind($request->getParameter('website'), $request->getFiles
> ('website'));
> if ($this->form->isValid())
> {
> $file = $this->form->getValue('file');
>
> $filename = 'uploaded_'.sha1($file->getOriginalName());
> $extension = $file->getExtension($file->getOriginalExtension());
> $file-> save(sfConfig::get('sf_upload_dir').'/'.$filename.
> $extension );
>
> $web = $this->form->save();
>
> $this->redirect('website/show?id='.$web->getId());
> }
> }
>
> }
>
> my form:
>
> public function configure()
> {
> $this->setWidgets(array(
> 'file' => new sfWidgetFormInputFile(),
>
> ));
>
> $this->validatorSchema['image'] = new sfValidatorFile(array(
> 'required' => false,
> 'path' => sfConfig::get('sf_upload_dir') . '/directory',
> 'mime_types' => 'web_images'
> ));
>
> $this->validatorSchema['image']->setOption('mime_type_guessers', array
> (
> array($this->validatorSchema['image'], 'guessFromFileinfo'),
> array($this->validatorSchema['image'], 'guessFromFileBinary'),
> array($this->validatorSchema['image'], 'guessFromMimeContentType')
> ));
>
> }
>
> public function save($con = null)
> {
> if (file_exists($this->getObject()->getFile()))
> {
> unlink($this->getObject()->getFile());
> }
>
> $file = $this->getValue('file');
> $filename = sha1($file->getOriginalName()).$file->getExtension($file-
> >getOriginalExtension());
> $file->save(sfConfig::get('sf_upload_dir').'/'.$filename);
>
> return parent::save($con);
> }
>
> my template:
>
>  enctype="multipart/form-data">
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
>
>
> anyone?
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: sfValidatorEmail and sfValidatorFile: always "Invalid"

2009-10-22 Thread Alexandre SALOME
It works with string.

So if you give it an array, it will not works.

2009/10/21 tirengarfio 

>
>
>
> On Oct 21, 1:22 pm, Alexandre SALOME 
> wrote:
>
> > And sfValidatorEmail excepts a string.
>
> Thanks Alexandre, but... what do you mean with that sentence? Sorry
> because my english..
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: where do I insert my hit counter?

2009-10-22 Thread Alexandre SALOME
The thing you should change is your boss ;)

I'm kidding :P There are several ways for making a counter and depending of
required stats, each solution has his advantages.

In your case, create an integer field on your model and increment it each
time the object is displayed.

public function executeIndex(...)
{
  ...
  $myModel->hitView();
  ...
}

And in your model :

public function hitView()
{
 $this->setDisplayed($this->getDisplayed() + 1);
 $this->save();
}


Simple is better,

Alex'

2009/10/21 aymeric 

>
> My boss is happy with the stats he gets from the current hit function
> (even if it is totally overestimated since the sales division use this
> site at least 10 times/person/day). I just need somthing simple
> (GAnalytics will come someday but not from me).
>
> thanks for the advices
>
> On Oct 20, 8:13 pm, Eno  wrote:
> > On Tue, 20 Oct 2009, Gareth McCumskey wrote:
> > > True. But again some people don't want the n'th degree of statistics
> and a
> > > basic counter is sufficient. Its all about his requirements. I'm a fan
> of
> > > not over complicating a solution to your needs.
> >
> > Pretty funny statement, considering that most analytics are simple
> > Javascript includes (vs. writing some action/database code :-)
> >
> > --
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Test:All under Windows

2009-10-22 Thread Alexandre SALOME
> A fixaround would be to create a batch :
>
> c:\windows\system32\php.bat
>
> that contains
>
> "c:\program files\\php.exe" %1 %2 %3 %4 %5 %6 %7 %8 %9


2009/10/20 ridcully 

>
> The Idee comes not from us, Zend Server CE install PHP under Programm
> Files.
>
> On Oct 20, 2:40 pm, david  wrote:
> > It's generally not a good idea to have php installed under "program
> files"
> > - suggest to your colleague to reinstall it to a folder under the root of
>
> > a drive - ie "C:\php" - it'll save you a lot of headaches both now and
> > later.
> >
> > On Tue, 20 Oct 2009 14:34:45 +0200, ridcully 
>
> > wrote:
> >
> >
> >
> >
> >
> > > I'm coding on a Mac, but a collegue is coding on a Windows System, and
> > > i think it's not a shame to code under Windows.
> >
> > > But the the php.bat is not the Problem, because a symfony.bat
> > > doctrine:build-all-reload works 100% on this Windows system.
> >
> > > I think the testrunner wants to create a new PHP Task from the PHP
> > > script and fails to locate php, because of the space in the path.
> > > Both fixaround doesn't fix the problem at this Windows System.
> > > Can I do anything ?
> >
> > > On Oct 20, 1:31 pm, Alexandre SALOME 
> > > wrote:
> > >> A fixaround would be to create a batch :
> >
> > >> c:\windows\system32\php.bat
> >
> > >> that contains
> >
> > >> "c:\program files\\php.exe" %1 %2 %3 %4 %5 %6 %7 %8 %9
> >
> > >> But the best thing is to fix the symfony.bat file.
> >
> > >> Try replacing lines 22 to 26 with :
> >
> > >> IF EXIST ".\symfony" (
> > >>   "%PHP_COMMAND%" -d html_errors=off -d open_basedir= -q ".\symfony"
> %1
> > >> %2
> > >> %3 %4 %5 %6 %7 %8 %9
> > >> ) ELSE (
> > >>   "%PHP_COMMAND%" -d html_errors=off -d open_basedir= -q
> > >> "%SCRIPT_DIR%\symfony" %1 %2 %3 %4 %5 %6 %7 %8 %9
> > >> )
> >
> > >> If it fixes the problem, tell me, I will submit a patch to symfony.
> >
> > >> Alexandre
> >
> > >> 2009/10/20 Gareth McCumskey 
> >
> > >> > Wih I could offer more help. Its a shame you don't code on a *nix
> > >> box
> >
> > >> > On Tue, Oct 20, 2009 at 11:55 AM, ridcully
> > >> wrote:
> >
> > >> >> Our Problems seem there is a space in the directoryname C:\program
> > >> >> file where the PHP executable lies.
> >
> > >> >> Google says it's a bug in symfony, is any workaround there?
> >
> > >> >> THX
> > >> >> Joerg
> >
> > >> >> On Oct 20, 9:55 am, Gareth McCumskey  wrote:
> > >> >> > This is a path setting in windows. Look at the symfony.bat file
> > >> and put
> > >> >> the
> > >> >> > correct path to your PHP executable.
> >
> > >> >> > On Tue, Oct 20, 2009 at 9:50 AM, ridcully
> > >> 
> > >> >> wrote:
> >
> > >> >> > > Hi,
> >
> > >> >> > > our test task failed under Windows, it says 'Unable to find PHP
> > >> >> > > executable'.
> >
> > >> >> > > All other symfony task works, only the test task failed.
> >
> > >> >> > > The Search Path is right and we're using 1.2.9 with doctrine.
> >
> > >> >> > --
> > >> >> > Gareth McCumskeyhttp://garethmccumskey.blogspot.com
> > >> >> > twitter: @garethmcc
> >
> > >> > --
> > >> > Gareth McCumskey
> >
> > >> >http://garethmccumskey.blogspot.com
> > >> > twitter: @garethmcc
> >
> > >> --
> > >> Alexandre Salomé -- alexandre.sal...@gmail.com
> >
> > --
> > Using Opera's revolutionary e-mail client:http://www.opera.com/mail/
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: ffmpeg on symfony?

2009-10-23 Thread Alexandre SALOME
You should isolate your system call, for example making an interfaced class
:

class myShell
{
  public function execute($command)
  {
 // your stuff
  }
}

And use this class to make some actions, for example logging the command
before executing.

Check what command is executed, check the return values, etc.

Read the doc : http://fr.php.net/manual/fr/function.exec.php

Use the 2nd and 3rd argument to retrieve output & return code, make some
var_dump. Your method code should look like this :

$this->log("Executing command $command");
exec($command, $returnValue, $returnCode);
$this->log("Return code : $returnCode");
$this->log("Output : ".implode("\n", $returnValue));

Tell us output and return code.

Alexandre

2009/10/23 mel_06 <06melc...@gmail.com>

>
> i'm just new to symfony, i'm having trouble with using ffmpeg on
> symfony. i just modified this code which work properly on code igniter
> framework for symfony. but it doesn't save the 10sec audio file on the
> directory path? and i need to save this as well to the database?
>
> here's my code:
>
> public function executeIndex($request)
>
>  {
>$this->form = new WebsiteForm();
>if ($request->isMethod('post'))
>{
>  $this->form->bind($request->getParameter('website'), $request-
> >getFiles('website'));
>
>  if ($this->form->isValid())
>{
>
>  $file = $this->form->getValue('file');
>
>  $filename = 'uploaded_'.sha1($file->getOriginalName());
>  $extension = $file->getExtension($file->getOriginalExtension
> ());
>  $file->save(sfConfig::get('sf_upload_dir').'/'.$filename.
> $extension);
>
>  $uploaded = $this->form->save();
>
>  $ffmpegPath = 'c:\wamp\bin\ffmpeg\bin\ffmpeg.exe';
>  $sourcePath =
> sfConfig::get('sf_upload_dir').'/'.$uploaded->getFile
> ();;
>  $destinationPath = sfConfig::get
> ('sf_upload_dir').'/'.'_preview'.$uploaded->getFile();;
>
>  if ( $this->form->getValue('streamtype') == '10' ) {
>
>  exec($ffmpegPath.' -i '.$sourcePath.' -t 10 -acodec copy '.
> $destinationPath);
>
> unlink($sourcePath);
>
>($destinationPath, sfConfig::get('sf_upload_dir').$filename.
> $extension);
>
>  }
>
>  $this->redirect('website/show?id='.$uploaded->getId());
>
>}
>}
>  }
>
> i would really appreciate some help. thanks guys!
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: disabled user solution for symfony

2009-10-23 Thread Alexandre SALOME
Overload the signin action, and make your test in it : if the account is
disabled, redirect to your special page, else, login.

Which ORM/symfony version are you using ?

2009/10/23 Steve Sanyal 

>
> Hi,
>
> Has anyone come across any good solutions for having a disabled user
> in symfony?  Ideally, I'd like a person whose account has been
> disabled to be sent to a special page.  I'm using sfguard for my login
> and ACL.  Currently, I just change the user's active status to false,
> but this merely prevents the user from logging in.
>
> Regards,
> Steve
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Editing imported data via form in unsaved object

2009-10-23 Thread Alexandre SALOME
lang: { type: char(2), default: da, notnull: true }
>  actAs:
>Sluggable: { fields: [name], uniqueBy: [lang,name] }
> DrinkIngredient:
>  columns:
>drink_id:
>  type: integer
>  primary: true
>ingredient_id:
>  type: integer
>  primary: true
>measurement_id:
>  type: integer
>amount:
>  type: string(50)
>  relations:
>Drink:
>  type: one
>  local: drink_id
>  foreign: id
>Ingredient:
>  type: one
>  local: ingredient_id
>  foreign: id
>Measurement:
>  type: one
>  local: measurement_id
>  foreign: id
>DrinkIngredient:
>  type: many
>  local: drink_id
>  foreign: drink_id
>
> Ingredient:
>  columns:
>id:
>  type: integer
>  primary: true
>  autoincrement: true
>name: string(255)
>description: string(255)
>lang: { type: char(2), default: da, notnull: true }
>  indexes:
>slug:
>  fields: [slug]
>  actAs:
>Sluggable:
>  unique: true
>  fields: [name]
>  canUpdate: true
>SoftDelete:
>Timestampable:
>  relations:
>DrinkIngredient:
>  type: many
>  local: id
>  foreign: ingredient_id
> Drink:
>  columns:
>id:
>  type: integer
>  primary: true
>  autoincrement: true
>name:
>  type: string(255)
>  notnull: true
>description: string
>user_id: integer
>category_id:
>  type: integer
>  notnull: true
>rating:
>  notnull: true
>  type: float
>  default: 0
>votes:
>  type: integer
>  default: 0
>views:
>  type: integer
>  default: 0
>image_id: integer
>glass_id: integer
>lang: { type: char(2), default: da, notnull: true }
>  actAs:
>Sluggable:
>  unique: true
>  fields: [name]
>  canUpdate: true
>SoftDelete:
>Timestampable:
>  updated:
>disabled: true
>  indexes:
>slug:
>  fields: [slug]
>  relations:
>User:
>  local: user_id
>  foreign: id
>  type: one
>DrinkCategory:
>  local: category_id
>  foreign: id
>  type: one
>DrinkIngredient:
>  type: many
>  local: id
>  foreign: drink_id
>  onDelete: CASCADE
>DrinkComment:
>  foreignAlias: Comments
>  local: id
>  foreign: drink_id
>  onDelete: CASCADE
>  type: many
>Image:
>  local: image_id
>  foreign: id
>  type: one
>DrinkGlass:
>  foreignAlias: glass
>  local: glass_id
>  foreign: id
>  type: one
>  foreignType: many
>
> Don't worry about the mess, it will be fixed later - first it has to
> work :)
>
> On Oct 23, 8:39 am, Alexandre SALOME 
> wrote:
> > Hello,
> >
> >   Is it the generated form or did you add some code ? (copy/paste it if
> yes)
> >
> >   Can you give us the POST variables too ?
> >
> >   Can you give us the form names, the schema ?
> >
> >   Thanks,
> >
> > Alexandre
> >
> > 2009/10/22 phil0 
> >
> >
> >
> >
> >
> > > I am importing some data from an external data source. For that I
> > > decided to load the data into a model object, and then pass that to a
> > > form (generated by Doctrine).
> >
> > > The object that I am editing is has a many-to-many relation, so it
> > > seems that Doctrine saves the data temporarily and then deletes it
> > > again. This is not a problem as performance is not an issue for this
> > > backend functionality.
> >
> > > The problem arises when the form is submitted. The "id" of the object
> > > is - because it was temporarily saved - set to an integer, but this no
> > > longer exists because Doctrine deleted it. This makes the form
> > > validation fail because the "id" is not empty and it doesn't exist in
> > > the database. This results in an "Id: Invalid." error on the id field.
> >
> > > I would prefer not to save the object before editing it using the
> > > form, as the user might regret the import and therefore just go back.
> > > This would result in unedited data in the database.
> >
> > > I hope that I clarified my problem enough - if you need sample code
> > > just tell me.
> > > I use symfony 1.3 and the Doctrine version that is in the 1.3 svn.
> >
> > --
> > Alexandre Salomé -- alexandre.sal...@gmail.com
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Test:All under Windows

2009-10-23 Thread Alexandre SALOME
Ark..

So move your PHP installation, or make a patch for symfony.

Alexandre

2009/10/23 ridcully 

>
> The Batch Solution doesn't work, the only thing works is to copy the
> whole PHP Executables out of Program Files and set a PHP_Path to this
> new Directory.
>
> THX
> Jörg
>
> On Oct 23, 1:20 am, Alexandre SALOME 
> wrote:
> > > A fixaround would be to create a batch :
> >
> > > c:\windows\system32\php.bat
> >
> > > that contains
> >
> > > "c:\program files\\php.exe" %1 %2 %3 %4 %5 %6 %7 %8 %9
> >
> > 2009/10/20 ridcully 
> >
> >
> >
> >
> >
> > > The Idee comes not from us, Zend Server CE install PHP under Programm
> > > Files.
> >
> > > On Oct 20, 2:40 pm, david  wrote:
> > > > It's generally not a good idea to have php installed under "program
> > > files"
> > > > - suggest to your colleague to reinstall it to a folder under the
> root of
> >
> > > > a drive - ie "C:\php" - it'll save you a lot of headaches both now
> and
> > > > later.
> >
> > > > On Tue, 20 Oct 2009 14:34:45 +0200, ridcully <
> ohnhei...@googlemail.com>
> >
> > > > wrote:
> >
> > > > > I'm coding on a Mac, but a collegue is coding on a Windows System,
> and
> > > > > i think it's not a shame to code under Windows.
> >
> > > > > But the the php.bat is not the Problem, because a symfony.bat
> > > > > doctrine:build-all-reload works 100% on this Windows system.
> >
> > > > > I think the testrunner wants to create a new PHP Task from the PHP
> > > > > script and fails to locate php, because of the space in the path.
> > > > > Both fixaround doesn't fix the problem at this Windows System.
> > > > > Can I do anything ?
> >
> > > > > On Oct 20, 1:31 pm, Alexandre SALOME 
> > > > > wrote:
> > > > >> A fixaround would be to create a batch :
> >
> > > > >> c:\windows\system32\php.bat
> >
> > > > >> that contains
> >
> > > > >> "c:\program files\\php.exe" %1 %2 %3 %4 %5 %6 %7 %8 %9
> >
> > > > >> But the best thing is to fix the symfony.bat file.
> >
> > > > >> Try replacing lines 22 to 26 with :
> >
> > > > >> IF EXIST ".\symfony" (
> > > > >>   "%PHP_COMMAND%" -d html_errors=off -d open_basedir= -q
> ".\symfony"
> > > %1
> > > > >> %2
> > > > >> %3 %4 %5 %6 %7 %8 %9
> > > > >> ) ELSE (
> > > > >>   "%PHP_COMMAND%" -d html_errors=off -d open_basedir= -q
> > > > >> "%SCRIPT_DIR%\symfony" %1 %2 %3 %4 %5 %6 %7 %8 %9
> > > > >> )
> >
> > > > >> If it fixes the problem, tell me, I will submit a patch to
> symfony.
> >
> > > > >> Alexandre
> >
> > > > >> 2009/10/20 Gareth McCumskey 
> >
> > > > >> > Wih I could offer more help. Its a shame you don't code on a
> *nix
> > > > >> box
> >
> > > > >> > On Tue, Oct 20, 2009 at 11:55 AM, ridcully
> > > > >> wrote:
> >
> > > > >> >> Our Problems seem there is a space in the directoryname
> C:\program
> > > > >> >> file where the PHP executable lies.
> >
> > > > >> >> Google says it's a bug in symfony, is any workaround there?
> >
> > > > >> >> THX
> > > > >> >> Joerg
> >
> > > > >> >> On Oct 20, 9:55 am, Gareth McCumskey 
> wrote:
> > > > >> >> > This is a path setting in windows. Look at the symfony.bat
> file
> > > > >> and put
> > > > >> >> the
> > > > >> >> > correct path to your PHP executable.
> >
> > > > >> >> > On Tue, Oct 20, 2009 at 9:50 AM, ridcully
> > > > >> 
> > > > >> >> wrote:
> >
> > > > >> >> > > Hi,
> >
> > > > >> >> > > our test task failed under Windows, it says 'Unable to find
> PHP
> > > > >> >> > > executable'.
> >
> > > > >> >> > > All other symfony task works, only the test task failed.
> >
> > > > >> >> > > The Search Path is right and we're using 1.2.9 with
> doctrine.
> >
> > > > >> >> > --
> > > > >> >> > Gareth McCumskeyhttp://garethmccumskey.blogspot.com
> > > > >> >> > twitter: @garethmcc
> >
> > > > >> > --
> > > > >> > Gareth McCumskey
> >
> > > > >> >http://garethmccumskey.blogspot.com
> > > > >> > twitter: @garethmcc
> >
> > > > >> --
> > > > >> Alexandre Salomé -- alexandre.sal...@gmail.com
> >
> > > > --
> > > > Using Opera's revolutionary e-mail client:http://www.opera.com/mail/
> >
> > --
> > Alexandre Salomé -- alexandre.sal...@gmail.com
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Required fields i18n

2009-10-23 Thread Alexandre SALOME
Well, i think you mean : "fill all the required, or none" ?

Because this is good for en, but what if 2 objects of the same class does
not fill the same language...

2009/10/23 michael.pie...@googlemail.com 

>
> I solved it this way:
> In your form configure method (i18n form):
>
> /* set required if object culture is 'en' */
> $required = ($this->getObject()->getCulture() === 'en') ? true :
> false;
>
> $this->setValidators(array(
>  'name'=> new sfValidatorString(array('required' =>
> $required)),
> ));
>
> Hope this helps ...
> Michael
>
>
> On 23 Okt., 10:49, HAUSa 
> wrote:
> > In my ObjectI18nForm I made several fields required.
> > I embedded the ObjectI18nForm for two languages in my ObjectForm.
> >
> > Ofcourse, in both languages the fields are required. But I want my
> > user to be able to submit only one language, he / she is not required
> > to complete the fields for both languages.
> >
> > Anyone who knows how I can handle this?
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: User culture is not the same locally

2009-10-23 Thread Alexandre SALOME
clear-cache on production ?

2009/10/23 aymeric 

>
> In settings.yml I have set the default laguage to fr and $sf_user-
> >getCulture() returns 'fr' when called on my localhost.
> If I upload my project on my webhost $sf_user->getCulture() returns
> 'en'. The only difference between the 2 folders is in database.yml
> where I changed the username and password for DB connection.
> My browser is set to french as the prefered language and setCulture is
> never used at this time in the project.
>
> Any idea?
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Another local/distant difference : sfDoctrineGuard popup

2009-10-23 Thread Alexandre SALOME
With logs, you will be able to understand what's happening in this loop. See
log/frontend_prod.log

Alexandre

2009/10/23 aymeric 

>
> An other strange thing happened :
> when I open my backend app from the localhost I get a login form (and
> that's normal),
> but if I open this same app from my webhost I get a popup that loops
> on itself if I try to use it.
> If I cancel the popup on its first appearance I'm redirected on the
> desired login form (if I try to log with the popup and then cancel it
> I get a  'not the right permissions' page.
>
> I think it comes from the server and since I don't have access to its
> config I guess I should be happy :
> I have a higher security level on my backend with this fake login
> popup.
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Another local/distant difference : sfDoctrineGuard popup

2009-10-23 Thread Alexandre SALOME
t)
> Oct 23 14:34:37 symfony [info] {sfPatternRouting} Connect
> sfDoctrineRoute "sf_guard_user_delete" (/sf_guard_user/:id.:sf_format)
> Oct 23 14:34:37 symfony [info] {sfPatternRouting} Connect
> sfDoctrineRoute "sf_guard_user_show" (/sf_guard_user/:id.:sf_format)
> Oct 23 14:34:37 symfony [info] {sfPatternRouting} Connect
> sfDoctrineRoute "sf_guard_user_object" (/
> sf_guard_user/:id/:action.:sf_format)
> Oct 23 14:34:37 symfony [info] {sfPatternRouting} Connect
> sfDoctrineRoute "sf_guard_user_collection" (/sf_guard_user/:action/
> action.:sf_format)
> Oct 23 14:34:37 symfony [info] {sfPatternRouting} Match route
> "homepage" (/) for / with parameters array (  'module' => 'article',
> 'action' => 'index',)
> Oct 23 14:34:39 symfony [info] {sfFilterChain} Executing filter
> "sfRenderingFilter"
> Oct 23 14:34:39 symfony [info] {sfFilterChain} Executing filter
> "sfBasicSecurityFilter"
> Oct 23 14:34:39 symfony [info] {sfFilterChain} Executing filter
> "sfRenderingFilter"
> Oct 23 14:34:39 symfony [info] {sfFilterChain} Executing filter
> "sfCommonFilter"
> Oct 23 14:34:39 symfony [info] {sfFilterChain} Executing filter
> "sfExecutionFilter"
> Oct 23 14:34:39 symfony [info] {sfGuardAuthActions} Call
> "sfGuardAuthActions->executeSignin()"
> Oct 23 14:34:39 symfony [info] {sfPHPView} Render "ROOT_DIRECTORY/
> plugins/sfDoctrineGuardPlugin/modules/sfGuardAuth/templates/
> signinSuccess.php"
> Oct 23 14:34:39 symfony [info] {sfPHPView} Decorate content with
> "ROOT_DIRECTORY\apps\coulisses\templates/layout.php"
> Oct 23 14:34:39 symfony [info] {sfPHPView} Render "ROOT_DIRECTORY\apps
> \coulisses\templates/layout.php"
> Oct 23 14:34:39 symfony [info] {sfWebResponse} Send status "HTTP/1.1
> 401 Unauthorized"
> Oct 23 14:34:39 symfony [info] {sfWebResponse} Send header "Content-
> Type: text/html; charset=iso-8859-1"
> Oct 23 14:34:39 symfony [info] {sfWebDebugLogger} Configuration
> 5097.21 ms (13)
> Oct 23 14:34:39 symfony [info] {sfWebDebugLogger} Action "sfGuardAuth/
> signin" 14.09 ms (1)
> Oct 23 14:34:39 symfony [info] {sfWebDebugLogger} View "Success" for
> "sfGuardAuth/signin" 49.27 ms (1)
> Oct 23 14:34:39 symfony [info] {sfWebResponse} Send content (39862 o)
>
> Maybe the Send status "HTTP/1.1 401 Unauthorized" response is the
> cause.
>
> On 23 oct, 13:37, Alexandre SALOME  wrote:
> > With logs, you will be able to understand what's happening in this loop.
> See
> > log/frontend_prod.log
> >
> > Alexandre
> >
> > 2009/10/23 aymeric 
> >
> >
> >
> >
> >
> >
> >
> > > An other strange thing happened :
> > > when I open my backend app from the localhost I get a login form (and
> > > that's normal),
> > > but if I open this same app from my webhost I get a popup that loops
> > > on itself if I try to use it.
> > > If I cancel the popup on its first appearance I'm redirected on the
> > > desired login form (if I try to log with the popup and then cancel it
> > > I get a  'not the right permissions' page.
> >
> > > I think it comes from the server and since I don't have access to its
> > > config I guess I should be happy :
> > > I have a higher security level on my backend with this fake login
> > > popup.
> >
> > --
> > Alexandre Salomé -- alexandre.sal...@gmail.com
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: having trouble customizing the admin generator

2009-10-23 Thread Alexandre SALOME
Try adding an updateEndTimeColumn method in your form :

class GameForm extends ...
{
  // ..

  public function updateEndTimeColumn($value)
  {
die("yes !");
$this->getObject()->setEndTime($value);
  }
}

Alexandre

2009/10/23 ashton 

>
> I have already added those.  The widget shows up on the edit page,
> just without any content in it. i.e. it's always at 00:00
> thought I had that info on there, sry.
>
> GameForm.class.php
>   protected $minutes = array('00','05',
> 10,15,20,25,30,35,40,45,50,55);
>   public function configure()
>   {
>   $timeOptions = array('can_be_empty' => false,
>'minutes' => $this->minutes);
>
>$this->widgetSchema['end_time'] = new sfWidgetFormTime
> ($timeOptions);
>$this->validatorSchema['end_time'] =
>   new sfValidatorTime(array('required' => false));
>
> On Oct 22, 4:37 pm, Alexandre SALOME 
> wrote:
> > You should add widget/validator to your form.
> >
> > 2009/10/22 ashton 
> >
> >
> >
> >
> >
> >
> >
> > > Hi,
> > > I'm trying to add a method ('endTime') that doesn't exist in the
> > > model, it's essentially a convenience method to set just the time part
> > > of time_ts which is a timestamp.  It shows up properly in the list,
> > > however, the widget is never populated with a value in the edit page.
> > > As far as I can tell, getEndTime never even gets called when loading
> > > the edit page, because when I put a 'die()' in there, execution never
> > > stops (although it does on the list page)
> > > Thx!
> >
> > > Game.class.php
> > >public function getEndTime($format = 'H:i') {
> > >return date($format, strtotime($this->getEndTs()));
> > >}
> >
> > >public function setEndTime($time) {
> > >$this->setEndTs($this->getDate().' '.$time);
> > >}
> >
> > > generator:
> > >  class: sfDoctrineGenerator
> > >  param:
> > >model_class:   Game
> > >theme: jroller
> > >non_verbose_templates: true
> > >with_show: false
> > >singular:  ~
> > >plural:~
> > >route_prefix:  game
> > >with_doctrine_route: 1
> >
> > >config:
> > >  actions: ~
> > >  fields:
> > >league_id: { label: League }
> > >field_id:  { label: Field }
> > >home_team_id:  { label: Home Team }
> > >away_team_id:  { label: Away Team }
> > >game_status_id:{ label: Status }
> > >start_ts:
> > >  label: Start
> > >  help: The day and time the this game starts
> > >end_ts:
> > >  label: End
> > >  help: The date and time that this game ends
> > >end_time:
> > >  label: End
> > >  help: The time that this game ends
> > >  list:
> > >display: [field, =game_status, home_team_id, away_team_id,
> > > start_ts, end_ts, end_time, score]
> >
> > >  filter: ~
> > >  form:
> > >display: [field_id, game_status_id, home_team_id,
> > > away_team_id, start_ts, end_ts, end_time]
> > >  edit: ~
> > >  new:  ~
> >
> > > symfony 1.2 / doctrine
> >
> > --
> > Alexandre Salomé -- alexandre.sal...@gmail.com
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Project Deployment

2009-10-23 Thread Alexandre SALOME
!!! Double check
http://132.147.160.108/civil_users/config/databases.ymldoesn't works
!!!

2009/10/23 mirfan 

>
> thanks a lot it works when i clear the cache
>
> On Oct 23, 6:44 pm, Eno  wrote:
> > On Fri, 23 Oct 2009, mirfan wrote:
> > > i have disable no_script_name and enable mod_rewrite but it still not
> > > working
> >
> > Did you clear cache?
> >
> > --
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Required fields i18n

2009-10-23 Thread Alexandre SALOME
OK sorry, I thought you wanted something more specific : one language form
must be filled. english, or spanish or french.

But if the only required form is english... you're done ;)

2009/10/23 michael.pie...@googlemail.com 

>
> That "I'm not sure i understand you" was for Alexandre ...
>
> @HAUSa: this was the same problem i had and the code i wrote in my
> first post did it for me ...
>
> Michael
>
> On 23 Okt., 15:04, HAUSa 
> wrote:
> > Exactly. I want to be 100% sure that one language is completed. But
> > the user may choose for himself if he wants to make his content
> > available in other languages.
> >
> > On 23 okt, 14:44, "michael.pie...@googlemail.com"
> >
> >
> >
> >  wrote:
> > > I'm not sure i understand you ...
> >
> > > This works for me when i want the 'name' field in my i18n form to be
> > > 'required', but only for the 'en' language (in this example). So if i
> > > have 3 cultures and submit the main form, i get an error beside the
> > > empty 'name' widget, but only for the specified language.
> >
> > > On 23 Okt., 13:36, Alexandre SALOME 
> > > wrote:
> >
> > > > Well, i think you mean : "fill all the required, or none" ?
> >
> > > > Because this is good for en, but what if 2 objects of the same class
> does
> > > > not fill the same language...
> >
> > > > 2009/10/23 michael.pie...@googlemail.com <
> michael.pie...@googlemail.com>
> >
> > > > > I solved it this way:
> > > > > In your form configure method (i18n form):
> >
> > > > > /* set required if object culture is 'en' */
> > > > > $required = ($this->getObject()->getCulture() === 'en') ? true :
> > > > > false;
> >
> > > > > $this->setValidators(array(
> > > > >  'name'=> new sfValidatorString(array('required' =>
> > > > > $required)),
> > > > > ));
> >
> > > > > Hope this helps ...
> > > > > Michael
> >
> > > > > On 23 Okt., 10:49, HAUSa <
> jeroen_heeft_behoefte_aan_r...@hotmail.com>
> > > > > wrote:
> > > > > > In my ObjectI18nForm I made several fields required.
> > > > > > I embedded the ObjectI18nForm for two languages in my ObjectForm.
> >
> > > > > > Ofcourse, in both languages the fields are required. But I want
> my
> > > > > > user to be able to submit only one language, he / she is not
> required
> > > > > > to complete the fields for both languages.
> >
> > > > > > Anyone who knows how I can handle this?
> >
> > > > --
> > > > Alexandre Salomé -- alexandre.sal...@gmail.com
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: disabled user solution for symfony

2009-10-23 Thread Alexandre SALOME
So the other part would be to overload the hasCredentials method and add in
the top of it :

if (!$this->isActive())
{
  return false;
}

Other solution : create a filter : if the user account is inactive, redirect
him

class myFilter extends sfFilter
{
  public function execute($filterChain)
  {
$context = $this->getContext();
// do your stuff with $context->getResponse() and $context->getRequest()
and $context->getUser()
  }
}

and register it in the filters.yml


2009/10/23 Steve Sanyal 

>
> I've already overloaded signin for a few other reasons, but the
> solution you suggest would would only be part of the solution, because
> if I disable a user I would have to remove all of the user's
> permissions also.  Otherwise, the user could manually navigate to a
> page to which he/she had access.  If the user has a remember cookie to
> bypass signin they could also avoid the disabled status.
>
> Ideally I'd rather not have to remove all the ACL permissions because
> this creates an additional maintenance tasks, for example if I were to
> later re-enable the user.  It would be much more user friendly if I
> could simply disable at which point ACL permissions would be ignored,
> but the user would get sent to a page explaining the user has been
> disabled.
>
> To be comprehensive, this needs to hook into whenever permissions are
> checked, almost an "allow_disabled_access" in the security.yml, so
> public pages would be visible by the user but secure pages would not.
>
> Steve
>
> On Oct 23, 3:07 am, Alexandre SALOME 
> wrote:
> > Overload the signin action, and make your test in it : if the account is
> > disabled, redirect to your special page, else, login.
> >
> > Which ORM/symfony version are you using ?
> >
> > 2009/10/23 Steve Sanyal 
> >
> >
> >
> > > Hi,
> >
> > > Has anyone come across any good solutions for having a disabled user
> > > in symfony?  Ideally, I'd like a person whose account has been
> > > disabled to be sent to a special page.  I'm using sfguard for my login
> > > and ACL.  Currently, I just change the user's active status to false,
> > > but this merely prevents the user from logging in.
> >
> > > Regards,
> > > Steve
> >
> > --
> > Alexandre Salomé -- alexandre.sal...@gmail.com
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: i18n get other language

2009-10-25 Thread Alexandre SALOME
Hi,

  You should create your own I18N template, inspired from the I18N Doctrine
Template.


2009/10/25 HAUSa 

>
> I have several i18n fields in my advertisement model, for example
> title and description.
>
> When a user submits an advertisement, he / she has to complete those
> fields in their own foreign language and in English. For example: if a
> German user submits, he / she has to complete it in DE and EN. A
> French user has to submit in FR and EN, an English user only in EN.
>
> But now I have a problem. When a Dutch user (with language NL) views
> an advertisement submitted by a French user (FR and EN submitted), the
> Dutch user sees no title and description. That's because no NL title
> and description are submitted.
>
> Here comes my question:
> How can I say to Symfony that if the chosen language (NL) is not
> available, it automatically has to take the submitted values for EN?
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: i18n get other language

2009-10-25 Thread Alexandre SALOME
Ho :) Propel... Not very friendly with templates.

In your model, you could add default_title, default_description, and display
them as english language.

Others (FR, NL, ...) would be in I18N tables.

And create methods :

getTitle()
{
  if ($title = parent::getTitle())
  {
return $title;
  }
  else
  {
return $this->getDefaultTitle();
  }
}


There is no "magic" method to do what you want.

2009/10/25 HAUSa 

>
> I use Propel.
> How can I create my own i18n template? Not really heard of it
> before :)
>
> On 25 okt, 16:54, Alexandre SALOME  wrote:
> > Hi,
> >
> >   You should create your own I18N template, inspired from the I18N
> Doctrine
> > Template.
> >
> > 2009/10/25 HAUSa 
> >
> >
> >
> >
> >
> > > I have several i18n fields in my advertisement model, for example
> > > title and description.
> >
> > > When a user submits an advertisement, he / she has to complete those
> > > fields in their own foreign language and in English. For example: if a
> > > German user submits, he / she has to complete it in DE and EN. A
> > > French user has to submit in FR and EN, an English user only in EN.
> >
> > > But now I have a problem. When a Dutch user (with language NL) views
> > > an advertisement submitted by a French user (FR and EN submitted), the
> > > Dutch user sees no title and description. That's because no NL title
> > > and description are submitted.
> >
> > > Here comes my question:
> > > How can I say to Symfony that if the chosen language (NL) is not
> > > available, it automatically has to take the submitted values for EN?
> >
> > --
> > Alexandre Salomé -- alexandre.sal...@gmail.com
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Column type 'char' mistreated by Doctrine.

2009-10-25 Thread Alexandre SALOME
You should rely the information on the doctrine-users group.

J. Wage will help you ;)

Alexandre

2009/10/25 ColinFine 

>
> The "symfony and Doctrine" book, in chapter 4, has a table headed
> 'data types', which includes inter alia 'char'.
> The Doctrine manual, chapter 7, lists column types and does not
> include 'char'.
>
> I decided to try Doctrine in a new project, having only used Propel
> before. Working from the symfony and Doctrine book, I created my
> schema with 'char' throughout.
>
> 'symfony doctrine:build-db' and all the related commands accepted
> this, and apparently created my (postgres) database successfully. But
> as soon as I try to save something I get an exception with the not-
> very-useful message "Validation error in class Book ".
>
> Of course I had no idea what this might mean. I went googling and
> found some advice about using Doctrine_Exception::getInvalidRecords
> and Doctrine_ErrorStack::getRecords. Fortunately I am not a beginner
> in symfony, only in Doctrine, so I had a ghost of an idea how I might
> use this.
>
> Overriding 'save' to catch the exception and write this stuff to the
> logger, I get
>  [_errors:protected] => Array
>(
>[nickname] => Array
>(
>[0] => type
>)
>
>)
>
>[_validators:protected] => Array
>(
>)
>
>
> which told me that no validators had failed, but it didn't like the
> column 'nickname'., for some unclear reason.
>
> Eventually I traced through the Doctrine source, and found that
> Doctrine_Validator has a hard-coded list of types which does not
> include 'char' .(It also does not include 'varchar', 'bit', 'varbit',
> or 'inet')
>
> So unless I'm missing something, we have
> - a minor bug in Doctrine, whereby the schema parsing can cope with
> types that the Validation system throws out
> - a more serious bug in Doctrine, where when this happens, it gives an
> entirely useless message
> - a documentation bug in symfony that turns this minor Doctrine bug
> into a showstopper for a novice.
>
> Am I missing something?
>
> (I wondered about versions. I have not found a way to tell what
> version of Doctrine I have, but it's whatever came with symfony 1.2.1.
> Does the symfony/Doctrine book refer to Doctrine 2 or something?)
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: set sf_user id to a doctrine model

2009-10-26 Thread Alexandre SALOME
You must set the user ID after saving.

A possible solution would be to pass a sfGuardUser on saving of form :

class PostForm
{
  // ...
  public function save($author, Doctrine_Connection $conn = null)
  {
$this->setAuthor($author);
$this->save($conn);
  }
}

Another way would be to add a method setAuthor($author) and save method will
check if an author was given.

Alexandre

2009/10/26 mbernasocchi 

>
> Hi, I've a Post model in my app, I need to set the author Id of the
> post to the id of the logge user (as in any forum). I succeeded by
> overwriting the save() method of the Post.class.php and making it like
> this:
>
>  public function save(Doctrine_Connection $conn = null)
>  {
>if ($this->isNew())
>{
>  $this->setUserId(sfContext::getInstance()->getUser()-
> >getGuardUser());
>}
>return parent::save($conn);
>  }
>
> but I don't like the thissolution at all because it mixes up
> application layers and sfContext is not set during doctrine tasks.
>
> I managed as well to pass the default user from the action to the
> form, like this:
>
> public function executeNew(sfWebRequest $request)
>  {
>$open_bubble = new OpenBubble();
>$open_bubble->setUserId($this->getUser()->getGuardUser());
>$this->form = new OpenBubbleForm($open_bubble);
>  }
>
> but then in the form the userId can still be selected, and I unset
> ($this['user_is']) in the form, then I get a null id.
>
> any suggestions? this should be really easy no?
>
> cheers marco
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Redirect from component

2009-10-26 Thread Alexandre SALOME
The answser is just no. Component are not supposed to handle routing
logical.

Refactor your code


2009/10/26 HAUSa 

>
> Is it possible to redirect from a component?
> Because the redirect() function doesn't work (Call to undefined method
> systemComponents::redirect)
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: DOCTRINE - load data to tables which has got a relation !!

2009-10-26 Thread Alexandre SALOME
   1. You mustn't set "1" as user_id" but the alias "dziobacz".
   2. You mustn't set id column
   3. You must set different names for fixtures.
   4. You must use relation names for fixtures


Well, let's rewrite :

sfGuardUser:
  sgu_dziobacz:
   username: dziobacz
   password: haslo123

sfGuardUserProfile:
  sgp_dziobacz:
   sfGuardUser: sgu_dziobacz
   name: xyz
   email: x...@gmail.com

Read carefully the Doctrine Guide, you will learn lot of useful things.

Alexandre

2009/10/26 dziobacz 

>
> I have got table sfGuardUser and sfGuardUserProfile. Table
> sfGuardUserProfile in schema.yml:
> sfGuardUserProfile:
>  columns:
>id:
>  type: integer(4)
>  primary: true
>  autoincrement: true
>user_id:
>  type: integer(4)
>  default: ''
>  notnull: true
>  unique: true
>name:
>  type: string(50)
>  default: ''
>  notnull: true
>email:
>  type: string(50)
>  default: ''
>  notnull: true
>  unique: true
>  relations:
>sfGuardUser:
>  class: sfGuardUser
>  local: user_id
>  foreign: id
>  type: one
>  onDelete: CASCADE
>  onUpdate: CASCADE
>
> I have got file 10_user.yml:
> sfGuardUser:
>  dziobacz:
>id: 1
>username: dziobacz
>password: haslo123
>
> And file 20_profile.yml:
> sfGuardUserProfile:
>  dziobacz:
>user_id: 1
>name: xyz
>email: x...@gmail.com
>
> And when I try to load data:
> php symfony doctrine:data-load
>
> I get error:
> General error: 1452 Cannot add or update a child row: a foreign key
> constraint fails ('dziobaczmodule/sf_guard_user_profile', CONSTRAINT
> 'sf_guard_user_profile_ibfk_1' FOREIGN KEY ('user_id') REFERENCE
> 'sf_guard_user' ('id') ON DELETE CASCADE ON UPDATE CASCADE)
>
> I can't add row to table sfGuardUserProfile - is it normal ??
> >
>



-- 
Alexandre Salomé -- alexandre.sal...@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: how to build a form for multiple uploads?

2009-10-26 Thread Alexandre SALOME
You can have a look at upload plugins in the plugins repository on website.

Maybe you fill find a plugin that fill your needs.

Otherwise, sourcecode will help you to find an approach.

Alexandre

2009/10/26 mel_06 <06melc...@gmail.com>

>
> i'm just new to symfony, used to code igniter before.
>
> i'm doing a multiple upload but i'm really stuck on how i will do my
> form for this.
>
> i do hope for someone's help.
>
> thanks in advance
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: set sf_user id to a doctrine model

2009-10-26 Thread Alexandre SALOME
The idea :

class PostForm
{
  protected $author;

  public function setAuthor($author)
  {
$this->author = $author;
  }

  public function save(Doctrine_Connection $conn = null)
  {
if ($this->author !== null)
{
  $this->getObject()->setAuthor($this->author);
}
parent::save($conn);
  }
}

And in your action :

$this->form->setAuthor($this->getUser()->getGuardUser());
$this->form->save();



2009/10/26 mbernasocchi 

>
> thanks a lot,
> I see how to handle it now, just putting the save method as you said
> gives me the following warning:
> Strict Standards: Declaration of OpenBubbleForm::save() should be
> compatible with that of sfFormDoctrine::save() in /home/me/
> nosoapnobubbles/trunk/lib/form/doctrine/OpenBubbletForm.class.php on
> line 10
>
> and as well I get Call to undefined method OpenBubbleForm::setAuthor
> (), I tried calling it as well setUserId and setuser_id and always get
> the same.
>
> my model is:
> columns:
> user_id:
>  type: integer(4)
>   notnull: true
> relations:
>Author:
>   class: sfGuardUser
>  local: user_id
>  foreign: id
>   foreignAlias: OpenBubbles
>  onDelete: cascade
>  onUpdate: restrict
>
> $this in the OpenBubbleForm.class.php is the form not the OpenBubble
> (post) no?
>
> thanks again Marco
>
> On Oct 26, 5:04 pm, Alexandre SALOME 
> wrote:
> > You must set the user ID after saving.
> >
> > A possible solution would be to pass a sfGuardUser on saving of form :
> >
> > class PostForm
> > {
> >   // ...
> >   public function save($author, Doctrine_Connection $conn = null)
> >   {
> > $this->setAuthor($author);
> > $this->save($conn);
> >   }
> >
> > }
> >
> > Another way would be to add a method setAuthor($author) and save method
> will
> > check if an author was given.
> >
> > Alexandre
> >
> > 2009/10/26 mbernasocchi 
> >
> >
> >
> >
> >
> > > Hi, I've a Post model in my app, I need to set the author Id of the
> > > post to the id of the logge user (as in any forum). I succeeded by
> > > overwriting the save() method of the Post.class.php and making it like
> > > this:
> >
> > >  public function save(Doctrine_Connection $conn = null)
> > >  {
> > >if ($this->isNew())
> > >{
> > >  $this->setUserId(sfContext::getInstance()->getUser()-
> > > >getGuardUser());
> > >}
> > >return parent::save($conn);
> > >  }
> >
> > > but I don't like the thissolution at all because it mixes up
> > > application layers and sfContext is not set during doctrine tasks.
> >
> > > I managed as well to pass the default user from the action to the
> > > form, like this:
> >
> > > public function executeNew(sfWebRequest $request)
> > >  {
> > >$open_bubble = new OpenBubble();
> > >$open_bubble->setUserId($this->getUser()->getGuardUser());
> > >$this->form = new OpenBubbleForm($open_bubble);
> > >  }
> >
> > > but then in the form the userId can still be selected, and I unset
> > > ($this['user_is']) in the form, then I get a null id.
> >
> > > any suggestions? this should be really easy no?
> >
> > > cheers marco
> >
> > --
> > Alexandre Salomé -- alexandre.sal...@gmail.com
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: set sf_user id to a doctrine model

2009-10-26 Thread Alexandre SALOME
Yes,

A strict PHP object standard is "when you overload a method, you must set
the same "signature" :

   - same method name
   - same arguments
   - same types

To make simple, you must copy/paste the function declaration line of
sfDoctrineForm.class.php :

public function save(...)


to yourForm.php


2009/10/26 mbernasocchi 

>
> thanks, it works as expected, I just had to add
> return parent::save($conn); instead of only parent::save($conn); to be
> able to use the object in a template.
>
> the only thing is that i stll get the same warning about the strict
> standard:
> Strict Standards: Declaration of OpenBubbleForm::save() should be
> compatible with that of sfFormDoctrine::save() in /home/marco/
> nosoapnobubbles/trunk/lib/form/doctrine/OpenBubbleForm.class.php on
> line 10
>
> do you know what it means? I suppose my save() method is not complete
> enough... like add transactions or so... any pointer there? thanks
> again
> Marco
>
> On Oct 26, 8:34 pm, Alexandre SALOME 
> wrote:
> > The idea :
> >
> > class PostForm
> > {
> >   protected $author;
> >
> >   public function setAuthor($author)
> >   {
> > $this->author = $author;
> >   }
> >
> >   public function save(Doctrine_Connection $conn = null)
> >   {
> > if ($this->author !== null)
> > {
> >   $this->getObject()->setAuthor($this->author);
> > }
> > parent::save($conn);
> >   }
> >
> > }
> >
> > And in your action :
> >
> > $this->form->setAuthor($this->getUser()->getGuardUser());
> > $this->form->save();
> >
> > 2009/10/26 mbernasocchi 
> >
> >
> >
> >
> >
> > > thanks a lot,
> > > I see how to handle it now, just putting the save method as you said
> > > gives me the following warning:
> > > Strict Standards: Declaration of OpenBubbleForm::save() should be
> > > compatible with that of sfFormDoctrine::save() in /home/me/
> > > nosoapnobubbles/trunk/lib/form/doctrine/OpenBubbletForm.class.php on
> > > line 10
> >
> > > and as well I get Call to undefined method OpenBubbleForm::setAuthor
> > > (), I tried calling it as well setUserId and setuser_id and always get
> > > the same.
> >
> > > my model is:
> > > columns:
> > >     user_id:
> > >  type: integer(4)
> > >   notnull: true
> > > relations:
> > >Author:
> > >   class: sfGuardUser
> > >  local: user_id
> > >  foreign: id
> > >   foreignAlias: OpenBubbles
> > >  onDelete: cascade
> > >  onUpdate: restrict
> >
> > > $this in the OpenBubbleForm.class.php is the form not the OpenBubble
> > > (post) no?
> >
> > > thanks again Marco
> >
> > > On Oct 26, 5:04 pm, Alexandre SALOME 
> > > wrote:
> > > > You must set the user ID after saving.
> >
> > > > A possible solution would be to pass a sfGuardUser on saving of form
> :
> >
> > > > class PostForm
> > > > {
> > > >   // ...
> > > >   public function save($author, Doctrine_Connection $conn = null)
> > > >   {
> > > > $this->setAuthor($author);
> > > > $this->save($conn);
> > > >   }
> >
> > > > }
> >
> > > > Another way would be to add a method setAuthor($author) and save
> method
> > > will
> > > > check if an author was given.
> >
> > > > Alexandre
> >
> > > > 2009/10/26 mbernasocchi 
> >
> > > > > Hi, I've a Post model in my app, I need to set the author Id of the
> > > > > post to the id of the logge user (as in any forum). I succeeded by
> > > > > overwriting the save() method of the Post.class.php and making it
> like
> > > > > this:
> >
> > > > >  public function save(Doctrine_Connection $conn = null)
> > > > >  {
> > > > >if ($this->isNew())
> > > > >{
> > > > >  $this->setUserId(sfContext::getInstance()->getUser()-
> > > > > >getGuardUser());
> > > > >}
> > > > >return parent::save($conn);
> > > > >  }
> >
> > > > > but I don't like the thissolution at all because it mixes up
> > > > > application layers and sfContext is not set during doctrine tasks.
> >
> > > 

[symfony-users] Re: how to build a form for multiple uploads?

2009-10-27 Thread Alexandre SALOME
http://www.symfony-project.org/plugins/sfWidgetFormInputSWFUploadPlugin ?

2009/10/27 mel_06 <06melc...@gmail.com>

>
> or how can i turn this regular upload
> http://vit.free.fr/symfony/0.6.3/upload.html
> into a multiple upload?
>
> On Oct 27, 10:14 am, mel_06 <06melc...@gmail.com> wrote:
> > i tried searching but unfortunately there's too little documentation
> > for symfony at the moment.
> >
> > On Oct 26, 7:14 pm, Alexandre SALOME 
> > wrote:
> >
> > > You can have a look at upload plugins in the plugins repository on
> website.
> >
> > > Maybe you fill find a plugin that fill your needs.
> >
> > > Otherwise, sourcecode will help you to find an approach.
> >
> > > Alexandre
> >
> > > 2009/10/26 mel_06 <06melc...@gmail.com>
> >
> > > > i'm just new to symfony, used to code igniter before.
> >
> > > > i'm doing a multiple upload but i'm really stuck on how i will do my
> > > > form for this.
> >
> > > > i do hope for someone's help.
> >
> > > > thanks in advance
> >
> > > --
> > > Alexandre Salomé -- alexandre.sal...@gmail.com
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: how to implement sfWidgetFormInputSWFUploadPlugin tutorial?

2009-10-29 Thread Alexandre SALOME
Contact the creator of the plugin or have a look at source code, maybe a
README file, or something similar.

Last solution : read sourcecode.

2009/10/28 mel_06 <06melc...@gmail.com>

>
> i'm just really knew to symfony. is anyone knows how to use
> sfWidgetFormInputSWFUploadPlugin?
>
> thanks!
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: functional tests : issue with auto-increment and userID

2009-10-29 Thread Alexandre SALOME
Have you set environments ?

a "dev", "test" "prod" ? Have you different databases ?

In which one are you running your tests ?

And if you drop all DB except the "test", does it works ?



2009/10/27 Adrien Mogenet 

>
> Hi everyone,
>
> I'm using fixture to fill my database with 3 fake user accounts, the
> first one is my "demo" account.
> I'm writing my tests using a $browser as sfGuardTestFunctional, which
> signs me in automatically.
>
> The first time I launch my test, my $browser works perferctly and
> shows that my User ID is #1 [OK]
>
> But, second time, fixtures are put within my DB, so my "demo" account
> get the ID #4, but my $browser, which signs in again perfectly, says
> that I have the user ID #3 !!!
>
> This behaviour avoid any other INSERT operation, resulting in
> constraint issues.
>
> Thanks for helping me :-)
>
> --
> Adrien
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Fileupload with Ajax/IFrame and Preview

2009-10-31 Thread Alexandre SALOME
As I know, no clean widget exists for this.

You will have to create your one.

Alexandre

2009/10/30 ridcully 

>
> Is there is a easy way to do a Imageupload with Ajax and Image Preview
> in Symfony?
>
> Any Widget/Plugin what can do this?
>
> Thanx
> Joerg
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: sfLightboxPlugin close on form submit

2009-10-31 Thread Alexandre SALOME
Other solution would be to try reading documentation :)

2009/10/30 David Ashwood 

>
> Try: Modalbox.hide();
>
> On Fri, 2009-10-30 at 14:51 -0400, Martin Settle wrote:
> > I've got a form appearing in a lightbox, which calls a remote function
> > and updates the parent page.  However, I'd like to have the lightbox
> > close on the submission of the form.  I'm trying to use an
> >  to close the lightbox,
> > but I can't for the life of me figure out what the javascript function
> > call needs to be.
> >
> > I've tried Modalbox.end() and modalbox.end()
> > Modalbox.close() and modalbox.close()
> >
> > and the same using Lightbox.  I get a javascript error each time
> > saying there is no such function.
> >
> > Help, please!
> > Marti
> >
> > >
>
>
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Customize Doctrine_Collection display ?

2009-10-31 Thread Alexandre SALOME
Hu no

You should create a customer helper for doing such stuff :

In your lib/helper folder, create a myCollectionHelper.php file

Put in :

function myCustomCollectionDisplay($collection)
{
  $temp = array();
  foreach ($collection as $element)
  {
$temp[] = $element->__toString();
  }
  return implode(";", $temp);
}


And in your template :

useHelper('myCollection');
myCustomCollectionDisplay($collection);


Modifying Doctrine core classes is a (very) bad idea.

Alexandre

2009/10/30 Simone Fumagalli 

>
> Hello, I was just playing with a test project.
>
> The Schema is this one:
>
> BlogPost:
>  columns:
>title:  { string(45) }
>body:   { clob(65535) }
>author: { string(255) }
>
> Tag:
>  columns:
>name:   { string(255) }
>
> BlogPostTag:
>  columns:
>blog_post_id:
>  type: integer
>  primary: true
>tag_id:
>  type: integer
>  primary: true
>  relations:
>Posts:
>  class: BlogPost
>  local: blog_post_id
>Tags:
>  class: Tag
>  local: tag_id
>
> I'm just curious if is there a way to customize the way my
> Doctrine_Collection object is shown.
>
> If I type
>
> echo  $blog_post->BlogPostTag
>
> I get
>
>  Doctrine_Collection data : Array( 0 : Object(BlogPostTag) 1 :
> Object(BlogPostTag) ) 
>
> Is there a way to customize the output ? Let's say something like a
> comma separated list of my tags ?
>
> Ciao
>
> --
> Simone
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: functional tests : issue with auto-increment and userID

2009-10-31 Thread Alexandre SALOME
Isolate your database, delete any other database related to your project,

rebuild all the project,

check that no other database was created.

And finally, look at your log (log/app_env.log).

2009/10/29 Adrien Mogenet 

>
> I run tests under 'test' env which works perfectly, using a app-test
> database :-)
>
> The point I would like to figure out is really the issue with the ID
> that my sfBrowser is returning after signing in, which is different
> from the ID in Database, but not the first time, just after reloading
> fixtures automatically at least once time !
>
> Thanks for helping me,
>
> Adrien
>
> On 29 oct, 11:28, Gareth McCumskey  wrote:
> > This is the expected behaviour because symfony's load fixture methods
> dont
> > drop the tables and recreate them. If you drop the database yourself and
> > regenerate it before you run tests, or truncate each table, then you
> should
> > have things working as you want.
> >
> > On Tue, Oct 27, 2009 at 6:09 PM, Adrien Mogenet <
> adrien.moge...@gmail.com>wrote:
> >
> >
> >
> >
> >
> > > Hi everyone,
> >
> > > I'm using fixture to fill my database with 3 fake user accounts, the
> > > first one is my "demo" account.
> > > I'm writing my tests using a $browser as sfGuardTestFunctional, which
> > > signs me in automatically.
> >
> > > The first time I launch my test, my $browser works perferctly and
> > > shows that my User ID is #1 [OK]
> >
> > > But, second time, fixtures are put within my DB, so my "demo" account
> > > get the ID #4, but my $browser, which signs in again perfectly, says
> > > that I have the user ID #3 !!!
> >
> > > This behaviour avoid any other INSERT operation, resulting in
> > > constraint issues.
> >
> > > Thanks for helping me :-)
> >
> > > --
> > > Adrien
> >
> > --
> > Gareth McCumskeyhttp://garethmccumskey.blogspot.com
> > twitter: @garethmcc
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: How to set error_404_module for one module?

2009-10-31 Thread Alexandre SALOME
You have to create other templates file :

err404Success.php
err404Success.xml.php
err404Success.json.php

After that, it's a matter of sf_format, in your routes.

2009/10/29 Tomasz Ignatiuk 

>
> Hi
>
> I have set error_404_module for my app.
> I also added web services in a module called API. And I would like to
> change error_404_module for this module, in order to prepeare an error
> page as a formatted XML page. Does anyone know how to make it?
>
> Tom
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Admin language

2009-11-01 Thread Alexandre SALOME
Hi,

  In your settings.yml, activate i18n and set default_culture to "de" :

all:
  #...
  .settings:
  #...
i18n:true
default_culture: de


Clear-cache, close-navigator, and refresh page. Should be OK.

Alex'

2009/10/25 Greg Romanssen 

>
> Hello,
>
> I am having a problem that I am not able to solve for several hours.
>
> I generated admin using admin generator (symfony 1.3, doctrine) and am
> not able to persuade admin to show itself in german language (de).
>
> I was not able to find it anywhere on the web, symfony website etc...
>
> Thanks for any hint.
>
> Greg
>
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Cannot redeclare class frontendConfiguration

2009-11-01 Thread Alexandre SALOME
Give us the access and we will tell you where is the file :)

A "grep" on files can tell you such information.

If you can't access SSH to the server, you will have to download all files.

You will have to reproduce the bug in a local environment to identify it.

Alex'

2009/10/25 Marius Noetzel 

>
> Hi!
>
> I deployed a new Project today.
> The Server is already working with other Symfony-Projects.
> The Project is running on my Local-Server.
> There are two Apps in this new Project 'frontend' and 'backend'
> If I'm calling the Backend, everything works great.
> Calling the Frontend results in:
>
> Fatal error: Cannot redeclare class frontendConfiguration in ../apps/
> frontend/config/frontendConfiguration.class.php on line 3
>
> This happens when sfContext::createInstance($configuration)->dispatch
> (); is executed in the index.php.
>
> I'm using Symfony 1.2.9 there are no caching tools installed /
> enabled.
> I deleted Symfony-Cache.
>
> Help, please. I didn't see any more steps, I can search...
>
> Marius
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: sfPropelBehavior + symfony 1.3.0-ALPHA1 + sfPropelActAsTaggableBehaviorPlugin

2009-11-01 Thread Alexandre SALOME
./symfony cc ?

2009/10/30 ASS Lucas Mancini 

>
> Anybody has error with this configuration??? I can't install the
> plugin sfPropelActAsTaggableBehaviorPlugin.. this givme the error
>
> Fatal error: Class 'sfPropelBehavior' not found in C:\desarrolloweb
> \desarrollosur\plugins\sfPropelActAsTaggableBehaviorPlugin\config
> \config.php on line 11
>
> what i'm doing wrong???
> thanks in advance folks
>
> Lucas.
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Test functional : Problem with delete method

2009-11-01 Thread Alexandre SALOME
This is non-obstrusive javacript. So you can "click" on it, Javascript won't
be executed.

To test the javascript, use a javascript test framework

2009/10/27 Necho 

>
> Hi !
>
> I have a problem with the method delete! I developped the create,
> edit, list method with success but for the delete method, when i click
> on the button "delete" i have a confirmation text (in javascript). To
> delete, i must click on the button OK but the javascript can't be
> tested! no? Do you have a solution?
>
> Thanks
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: save() is causing seg fault

2009-11-01 Thread Alexandre SALOME
Have you debug/cache extensions for PHP ?

Disable them and retry.

If it doesn't work, update PHP version.

2009/10/29 Murali Krishna B 

>  Hi all,
>
> I am sending a form to processform action in symfony actions.
>
> protected function processStudentsForm(sfWebRequest $request, sfForm $form)
>   {
> $form->bind($request->getParameter($form->getName()));
> if ($form->isValid())
> {
>   $students = $form->save();
>   return true;
> }
>return false;
>   }
>
> The form is valid, but save() is throwing a segmentation fault. In apache
> error log, error message is
>
> child pid ** exit signal Segmentation fault (11).
>
> Please help me in this.
>
> Thanks in advance,
>
> Murali Krishna
>
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Embedded forms problem since Symfony 1.2.8

2009-11-01 Thread Alexandre SALOME
We cannot figure your problem, what variables are, etc.

Giving theses values ($value and $rel) has no sense for us, since we don't
have their declaration.

Alex'

2009/10/28 Guu_sama 

>
> Hi,
>
> I use many embedded Doctrine forms in my project. Everything goes fine
> until I upgrade my symfony version from 1.2.7 to 1.2.8. Now, everytime
> I save a form with an embedded one, I've got that fatal error :
>
> "Fatal error: Call to a member function getTable() on a non-object in /
> home/dev/workspace/symfony/lib/plugins/sfDoctrinePlugin/ lib/vendor/
> doctrine/Doctrine/Record.php on line 1231"
>
> At this line we have : $relatedTable = $value->getTable();
>
> If I modify this line to $relatedTable = $rel->getTable(); everything
> goes fine again. Indeed, in some cases $value is not an instance of
> Doctrine_Record but a simple Array.
>
> After some research on symfony's trac & forums and on Doctrine's Jira,
> the problem seems to be that I use same names for my embedded forms
> and my relationships.
>
> I searched carefully symfony and doctrine changelogs, but I do not
> understand that new behavior... where is the problem ? Symfony ?
> Doctrine ? My apps :-) ?
>
> These topics are related to my question (I posted there without any
> anwser) :
>
>  - http://forum.symfony-project.org/index.php/t/21184/
>  - http://www.doctrine-project.org/jira/browse/DC-103
>
> Thanks in advance to those who have time to think about my problem
> (even without an answer ;-))
>
> Best regards,
>
> Olivier
>
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: PHP symfony reports

2009-11-03 Thread Alexandre SALOME
You have an event "application log".

Connect to it to do your stuff,

Alex'

2009/11/3 asi007 

>
> Hi every body i want to make reports like cross tab reports in symfony
> has any one idea about it
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Discover i18n fields in form

2009-11-03 Thread Alexandre SALOME
There is a method getEmbeddedForms on the sfForm object.

Using array_diff between keys for widget schema and keys of embed forms, you
will find "classic" widgets.

2009/11/2 HAUSa 

>
> I embedded two UserI18nForms in my UserForm.
> $this->embedI18n(array('de', 'en'));
>
> This is my action:
> $this->form = new UserForm();
>
> Now I want to display the forms seperately in my template. So echo
> $form is no option for me.
> Is it possible to retrieve an array of all embedded forms from the
> UserForm?
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Join i18n table

2009-11-04 Thread Alexandre SALOME
Yes, you have to use event listeners, from Doctrine.

Create your custom behavior, extends I18N behavior, and add an option
"autojoin_on_select".

Double check that only your requested culture is joined, if all cultures are
joined, it's a disaster.

Could you give us the solution when you will find it ? I'm interested ;)

Alex'

2009/11/4 HAUSa 

>
> When I make a relation between two tables, it is possible to use a
> automatic join select.
>
> Example:
>
> message:
> * id
> * user_id
>
> message_i18n:
> * id
> * culture
> * subject
> * message
>
> user:
> * id
> * name
>
> Now I can use MessagePeer::doSelectJoinUser()
>
> Is it also possible to use MessagePeer::doSelectJoinI18n() or
> something? That would help me reduce the number of queries!
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Extending sfDoctrineGuard in 1.3

2009-11-04 Thread Alexandre SALOME
Yes, It works...

try to make it work without the "Profile" extension. DoctrineGuard as basic
as possible.


2009/11/4 juro 

>
> Hi,
>
> I am trying to get this
>
>
> http://www.symfony-project.org/blog/2008/11/12/call-the-expert-customizing-sfdoctrineguardplugin
>
> to work on Symfony 1.3
>
> Everything works aas expected until I try to access
>
> http://yourhost/backend_dev.php/sf_guard_user
>
> I have figured out that the url should be
>
> http://yourhost/backend_dev.php/sfGuardUser
>
> but now I get this error: The route "sf_guard_user_collection" does
> not exist.
>
> Has anyone hay success?
>
> juro
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Join i18n table

2009-11-04 Thread Alexandre SALOME
With Propel, it's behaviors, it works tooo

2009/11/4 HAUSa 

>
> Hmm... I'm using Propel...does that work with event listeners too?
>
> On 4 nov, 11:36, Alexandre SALOME  wrote:
> > Yes, you have to use event listeners, from Doctrine.
> >
> > Create your custom behavior, extends I18N behavior, and add an option
> > "autojoin_on_select".
> >
> > Double check that only your requested culture is joined, if all cultures
> are
> > joined, it's a disaster.
> >
> > Could you give us the solution when you will find it ? I'm interested ;)
> >
> > Alex'
> >
> > 2009/11/4 HAUSa 
> >
> >
> >
> >
> >
> > > When I make a relation between two tables, it is possible to use a
> > > automatic join select.
> >
> > > Example:
> >
> > > message:
> > > * id
> > > * user_id
> >
> > > message_i18n:
> > > * id
> > > * culture
> > > * subject
> > > * message
> >
> > > user:
> > > * id
> > > * name
> >
> > > Now I can use MessagePeer::doSelectJoinUser()
> >
> > > Is it also possible to use MessagePeer::doSelectJoinI18n() or
> > > something? That would help me reduce the number of queries!
> >
> > --
> > Alexandre Salomé -- alexandre.sal...@gmail.com
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Extending sfDoctrineGuard in 1.3

2009-11-04 Thread Alexandre SALOME
Try to make it works without Profile, and in a second time, add the profile.

Could you give us the stack trace generated by Symfony, with portions of
code ?


2009/11/4 juro 

>
> Yes:
>
> all:
>  .settings:
>enabled_modules:[default, sfGuardUser, sfGuardGroup,
> sfGuardPermission]
>
>
> On Nov 4, 12:45 pm, Simone Fumagalli 
> wrote:
> > > I have figured out that the url should be
> > >http://yourhost/backend_dev.php/sfGuardUser
> > > but now I get this error: The route "sf_guard_user_collection" does not
> exist.
> >
> > In settings.yml did you enable the sfGuardUser module for your
> > environment ?
> >
> > all:
> >   .settings:
> >   enabled_modules:[default, sfGuardUser, sfGuardGroup,
> > sfGuardPermission]
> >
> > Ciao
> >
> > --
> > Simone
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: multiselect values

2009-11-04 Thread Alexandre SALOME
Have a look at sfDoctrineRecord class, in
symfony/lib/plugins/sfDoctrinePlugin/lib/record

Every record class inherits from it.

There is a method __toString() on it and the magic is there :

public function __toString()
  {
$guesses = array('name',
 'title',
 'description',
 'subject',
 'keywords',
 'id');

// we try to guess a column which would give a good description of the
object
foreach ($guesses as $descriptionColumn)
{
  ...
}
  }

2009/11/4 lorenx 

>
> i understood that, since both group and credential model has a "name"
> attribute, getName() is called by default.
> i had to add a __toString() method in the user model that returns its
> getName() and now it works.
>
> but i didn't find where this magic is...
> thanks anyway.
>
> On Nov 3, 9:18 pm, lorenx  wrote:
> > hi all,
> > i have a group and user many-to-many relation, joined on a groupuser
> > table/model.
> > i also have a group and credential many-to-many relation, joined on an
> > analogous groupcredential table/model.
> >
> > with "symfony doctrine:generate-module" i generated all forms and when
> > i browse the group form i see two multiselect;
> > the credential multiselect values are (accidentally) based on the
> > "name" column (not a primary key) but the user multiselect displays
> > the user ids.
> >
> > how could this happend?
> > and... how to change this behavior?
> >
> > i find just a few pages on this,
> > thanks.
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Symfony >=1.2 on debian etch

2009-11-04 Thread Alexandre SALOME
You should update your Debian, or another solution is to compile your PHP
version.

2009/11/4 cosmy 

>
> Hi all,
>  i have a production server based on Debian Etch and so with php
> 5.2.0... but Symfony 1.2 needs at least php 5.24!
> Anyone of you have managed to run newer version of Symfony on this
> Debian version?
> I have developed a project with Symfony 1.2 and I need to make it
> run...
>
> Thank you in advance.
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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: Symfony >=1.2 on debian etch

2009-11-04 Thread Alexandre SALOME
There is no fix for symfony to be compatible with older PHP versions, it
would be very unpredictible to do it manually.

You could install PHP apart from your default PHP installation, and
configure it as CGI for Apache, and use it for your symfony installation.


2009/11/4 cosmy 

>
> On this server there are a lot of other sites and i'm not the only one
> who use it.
> I could compile php but i need to change less things possible on
> production, and there is a risk that something could not work
> However, I'll try to compile on the development serve;, if you know a
> way to modify some class of symfony to make it works with the actual
> configuration, please tell.
> at the moment some modules work.. other have got problems with pdo.
>
> 500 | Internal Server Error | Doctrine_Connection_Mysql_Exception
> SQLSTATE[HY000]: General error: 2014 Cannot execute queries while
> other unbuffered queries are active. Consider using
> PDOStatement::fetchAll(). Alternatively, if your code is only ever
> going to run against mysql, you may enable query buffering by setting
> the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.
>
> I could add this attribute to the db connection, but i don't the class
> where it is done
>
> On 4 Nov, 13:43, Alexandre SALOME  wrote:
> > You should update your Debian, or another solution is to compile your PHP
> > version.
> >
> > 2009/11/4 cosmy 
> >
> >
> >
> > > Hi all,
> > >  i have a production server based on Debian Etch and so with php
> > > 5.2.0... but Symfony 1.2 needs at least php 5.24!
> > > Anyone of you have managed to run newer version of Symfony on this
> > > Debian version?
> > > I have developed a project with Symfony 1.2 and I need to make it
> > > run...
> >
> > > Thank you in advance.
> >
> > --
> > Alexandre Salomé -- alexandre.sal...@gmail.com
> >
>


-- 
Alexandre Salomé -- alexandre.sal...@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
-~--~~~~--~~--~--~---



  1   2   >