[symfony-users] Re: How do you sync your production db ?

2008-05-21 Thread Daevid Vincent

> -Original Message-
> symfony has nice features to deploy your applications and to create
> the database from the schema files etc.
> 
> However, once you got data on your production machine its not that
> easy to keep the database layout in sync, so how do you do it ?
> 
> Since my symfony project is not production ready i am thinking about
> this, and these are the possibilities that came to my mind:
> 
> 1. Edit the database on the prod. machine manually and alter the
> tables to match local tables (very bad)
> 2. Dump the data on the prod. machine, sync the project and 
> run propel-
> build-all, and then reimport the dump again (quite ok, but still some
> work)

Well, in our case each developer has a VMWare (or other sandbox). Then we have 
a testing server. And finally production.

We do all the normal propel stuff, AND in data/sql/ we created an 'update.sql' 
file where any database modifications are added to as ALTER statements. These 
are dated with comments. Then we manually run the proper SQL statements as 
needed (backup prior, yadda yadda). The database doesn't really change all that 
much once you get it built and your site is live. It's mostly a new column here 
or there. For really big changes (for example, today I added a zipcode lookup 
for city/state and 'friends near you' feature) I just created a zipcode.sql 
file. It's a one-off and was like 100k so no sence in cluttering the update.sql 
file.

We use SQLYog. So when you make a change to the table via the GUI, it will show 
you the ALTER statement used. Simply copy/paste it to update.sql. It also has a 
great feature to syncronize two databases. We don't use it much, but it comes 
in handy if they deviate too far for some reason -- like when you are initially 
setting this process up and say you had sloppy/lazy coders.

Daevid.
http://daevid.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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: How do you sync your production db ?

2008-05-21 Thread Andrew Backer
This assumes, of course, that you are not afraid of RENAME COLUMN, ALTER
TABLE, and so on.  If you are, then good luck =)

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: How do you sync your production db ?

2008-05-21 Thread Andrew Backer
This is how I do it:


   - Prepare a script to quickly restore a backup of the database.  If you
   mess up the following steps you just restore and re-run them.  This is just
   a simple pg_restore --blah


   1. Decide the changes to make & create a folder to hold your SQL
   2. Create a SQL script to make them (using PgAdmin, etc)
   3. Run it on the DB, test, fix more, repeate
   1. On failures, restore the copy of the prod database via the restore
  script you created
   4.  Modify the schmea.xml and re-generate & test

   5. Deploy to production by:
  1. Back up production db
  2. Shut down site
  3. Apply same script used in dev
  4. Upload the schema changes
  5. Re-generate the model

You know it works because you developed your script to make your changes
locally the same way you would have to apply it on production.  So each time
you do a bit of db changin' in DEV and apply it (and it works), you can just
re-run the same command on the server.

This only works if it is fairly stable, but it's a good way to go about it.
All you are doing is creating patches for your database, essentially, and
then those patches get into source control along with the schema.xml changes
and so on, so it all goes together.

//Andrew

2008/5/21 kayoone <[EMAIL PROTECTED]>:

>
> thx, didnt know about that plugin. will give it a try!
>
>
> On 20 Mai, 22:18, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> > If you have no choice, the 2nd solution is the best, and the one I use
> > when I can't use the other one, which is the plugin
> > "sfPropelSQLDiffPlugin".
> > This plugin provides some tasks so you can have the "diff" between
> > your tables and your schema, so you just alter tables and not alter
> > data.
> > But what doesn't (or not often) work and must be handled by hand is :
> > - renaming fields
> > - editing constraints with innodb tables (or any engine supporting
> > constraints)
> >
> > In highly active development, I think this could be very tiring as
> > renaming fields or changes like this are very common.
> > But in a more stable cycle, this can be used quite easily.
> >
> > !! ALWAYS SAVE PRODUCTION DATABASE & FILES BEFORE ANY CHANGE !!
> >
> > This may be obvious, but it must be said everytime we talk about such
> > a subjet ^^
> >
> > On 20 mai, 18:42, kayoone <[EMAIL PROTECTED]> wrote:
> >
> > > symfony has nice features to deploy your applications and to create
> > > the database from the schema files etc.
> >
> > > However, once you got data on your production machine its not that
> > > easy to keep the database layout in sync, so how do you do it ?
> >
> > > Since my symfony project is not production ready i am thinking about
> > > this, and these are the possibilities that came to my mind:
> >
> > > 1. Edit the database on the prod. machine manually and alter the
> > > tables to match local tables (very bad)
> > > 2. Dump the data on the prod. machine, sync the project and run propel-
> > > build-all, and then reimport the dump again (quite ok, but still some
> > > work)
> >
> > > Any other ways ?
> > > Some Pake task like symfony sync-database or something like that would
> > > be really good, which just alters the tables/creates new ones instead
> > > of recreating everything from scratch.
> >
> > > thx for your thoughts.
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: IDE for symfony?

2008-05-21 Thread Alex Fernandez
Personally I use Activestate's Komodo IDE. I tried Zend's newest but I hate the 
way they implemented debugging. It also does not support Xdebug. Eclipse is the 
same way except it does support Xdebug. But I still don't like the fact you 
have to start your debugging from the IDE. With the Firefox Xdebug extension 
and Komodo, I can start and stop xdebug from Firefox on any page in the user 
click path.

Alex


- Original Message 
From: Daevid Vincent <[EMAIL PROTECTED]>
To: symfony-users@googlegroups.com
Sent: Wednesday, May 21, 2008 9:32:49 PM
Subject: [symfony-users] IDE for symfony?


Not to start a holy war, but is there an IDE out there that will work well
with symfony. By that I mean parse the files and show me what my methods are
available, variables, built in symfony helpers, etc. Not just color coding
and that basic crap that any PHP editor will do.

I'm old school and use HomeSite on XP. But symfony is just too damn
complicated for my brain it seems. All these eight billion classes, four
classes per table, and directories up to six levels deep and yaml files up
the wazoo...

What about Zend IDE? Komodo? I prefer a M$ windows IDE, but honestly, at
this point, I will consider anything.





  
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: propel-load-data

2008-05-21 Thread Nicolas Perriault

2008/5/22 Tom Haskins-Vaughan <[EMAIL PROTECTED]>:

> When I do this, I don;t get any warnings like before, but I get a
> sfException:
>
>   [sfException]
>   Call to undefined method sfUser::getUserId

That's normal, as you have no session then no currently connected user
id (the thing sfUser::getUserId provides). So you'll still have to
check if you have a user session id before calling your save method.
It's a bit dirty but you can do:

public function save($con = null)
{
  if (!method_exists(sfContext::getInstance()->getUser(), 'getUserID'))
  {
return parent::save($con);
  }
  // ...
}

You can also check the env name:

public function save($con = null)
{
  if ('cli' === sfConfig::get('sf_environment'))
  {
return parent::save($con);
  }
  // ...
}

If you're using sfGuard, you can check the type of the user class:

public function save($con = null)
{
  if (!sfContext::getInstance()->getUser() instanceof sfGuardSecurityUser)
  {
return parent::save($con);
  }
  // ...
}

I dont really like these approachs but they may solve your problem...

++

-- 
Nicolas Perriault
http://prendreuncafe.com - http://symfonians.net - http://sensiolabs.com
Phone: +33 660 92 08 76

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: IDE for symfony?

2008-05-21 Thread PPSMike

Almost all of them offer a free trial - each has its own strengths and
weaknesses.Give them a shot!

On May 21, 9:32 pm, "Daevid Vincent" <[EMAIL PROTECTED]> wrote:
> Not to start a holy war, but is there an IDE out there that will work well
> with symfony. By that I mean parse the files and show me what my methods are
> available, variables, built in symfony helpers, etc. Not just color coding
> and that basic crap that any PHP editor will do.
>
> I'm old school and use HomeSite on XP. But symfony is just too damn
> complicated for my brain it seems. All these eight billion classes, four
> classes per table, and directories up to six levels deep and yaml files up
> the wazoo...
>
> What about Zend IDE? Komodo? I prefer a M$ windows IDE, but honestly, at
> this point, I will consider anything.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: IDE for symfony?

2008-05-21 Thread Sid Bachtiar

Eclipse PDT or Zend IDE

On Thu, May 22, 2008 at 1:32 PM, Daevid Vincent <[EMAIL PROTECTED]> wrote:
>
> Not to start a holy war, but is there an IDE out there that will work well
> with symfony. By that I mean parse the files and show me what my methods are
> available, variables, built in symfony helpers, etc. Not just color coding
> and that basic crap that any PHP editor will do.
>
> I'm old school and use HomeSite on XP. But symfony is just too damn
> complicated for my brain it seems. All these eight billion classes, four
> classes per table, and directories up to six levels deep and yaml files up
> the wazoo...
>
> What about Zend IDE? Komodo? I prefer a M$ windows IDE, but honestly, at
> this point, I will consider anything.
>
>
>
> >
>



-- 
Visit my website: http://onlinesid.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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] IDE for symfony?

2008-05-21 Thread Daevid Vincent

Not to start a holy war, but is there an IDE out there that will work well
with symfony. By that I mean parse the files and show me what my methods are
available, variables, built in symfony helpers, etc. Not just color coding
and that basic crap that any PHP editor will do.

I'm old school and use HomeSite on XP. But symfony is just too damn
complicated for my brain it seems. All these eight billion classes, four
classes per table, and directories up to six levels deep and yaml files up
the wazoo...

What about Zend IDE? Komodo? I prefer a M$ windows IDE, but honestly, at
this point, I will consider anything.



--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: How can I tell if a $user is "my" user?

2008-05-21 Thread James

$sf_user is a user, so

if($sf_user->getId() == $user->getId)
{
print "same user";
}
else
{
print "not the same user";
}

And yes, while I love Symfony, the amount of crap you get in var_dump  
on symfony objects are ridiculous.

James


On May 21, 2008, at 8:35 PM, Daevid Vincent wrote:

>
> In my user/templates/viewSuccess.php I have a block of HTML that I  
> don't
> want to show if I'm looking at my own profile (Add friend / Email  
> user).
>
> How can I tell if the user I'm looking at is the one I'm logged in as?
>
> In normal PHP, I'd have saved my user's database ID in a $_SESSION  
> upon
> login and compare to the ID of the record I just pulled up. Simple.
>
> I made the mistake of doing this (so I could look for some  
> similarities in
> variables/methods):
>
> var_dump($sf_user);
> var_dump($user);
>
> And was horrified to see that $sf_user consumed literally 60,136  
> LINES! Are
> you f'n kidding me!?!!
>
>
>
>
> >


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] How can I tell if a $user is "my" user?

2008-05-21 Thread Daevid Vincent

In my user/templates/viewSuccess.php I have a block of HTML that I don't
want to show if I'm looking at my own profile (Add friend / Email user).

How can I tell if the user I'm looking at is the one I'm logged in as?

In normal PHP, I'd have saved my user's database ID in a $_SESSION upon
login and compare to the ID of the record I just pulled up. Simple.

I made the mistake of doing this (so I could look for some similarities in
variables/methods):

var_dump($sf_user);
var_dump($user);

And was horrified to see that $sf_user consumed literally 60,136 LINES! Are
you f'n kidding me!?!!




--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: propel-load-data

2008-05-21 Thread Tom Haskins-Vaughan

OK, I'm getting closer. I think I may have an older version of symfony 
(1.0.12) so the following seems to work:

  symfony propel-load-data frontend cli data/fixtures/import_data.yml

When I do this, I don;t get any warnings like before, but I get a 
sfException:

   [sfException]
   Call to undefined method sfUser::getUserId

And the data is not loaded. Here is my factories.yml file:

cli:
   controller:
 class: sfConsoleController
   request:
 class: sfConsoleRequest
   response:
 class: sfConsoleResponse
   storage:
 class: sfSessionTestStorage

Tom Haskins-Vaughan wrote:
> Thanks, Thomas. I've tried both of the following:
> 
> symfony propel-load-data --env=cli frontend
> 
> symfony propel-load-data --env='cli' frontend
> 
> And when I call die(SF_ENVIRONMENT); in my save() method it still 
> returns 'dev'.
> 
> Any suggestions?
> 
> Thomas Rabaix wrote:
>> When you call sfContect::getInstance() all the factories are loaded.
>> So the session storage too.
>>
>> Your session storage uses the sfSessionStorage with the auto_start =
>> true. That's why you get the error : "Warning: session_start(): Cannot
>> send session cookie"
>>
>> When you run the propel-load-data, try to to a var_dump(SF_ENV) to
>> look what env is set, and then change the factorie settings for this
>> env.
>>
>> I just check into the sfPakePropel and the default env is 'dev'. You
>> can add a second parameter with the env name to the propel-load-data
>> command.
>>
>> Thomas
>>
>> On Thu, May 22, 2008 at 12:02 AM, Tom Haskins-Vaughan
>> <[EMAIL PROTECTED]> wrote:
>>> Thanks, Nicholas. I think the problem is, whenever I try to access
>>> sfContext::getInstance() even to see if it exists, it tries to start a
>>> session. Maybe I'm wrong though. Here's the error:
>>>
>>>  >> propelload data from
>>> "/home/projects/...inah-2.0/symfony/data/fixtures"
>>> PHP Warning:  session_start(): Cannot send session cookie - headers
>>> already sent by (output started at
>>> /usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in
>>> /usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77
>>>
>>> Warning: session_start(): Cannot send session cookie - headers already
>>> sent by (output started at
>>> /usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in
>>> /usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77
>>> PHP Warning:  session_start(): Cannot send session cache limiter -
>>> headers already sent (output started at
>>> /usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in
>>> /usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77
>>>
>>> Warning: session_start(): Cannot send session cache limiter - headers
>>> already sent (output started at
>>> /usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in
>>> /usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77
>>>
>>>
>>>   [sfException]
>>>   Call to undefined method sfUser::getUserId
>>>
>>>
>>>
>>> Nicolas Perriault wrote:
 2008/5/21 Tom Haskins-Vaughan <[EMAIL PROTECTED]>:

> Thanks Nicholas, but you've gone a little over my head. Can you let me
> know how to do that?
 In your save action, at the beginning:

if (!sfContext::getInstance()->getStorage() instanceof sfSessionStorage)
{
  return parent::save();
}

 Or something like this (not tested)

 ++

>>> --
>>> Tom Haskins-Vaughan
>>> Temple Street Media: Design and Development for the Web
>>> [EMAIL PROTECTED] | www.templestreetmedia.com
>>>
>>
>>
> 

-- 
Tom Haskins-Vaughan
Temple Street Media: Design and Development for the Web
[EMAIL PROTECTED] | www.templestreetmedia.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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: propel-load-data

2008-05-21 Thread Tom Haskins-Vaughan

Thanks, Thomas. I've tried both of the following:

symfony propel-load-data --env=cli frontend

symfony propel-load-data --env='cli' frontend

And when I call die(SF_ENVIRONMENT); in my save() method it still 
returns 'dev'.

Any suggestions?

Thomas Rabaix wrote:
> When you call sfContect::getInstance() all the factories are loaded.
> So the session storage too.
> 
> Your session storage uses the sfSessionStorage with the auto_start =
> true. That's why you get the error : "Warning: session_start(): Cannot
> send session cookie"
> 
> When you run the propel-load-data, try to to a var_dump(SF_ENV) to
> look what env is set, and then change the factorie settings for this
> env.
> 
> I just check into the sfPakePropel and the default env is 'dev'. You
> can add a second parameter with the env name to the propel-load-data
> command.
> 
> Thomas
> 
> On Thu, May 22, 2008 at 12:02 AM, Tom Haskins-Vaughan
> <[EMAIL PROTECTED]> wrote:
>> Thanks, Nicholas. I think the problem is, whenever I try to access
>> sfContext::getInstance() even to see if it exists, it tries to start a
>> session. Maybe I'm wrong though. Here's the error:
>>
>>  >> propelload data from
>> "/home/projects/...inah-2.0/symfony/data/fixtures"
>> PHP Warning:  session_start(): Cannot send session cookie - headers
>> already sent by (output started at
>> /usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in
>> /usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77
>>
>> Warning: session_start(): Cannot send session cookie - headers already
>> sent by (output started at
>> /usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in
>> /usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77
>> PHP Warning:  session_start(): Cannot send session cache limiter -
>> headers already sent (output started at
>> /usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in
>> /usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77
>>
>> Warning: session_start(): Cannot send session cache limiter - headers
>> already sent (output started at
>> /usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in
>> /usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77
>>
>>
>>   [sfException]
>>   Call to undefined method sfUser::getUserId
>>
>>
>>
>> Nicolas Perriault wrote:
>>> 2008/5/21 Tom Haskins-Vaughan <[EMAIL PROTECTED]>:
>>>
 Thanks Nicholas, but you've gone a little over my head. Can you let me
 know how to do that?
>>> In your save action, at the beginning:
>>>
>>>if (!sfContext::getInstance()->getStorage() instanceof sfSessionStorage)
>>>{
>>>  return parent::save();
>>>}
>>>
>>> Or something like this (not tested)
>>>
>>> ++
>>>
>> --
>> Tom Haskins-Vaughan
>> Temple Street Media: Design and Development for the Web
>> [EMAIL PROTECTED] | www.templestreetmedia.com
>>
> 
> 
> 

-- 
Tom Haskins-Vaughan
Temple Street Media: Design and Development for the Web
[EMAIL PROTECTED] | www.templestreetmedia.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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: propel-load-data

2008-05-21 Thread Thomas Rabaix

When you call sfContect::getInstance() all the factories are loaded.
So the session storage too.

Your session storage uses the sfSessionStorage with the auto_start =
true. That's why you get the error : "Warning: session_start(): Cannot
send session cookie"

When you run the propel-load-data, try to to a var_dump(SF_ENV) to
look what env is set, and then change the factorie settings for this
env.

I just check into the sfPakePropel and the default env is 'dev'. You
can add a second parameter with the env name to the propel-load-data
command.

Thomas

On Thu, May 22, 2008 at 12:02 AM, Tom Haskins-Vaughan
<[EMAIL PROTECTED]> wrote:
>
> Thanks, Nicholas. I think the problem is, whenever I try to access
> sfContext::getInstance() even to see if it exists, it tries to start a
> session. Maybe I'm wrong though. Here's the error:
>
>  >> propelload data from
> "/home/projects/...inah-2.0/symfony/data/fixtures"
> PHP Warning:  session_start(): Cannot send session cookie - headers
> already sent by (output started at
> /usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in
> /usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77
>
> Warning: session_start(): Cannot send session cookie - headers already
> sent by (output started at
> /usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in
> /usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77
> PHP Warning:  session_start(): Cannot send session cache limiter -
> headers already sent (output started at
> /usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in
> /usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77
>
> Warning: session_start(): Cannot send session cache limiter - headers
> already sent (output started at
> /usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in
> /usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77
>
>
>   [sfException]
>   Call to undefined method sfUser::getUserId
>
>
>
> Nicolas Perriault wrote:
>> 2008/5/21 Tom Haskins-Vaughan <[EMAIL PROTECTED]>:
>>
>>> Thanks Nicholas, but you've gone a little over my head. Can you let me
>>> know how to do that?
>>
>> In your save action, at the beginning:
>>
>>if (!sfContext::getInstance()->getStorage() instanceof sfSessionStorage)
>>{
>>  return parent::save();
>>}
>>
>> Or something like this (not tested)
>>
>> ++
>>
>
> --
> Tom Haskins-Vaughan
> Temple Street Media: Design and Development for the Web
> [EMAIL PROTECTED] | www.templestreetmedia.com
>
> >
>



-- 
Thomas Rabaix

Internet Consultant

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: propel-load-data

2008-05-21 Thread Tom Haskins-Vaughan

Thanks, Nicholas. I think the problem is, whenever I try to access 
sfContext::getInstance() even to see if it exists, it tries to start a 
session. Maybe I'm wrong though. Here's the error:

 >> propelload data from 
"/home/projects/...inah-2.0/symfony/data/fixtures"
PHP Warning:  session_start(): Cannot send session cookie - headers 
already sent by (output started at 
/usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in 
/usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77

Warning: session_start(): Cannot send session cookie - headers already 
sent by (output started at 
/usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in 
/usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77
PHP Warning:  session_start(): Cannot send session cache limiter - 
headers already sent (output started at 
/usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in 
/usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77

Warning: session_start(): Cannot send session cache limiter - headers 
already sent (output started at 
/usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in 
/usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77


   [sfException]
   Call to undefined method sfUser::getUserId



Nicolas Perriault wrote:
> 2008/5/21 Tom Haskins-Vaughan <[EMAIL PROTECTED]>:
> 
>> Thanks Nicholas, but you've gone a little over my head. Can you let me
>> know how to do that?
> 
> In your save action, at the beginning:
> 
>if (!sfContext::getInstance()->getStorage() instanceof sfSessionStorage)
>{
>  return parent::save();
>}
> 
> Or something like this (not tested)
> 
> ++
> 

-- 
Tom Haskins-Vaughan
Temple Street Media: Design and Development for the Web
[EMAIL PROTECTED] | www.templestreetmedia.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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: propel-load-data

2008-05-21 Thread Nicolas Perriault

2008/5/21 Tom Haskins-Vaughan <[EMAIL PROTECTED]>:

> Thanks Nicholas, but you've gone a little over my head. Can you let me
> know how to do that?

In your save action, at the beginning:

   if (!sfContext::getInstance()->getStorage() instanceof sfSessionStorage)
   {
 return parent::save();
   }

Or something like this (not tested)

++

-- 
Nicolas Perriault
http://prendreuncafe.com - http://symfonians.net - http://sensiolabs.com
Phone: +33 660 92 08 76

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: propel-load-data

2008-05-21 Thread Tom Haskins-Vaughan

Thanks Nicholas, but you've gone a little over my head. Can you let me 
know how to do that?

Nicolas Perriault wrote:
> 2008/5/21 [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
> 
>> I'm not sure but I think a user always exists, but it's not the same
>> instance depending on the context (web or cli).
> 
> True, you should check via instanceof the type of session storage
> class, eg if you detect something like sfNoStorage, dont challenge the
> session data. You can get the storage object with
> sfContext::getStorage().
> 
> HTH
> 
> ++
> 

-- 
Tom Haskins-Vaughan
Temple Street Media: Design and Development for the Web
[EMAIL PROTECTED] | www.templestreetmedia.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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: propel-load-data

2008-05-21 Thread Nicolas Perriault

2008/5/21 [EMAIL PROTECTED] <[EMAIL PROTECTED]>:

> I'm not sure but I think a user always exists, but it's not the same
> instance depending on the context (web or cli).

True, you should check via instanceof the type of session storage
class, eg if you detect something like sfNoStorage, dont challenge the
session data. You can get the storage object with
sfContext::getStorage().

HTH

++

-- 
Nicolas Perriault
http://prendreuncafe.com - http://symfonians.net - http://sensiolabs.com
Phone: +33 660 92 08 76

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: propel-load-data

2008-05-21 Thread Tom Haskins-Vaughan

Thanks for your help, let me know if this means anything to you:

 >> propelload data from 
"/home/projects/...inah-2.0/symfony/data/fixtures"
PHP Warning:  session_start(): Cannot send session cookie - headers 
already sent by (output started at 
/usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in 
/usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77

Warning: session_start(): Cannot send session cookie - headers already 
sent by (output started at 
/usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in 
/usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77
PHP Warning:  session_start(): Cannot send session cache limiter - 
headers already sent (output started at 
/usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in 
/usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77

Warning: session_start(): Cannot send session cache limiter - headers 
already sent (output started at 
/usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in 
/usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77
Array
(
 [0] => myUser
 [1] => sfBasicSecurityUser
 [2] => sfUser
)


   [sfException]
   Call to undefined method sfUser::getUserId




[EMAIL PROTECTED] wrote:
> Please try to add this at the beginning of your save() method and tell
> us what's displayed when used with CLI (in propel-load-data for
> example) :
> 
> $class = get_class(sfContext::getInstance()->getUser();
> for ($classes[] = $class; $class = get_parent_class($class);
> $classes[] = $class);
> print_r($classes);
> 
> I'm not sure but I think a user always exists, but it's not the same
> instance depending on the context (web or cli).
> 
> 
> 
> On 21 mai, 20:53, Tom Haskins-Vaughan <[EMAIL PROTECTED]>
> wrote:
>> Yeah, I noticed that. I tried clear-cache but it didn't make any difference.
>>
>>
>>
>>
>>
>> Thomas Rabaix wrote:
>>> Hello,
>>> It look like the factorie settings are ignored. The error refers to
>>> 'sfSessionStorage', however the session handler should by
>>> 'sfSessionTestStorafe'
>>> Thomas
>>> On Wed, May 21, 2008 at 6:47 PM, Tom Haskins-Vaughan
>>> <[EMAIL PROTECTED]> wrote:
 Thanks, Thomas. I tried that but I got the same error:
  >> propelload data from
 "/home/projects/...inah-2.0/symfony/data/fixtures"
 PHP Warning:  session_start(): Cannot send session cookie - headers
 already sent by (output started at
 /usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in
 /usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77
 Warning: session_start(): Cannot send session cookie - headers already
 sent by (output started at
 /usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in
 /usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77
 PHP Warning:  session_start(): Cannot send session cache limiter -
 headers already sent (output started at
 /usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in
 /usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77
 Warning: session_start(): Cannot send session cache limiter - headers
 already sent (output started at
 /usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in
 /usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77
   [sfException]
   Call to undefined method sfUser::getUserId
 Thomas Rabaix wrote:
> Hello,
> I am not sure at 100% about what I am going to say :
>  - sfSessionStorage start the session when you access to the user
>  - The command line uses the 'cli' env configuration
>  - You have to change the cli factories to use the
> sfSessionTestStorage, which do not used php session.
> The use of session_id() is not the best way to do it as sessions can
> be handled by others "systems"
> Thomas
> On Tue, May 20, 2008 at 11:33 PM, Tom Haskins-Vaughan
> <[EMAIL PROTECTED]> wrote:
>> If I change the first if statement to the following it works fine:
>> if (!session_id())
>> {
>>   return parent::save();
>> }
>> Am I going to cause any problems with symfony doing it like this?
>> Nicolas Perriault wrote:
>>> 2008/5/20 Tom Haskins-Vaughan <[EMAIL PROTECTED]>:
 Everything works fine, except when I run the propel-load-data task,
 because of course there is no session.
>>> I may be missing the point but here's what I'd do:
>>>   public function save($con = null)
>>>   {
>>> if (!$user = sfContext::getInstance()->getUser())
>>> {
>>>   return parent::save();
>>> }
>>> if ($this->isNew())
>>> {
>>>   $this->setCreatedBy($user->getUserId());
>>> }
>>> if ($this->isModified())
>>> {
>>>   $this->setUpdatedBy($user->getUserId());
>>> }
>>> parent::save();
>>>   }
>>> ++
>> --
>> Tom Haskins-Vaughan
>> Temple 

[symfony-users] Re: propel-load-data

2008-05-21 Thread [EMAIL PROTECTED]

Please try to add this at the beginning of your save() method and tell
us what's displayed when used with CLI (in propel-load-data for
example) :

$class = get_class(sfContext::getInstance()->getUser();
for ($classes[] = $class; $class = get_parent_class($class);
$classes[] = $class);
print_r($classes);

I'm not sure but I think a user always exists, but it's not the same
instance depending on the context (web or cli).



On 21 mai, 20:53, Tom Haskins-Vaughan <[EMAIL PROTECTED]>
wrote:
> Yeah, I noticed that. I tried clear-cache but it didn't make any difference.
>
>
>
>
>
> Thomas Rabaix wrote:
> > Hello,
>
> > It look like the factorie settings are ignored. The error refers to
> > 'sfSessionStorage', however the session handler should by
> > 'sfSessionTestStorafe'
>
> > Thomas
>
> > On Wed, May 21, 2008 at 6:47 PM, Tom Haskins-Vaughan
> > <[EMAIL PROTECTED]> wrote:
> >> Thanks, Thomas. I tried that but I got the same error:
>
> >>  >> propel    load data from
> >> "/home/projects/...inah-2.0/symfony/data/fixtures"
> >> PHP Warning:  session_start(): Cannot send session cookie - headers
> >> already sent by (output started at
> >> /usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in
> >> /usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77
>
> >> Warning: session_start(): Cannot send session cookie - headers already
> >> sent by (output started at
> >> /usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in
> >> /usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77
> >> PHP Warning:  session_start(): Cannot send session cache limiter -
> >> headers already sent (output started at
> >> /usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in
> >> /usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77
>
> >> Warning: session_start(): Cannot send session cache limiter - headers
> >> already sent (output started at
> >> /usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in
> >> /usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77
>
> >>   [sfException]
> >>   Call to undefined method sfUser::getUserId
>
> >> Thomas Rabaix wrote:
> >>> Hello,
>
> >>> I am not sure at 100% about what I am going to say :
> >>>  - sfSessionStorage start the session when you access to the user
> >>>  - The command line uses the 'cli' env configuration
> >>>  - You have to change the cli factories to use the
> >>> sfSessionTestStorage, which do not used php session.
>
> >>> The use of session_id() is not the best way to do it as sessions can
> >>> be handled by others "systems"
>
> >>> Thomas
>
> >>> On Tue, May 20, 2008 at 11:33 PM, Tom Haskins-Vaughan
> >>> <[EMAIL PROTECTED]> wrote:
>  If I change the first if statement to the following it works fine:
>
>  if (!session_id())
>  {
>    return parent::save();
>  }
>
>  Am I going to cause any problems with symfony doing it like this?
>
>  Nicolas Perriault wrote:
> > 2008/5/20 Tom Haskins-Vaughan <[EMAIL PROTECTED]>:
>
> >> Everything works fine, except when I run the propel-load-data task,
> >> because of course there is no session.
> > I may be missing the point but here's what I'd do:
>
> >   public function save($con = null)
> >   {
> >     if (!$user = sfContext::getInstance()->getUser())
> >     {
> >       return parent::save();
> >     }
>
> >     if ($this->isNew())
> >     {
> >       $this->setCreatedBy($user->getUserId());
> >     }
>
> >     if ($this->isModified())
> >     {
> >       $this->setUpdatedBy($user->getUserId());
> >     }
>
> >     parent::save();
> >   }
>
> > ++
>
>  --
>  Tom Haskins-Vaughan
>  Temple Street Media: Design and Development for the Web
>  [EMAIL PROTECTED] |www.templestreetmedia.com
>
> >> --
> >> Tom Haskins-Vaughan
> >> Temple Street Media: Design and Development for the Web
> >> [EMAIL PROTECTED] |www.templestreetmedia.com
>
> --
> Tom Haskins-Vaughan
> Temple Street Media: Design and Development for the Web
> [EMAIL PROTECTED] |www.templestreetmedia.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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: propel-load-data

2008-05-21 Thread Tom Haskins-Vaughan

Yeah, I noticed that. I tried clear-cache but it didn't make any difference.

Thomas Rabaix wrote:
> Hello,
> 
> It look like the factorie settings are ignored. The error refers to
> 'sfSessionStorage', however the session handler should by
> 'sfSessionTestStorafe'
> 
> Thomas
> 
> On Wed, May 21, 2008 at 6:47 PM, Tom Haskins-Vaughan
> <[EMAIL PROTECTED]> wrote:
>> Thanks, Thomas. I tried that but I got the same error:
>>
>>  >> propelload data from
>> "/home/projects/...inah-2.0/symfony/data/fixtures"
>> PHP Warning:  session_start(): Cannot send session cookie - headers
>> already sent by (output started at
>> /usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in
>> /usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77
>>
>> Warning: session_start(): Cannot send session cookie - headers already
>> sent by (output started at
>> /usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in
>> /usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77
>> PHP Warning:  session_start(): Cannot send session cache limiter -
>> headers already sent (output started at
>> /usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in
>> /usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77
>>
>> Warning: session_start(): Cannot send session cache limiter - headers
>> already sent (output started at
>> /usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in
>> /usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77
>>
>>
>>   [sfException]
>>   Call to undefined method sfUser::getUserId
>>
>>
>>
>>
>>
>> Thomas Rabaix wrote:
>>> Hello,
>>>
>>> I am not sure at 100% about what I am going to say :
>>>  - sfSessionStorage start the session when you access to the user
>>>  - The command line uses the 'cli' env configuration
>>>  - You have to change the cli factories to use the
>>> sfSessionTestStorage, which do not used php session.
>>>
>>> The use of session_id() is not the best way to do it as sessions can
>>> be handled by others "systems"
>>>
>>> Thomas
>>>
>>>
>>> On Tue, May 20, 2008 at 11:33 PM, Tom Haskins-Vaughan
>>> <[EMAIL PROTECTED]> wrote:
 If I change the first if statement to the following it works fine:

 if (!session_id())
 {
   return parent::save();
 }

 Am I going to cause any problems with symfony doing it like this?

 Nicolas Perriault wrote:
> 2008/5/20 Tom Haskins-Vaughan <[EMAIL PROTECTED]>:
>
>> Everything works fine, except when I run the propel-load-data task,
>> because of course there is no session.
> I may be missing the point but here's what I'd do:
>
>   public function save($con = null)
>   {
> if (!$user = sfContext::getInstance()->getUser())
> {
>   return parent::save();
> }
>
> if ($this->isNew())
> {
>   $this->setCreatedBy($user->getUserId());
> }
>
> if ($this->isModified())
> {
>   $this->setUpdatedBy($user->getUserId());
> }
>
> parent::save();
>   }
>
> ++
>
 --
 Tom Haskins-Vaughan
 Temple Street Media: Design and Development for the Web
 [EMAIL PROTECTED] | www.templestreetmedia.com

>>>
>>>
>> --
>> Tom Haskins-Vaughan
>> Temple Street Media: Design and Development for the Web
>> [EMAIL PROTECTED] | www.templestreetmedia.com
>>
> 
> 
> 

-- 
Tom Haskins-Vaughan
Temple Street Media: Design and Development for the Web
[EMAIL PROTECTED] | www.templestreetmedia.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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: propel-load-data

2008-05-21 Thread Thomas Rabaix

Hello,

It look like the factorie settings are ignored. The error refers to
'sfSessionStorage', however the session handler should by
'sfSessionTestStorafe'

Thomas

On Wed, May 21, 2008 at 6:47 PM, Tom Haskins-Vaughan
<[EMAIL PROTECTED]> wrote:
>
> Thanks, Thomas. I tried that but I got the same error:
>
>  >> propelload data from
> "/home/projects/...inah-2.0/symfony/data/fixtures"
> PHP Warning:  session_start(): Cannot send session cookie - headers
> already sent by (output started at
> /usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in
> /usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77
>
> Warning: session_start(): Cannot send session cookie - headers already
> sent by (output started at
> /usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in
> /usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77
> PHP Warning:  session_start(): Cannot send session cache limiter -
> headers already sent (output started at
> /usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in
> /usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77
>
> Warning: session_start(): Cannot send session cache limiter - headers
> already sent (output started at
> /usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in
> /usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77
>
>
>   [sfException]
>   Call to undefined method sfUser::getUserId
>
>
>
>
>
> Thomas Rabaix wrote:
>> Hello,
>>
>> I am not sure at 100% about what I am going to say :
>>  - sfSessionStorage start the session when you access to the user
>>  - The command line uses the 'cli' env configuration
>>  - You have to change the cli factories to use the
>> sfSessionTestStorage, which do not used php session.
>>
>> The use of session_id() is not the best way to do it as sessions can
>> be handled by others "systems"
>>
>> Thomas
>>
>>
>> On Tue, May 20, 2008 at 11:33 PM, Tom Haskins-Vaughan
>> <[EMAIL PROTECTED]> wrote:
>>> If I change the first if statement to the following it works fine:
>>>
>>> if (!session_id())
>>> {
>>>   return parent::save();
>>> }
>>>
>>> Am I going to cause any problems with symfony doing it like this?
>>>
>>> Nicolas Perriault wrote:
 2008/5/20 Tom Haskins-Vaughan <[EMAIL PROTECTED]>:

> Everything works fine, except when I run the propel-load-data task,
> because of course there is no session.
 I may be missing the point but here's what I'd do:

   public function save($con = null)
   {
 if (!$user = sfContext::getInstance()->getUser())
 {
   return parent::save();
 }

 if ($this->isNew())
 {
   $this->setCreatedBy($user->getUserId());
 }

 if ($this->isModified())
 {
   $this->setUpdatedBy($user->getUserId());
 }

 parent::save();
   }

 ++

>>> --
>>> Tom Haskins-Vaughan
>>> Temple Street Media: Design and Development for the Web
>>> [EMAIL PROTECTED] | www.templestreetmedia.com
>>>
>>
>>
>>
>
> --
> Tom Haskins-Vaughan
> Temple Street Media: Design and Development for the Web
> [EMAIL PROTECTED] | www.templestreetmedia.com
>
> >
>



-- 
Thomas Rabaix

Internet Consultant

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Correct validate file format

2008-05-21 Thread Tom Haskins-Vaughan

Hi,

I've noticed that there are two (or more ?) different formats for the 
validation yml files. Which ine is the more recent/correct?

TIA

Tom
-- 
Tom Haskins-Vaughan
Temple Street Media: Design and Development for the Web
[EMAIL PROTECTED] | www.templestreetmedia.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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: propel-load-data

2008-05-21 Thread Tom Haskins-Vaughan

Thanks, Thomas. I tried that but I got the same error:

 >> propelload data from 
"/home/projects/...inah-2.0/symfony/data/fixtures"
PHP Warning:  session_start(): Cannot send session cookie - headers 
already sent by (output started at 
/usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in 
/usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77

Warning: session_start(): Cannot send session cookie - headers already 
sent by (output started at 
/usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in 
/usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77
PHP Warning:  session_start(): Cannot send session cache limiter - 
headers already sent (output started at 
/usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in 
/usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77

Warning: session_start(): Cannot send session cache limiter - headers 
already sent (output started at 
/usr/share/pear/symfony/vendor/pake/pakeFunction.php:366) in 
/usr/share/pear/symfony/storage/sfSessionStorage.class.php on line 77


   [sfException]
   Call to undefined method sfUser::getUserId





Thomas Rabaix wrote:
> Hello,
> 
> I am not sure at 100% about what I am going to say :
>  - sfSessionStorage start the session when you access to the user
>  - The command line uses the 'cli' env configuration
>  - You have to change the cli factories to use the
> sfSessionTestStorage, which do not used php session.
> 
> The use of session_id() is not the best way to do it as sessions can
> be handled by others "systems"
> 
> Thomas
> 
> 
> On Tue, May 20, 2008 at 11:33 PM, Tom Haskins-Vaughan
> <[EMAIL PROTECTED]> wrote:
>> If I change the first if statement to the following it works fine:
>>
>> if (!session_id())
>> {
>>   return parent::save();
>> }
>>
>> Am I going to cause any problems with symfony doing it like this?
>>
>> Nicolas Perriault wrote:
>>> 2008/5/20 Tom Haskins-Vaughan <[EMAIL PROTECTED]>:
>>>
 Everything works fine, except when I run the propel-load-data task,
 because of course there is no session.
>>> I may be missing the point but here's what I'd do:
>>>
>>>   public function save($con = null)
>>>   {
>>> if (!$user = sfContext::getInstance()->getUser())
>>> {
>>>   return parent::save();
>>> }
>>>
>>> if ($this->isNew())
>>> {
>>>   $this->setCreatedBy($user->getUserId());
>>> }
>>>
>>> if ($this->isModified())
>>> {
>>>   $this->setUpdatedBy($user->getUserId());
>>> }
>>>
>>> parent::save();
>>>   }
>>>
>>> ++
>>>
>> --
>> Tom Haskins-Vaughan
>> Temple Street Media: Design and Development for the Web
>> [EMAIL PROTECTED] | www.templestreetmedia.com
>>
> 
> 
> 

-- 
Tom Haskins-Vaughan
Temple Street Media: Design and Development for the Web
[EMAIL PROTECTED] | www.templestreetmedia.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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: propel-load-data

2008-05-21 Thread Thomas Rabaix

Hello,

I am not sure at 100% about what I am going to say :
 - sfSessionStorage start the session when you access to the user
 - The command line uses the 'cli' env configuration
 - You have to change the cli factories to use the
sfSessionTestStorage, which do not used php session.

The use of session_id() is not the best way to do it as sessions can
be handled by others "systems"

Thomas


On Tue, May 20, 2008 at 11:33 PM, Tom Haskins-Vaughan
<[EMAIL PROTECTED]> wrote:
>
> If I change the first if statement to the following it works fine:
>
> if (!session_id())
> {
>   return parent::save();
> }
>
> Am I going to cause any problems with symfony doing it like this?
>
> Nicolas Perriault wrote:
>> 2008/5/20 Tom Haskins-Vaughan <[EMAIL PROTECTED]>:
>>
>>> Everything works fine, except when I run the propel-load-data task,
>>> because of course there is no session.
>>
>> I may be missing the point but here's what I'd do:
>>
>>   public function save($con = null)
>>   {
>> if (!$user = sfContext::getInstance()->getUser())
>> {
>>   return parent::save();
>> }
>>
>> if ($this->isNew())
>> {
>>   $this->setCreatedBy($user->getUserId());
>> }
>>
>> if ($this->isModified())
>> {
>>   $this->setUpdatedBy($user->getUserId());
>> }
>>
>> parent::save();
>>   }
>>
>> ++
>>
>
> --
> Tom Haskins-Vaughan
> Temple Street Media: Design and Development for the Web
> [EMAIL PROTECTED] | www.templestreetmedia.com
>
> >
>



-- 
Thomas Rabaix

Internet Consultant

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: How do you sync your production db ?

2008-05-21 Thread kayoone

thx, didnt know about that plugin. will give it a try!


On 20 Mai, 22:18, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> If you have no choice, the 2nd solution is the best, and the one I use
> when I can't use the other one, which is the plugin
> "sfPropelSQLDiffPlugin".
> This plugin provides some tasks so you can have the "diff" between
> your tables and your schema, so you just alter tables and not alter
> data.
> But what doesn't (or not often) work and must be handled by hand is :
> - renaming fields
> - editing constraints with innodb tables (or any engine supporting
> constraints)
>
> In highly active development, I think this could be very tiring as
> renaming fields or changes like this are very common.
> But in a more stable cycle, this can be used quite easily.
>
> !! ALWAYS SAVE PRODUCTION DATABASE & FILES BEFORE ANY CHANGE !!
>
> This may be obvious, but it must be said everytime we talk about such
> a subjet ^^
>
> On 20 mai, 18:42, kayoone <[EMAIL PROTECTED]> wrote:
>
> > symfony has nice features to deploy your applications and to create
> > the database from the schema files etc.
>
> > However, once you got data on your production machine its not that
> > easy to keep the database layout in sync, so how do you do it ?
>
> > Since my symfony project is not production ready i am thinking about
> > this, and these are the possibilities that came to my mind:
>
> > 1. Edit the database on the prod. machine manually and alter the
> > tables to match local tables (very bad)
> > 2. Dump the data on the prod. machine, sync the project and run propel-
> > build-all, and then reimport the dump again (quite ok, but still some
> > work)
>
> > Any other ways ?
> > Some Pake task like symfony sync-database or something like that would
> > be really good, which just alters the tables/creates new ones instead
> > of recreating everything from scratch.
>
> > thx for your thoughts.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] FAMOUS PHOTO COLLECTION ,NATURE PHOTOS, DRAWINGS,

2008-05-21 Thread magesh kotteswaran
HAI FRIENDS ,
   I HAVE LOT OF NATURE PHOTOS , DRAWING PHOTOS AND FLOWERS AND
DIFFERENT  ONE HUMAN ANATOMY PLASTIC MODELS, I HAVE SEND WITH YOU, JUST
CLICK FOLLOWING LINK AND ENJOY IT,

DRAWING & PHOTOS  COLLECTION 

http://mageshdrawfedi.blogspot.com/

FLOWERS AND NATURE PHOTOS 

http://mageshflowerfedi.blogspot.com/

HUMAN ANATOMY PLASTIC MODELS (DON'T AFRAID)

THANKNG YOU

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: Impossible to us a class sf****

2008-05-21 Thread Sylver

-_-'
I'm so stupid.

Thanks ;)

On 21 mai, 11:23, "Dmitry Nesteruk" <[EMAIL PROTECTED]> wrote:
> Replace sfMailValidator() on sfEmailValidator()
>
> 2008/5/21 Sylver <[EMAIL PROTECTED]>:
>
>
>
> > Hello,
> > i try to use a sfMailValidator, but :
>
> > [code]Fatal error: Class 'sfMailValidator' not found in /home/simon/
> > workspace/sta/apps/frontend/modules/contact/actions/actions.class.php
> > on line 18[/code]
>
> > Code :
> > [code]
> >public function validateSend()
> >{
> >$mail = $this->getRequestParameter('mail');
> >if (!$mail)
> >{
> >$this->getRequest()->setError('mail', 'Le champ mail
> > doit être
> > remplis.');
> >return false;
> >}
> >$mailValidator = new sfMailValidator();
> >$mailValidator->initialize($this->getContext());
> >$error = 'L\'adresse mail n\' est pas une adresse valide de
> > type :
> > [EMAIL PROTECTED]';
> >if(!$mailValidator->execute($mail,$error))
> >{
> >return false;
> >}
>
> >return true;
> >}
> > [/code]
>
> > Same problem if i use a YML file.
>
> > Any help ? :d
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: Impossible to us a class sf****

2008-05-21 Thread Dmitry Nesteruk
Replace sfMailValidator() on sfEmailValidator()

2008/5/21 Sylver <[EMAIL PROTECTED]>:

>
> Hello,
> i try to use a sfMailValidator, but :
>
> [code]Fatal error: Class 'sfMailValidator' not found in /home/simon/
> workspace/sta/apps/frontend/modules/contact/actions/actions.class.php
> on line 18[/code]
>
> Code :
> [code]
>public function validateSend()
>{
>$mail = $this->getRequestParameter('mail');
>if (!$mail)
>{
>$this->getRequest()->setError('mail', 'Le champ mail
> doit être
> remplis.');
>return false;
>}
>$mailValidator = new sfMailValidator();
>$mailValidator->initialize($this->getContext());
>$error = 'L\'adresse mail n\' est pas une adresse valide de
> type :
> [EMAIL PROTECTED]';
>if(!$mailValidator->execute($mail,$error))
>{
>return false;
>}
>
>return true;
>}
> [/code]
>
> Same problem if i use a YML file.
>
> Any help ? :d
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Impossible to us a class sf****

2008-05-21 Thread Sylver

Hello,
i try to use a sfMailValidator, but :

[code]Fatal error: Class 'sfMailValidator' not found in /home/simon/
workspace/sta/apps/frontend/modules/contact/actions/actions.class.php
on line 18[/code]

Code :
[code]
public function validateSend()
{
$mail = $this->getRequestParameter('mail');
if (!$mail)
{
$this->getRequest()->setError('mail', 'Le champ mail 
doit être
remplis.');
return false;
}
$mailValidator = new sfMailValidator();
$mailValidator->initialize($this->getContext());
$error = 'L\'adresse mail n\' est pas une adresse valide de 
type :
[EMAIL PROTECTED]';
if(!$mailValidator->execute($mail,$error))
{
return false;
}

return true;
}
[/code]

Same problem if i use a YML file.

Any help ? :d
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---