[symfony-users] Re: EntityChoiceField Issue with QueryBuilder params

2011-02-23 Thread Nathan Mudie
You need to use the use option for the closure as the variable your
trying to use isn't in the correct scope.

See example 3 on this page: http://php.net/manual/en/functions.anonymous.php

Your code will look like this:

'query_builder' = function($repository) use ($state_id) {
 return $repository-createQueryBuilder('cities')-
where('cities.state_id = :state_id')-setParameter('state_id',
$state_id);
}


On Feb 23, 1:19 am, Roger Webb webb.ro...@gmail.com wrote:
 Another interesting point to add.  If I define(STATE_ID, $state_id)
 and pass that to the QueryBuilder setParameter method it works.

 On Feb 21, 3:12 pm, Roger Webb webb.ro...@gmail.com wrote:







  Greetings,

  Ran into an issue with the EntityChoiceField.  I am rendering a SELECT
  field with city names.  If I use a literal value (ie. 2) in the
  query_builder param of the EntityChoiceField everything works
  perfectly.  If I substitute that with a variable value I get an empty
  select.  Also, I have printed out the value of the state_id from the
  request and it prints the correct value.

  Any help would be appreciated.

  Roger

  Here is the code where I create the field.

  This is the code for the controller that is fetching the select field

  $params['city_select'] = 
  $this-forward('UserBundle:Ajax:getCitySelectByStateId', array(),

  array('state_id' = 2))-getContent();

  $params gets passed to the view

  This is the code from my AjaxController which should return these db
  driven fields on demand.

      public function getCitySelectByStateIdAction() {
          $em = $this-get('doctrine.orm.entity_manager');
          $request = $this-get('request');

          if(!$request-get('state_id'))
                  return new Response('ERROR');  //NOT GETTING AN ERROR
  HERE

          $state_id = (int)$request-get('state_id');

          $field = new EntityChoiceField($name, array(
                  'em' = $em,
                  'class' = 'ARN\EntityBundle\Entity\Cities',
                  'property' = 'city_name',
                  'query_builder' = function($repository) {
                       return 
  $repository-createQueryBuilder('cities')-where('cities.state_id = 
  :state_id')-setParameter('state_id',

  $state_id);
                                             }
          ));

          return $this-render('UserBundle:Ajax:form_field.html.twig',
  array('field' = $field));
      }

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.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


Re: [symfony-users] Re: How to get raw data in a partial???

2010-02-08 Thread Nathan
Just use $value-getRawValue()


---
nat...@nathan.gs : http://nathan.gs : http://twitter.com/nathan_gs


On Mon, Feb 8, 2010 at 8:49 PM, Darren884 darren...@gmail.com wrote:

 It seems I was able to pass the second argument ESC_RAW, but this
 butchers my ability to read credentials either way. Is there any I can
 just a simple damn array? I mean its Symfony's own variable. What is
 going on here?

 On Feb 8, 11:41 am, Darren884 darren...@gmail.com wrote:
  In my template I am trying to do ?php include_partial('global/
  navigator', array('User' = $sf_user)); ?
 
  But when I run $User-getAttributes() in my partial it is cleaning the
  code which makes it so it does not work. How can I get around this??
 
  Thanks,
  Darren

 --
 You received this message because you are subscribed to the Google Groups
 symfony users group.
 To post to this group, send email to symfony-us...@googlegroups.com.
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.comsymfony-users%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en.



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



Re: [symfony-users] How to disable sfWebDebug in dev environment?

2010-01-14 Thread Nathan
In your apps/APPLICATION/config/settings.yml

change your
dev:
  .settings:
 web_debug: true

to false.

that's all.

Best regards,
  Nathan

--
nat...@nathan.gs : http://nathan.gs : http://twitter.com/nathan_gs

On Thu, Jan 14, 2010 at 9:17 AM, Sid Bachtiar sid.bacht...@gmail.comwrote:

 Hi,

 Can I run the website in 'dev' without sfWebDebug? I've set debug to
 false in the index.php but it's still there.

 --
 Blue Horn Ltd - System Development
 http://bluehorn.co.nz

 --
 You received this message because you are subscribed to the Google Groups
 symfony users group.
 To post to this group, send email to symfony-us...@googlegroups.com.
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.comsymfony-users%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en.




-- 

You received this message because you are subscribed to the Google Groups "symfony users" group.

To post to this group, send email to symfony-us...@googlegroups.com.

To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.



Re: [symfony-users] Transition to Symfony 1.4 from Symfony 1.1

2010-01-08 Thread Nathan
First of all read the upgrade guide for 1.1 to 1.2 because there were some
serious changes in the form and widget system. After this read the 1.2 to
1.3 upgrade guide.

Upgrading from 1.3 to 1.4 is not necessary (both are the same code, except
in 1.4 all the depreciated stuff is gone).

Nathan

On Fri, Jan 8, 2010 at 9:05 AM, DEEPAK BHATIA toreachdee...@gmail.comwrote:

 Hi,

 I want to transition from Symfony 1.1 to Symfony 1.4.

 What are all the steps required ?

 Help needed

 Regards

 Deepak Bhatia

 --
 You received this message because you are subscribed to the Google Groups
 symfony users group.
 To post to this group, send email to symfony-us...@googlegroups.com.
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.comsymfony-users%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en.


-- 

You received this message because you are subscribed to the Google Groups "symfony users" group.

To post to this group, send email to symfony-us...@googlegroups.com.

To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.



Re: [symfony-users] Re: default value in form extracted from session

2010-01-08 Thread Nathan
$form-setWidget('pc_id', new sfWidgetFormInputHidden());



On Fri, Jan 8, 2010 at 2:45 PM, Stéphane stephane.er...@gmail.com wrote:

 Oops, there are hidden fields too, look this way.



 Before Printing, Think about Your Environmental Responsibility!
 Avant d'Imprimer, Pensez à Votre Responsabilitée Environnementale!


 On Fri, Jan 8, 2010 at 2:45 PM, Stéphane stephane.er...@gmail.com wrote:

 No, you can use
 $this-form-widgetSchema['pc_id']-setAttribute('style'='display: none');
 I don't know if it is exactly that, but this is the idea.



 Before Printing, Think about Your Environmental Responsibility!
 Avant d'Imprimer, Pensez à Votre Responsabilitée Environnementale!


 On Fri, Jan 8, 2010 at 2:22 PM, Mikael mikael.kermorg...@gmail.comwrote:


 I must have made a mistake during my test : the right pc shows up by
 default in the dropdown list when creating a new interface.

 If I wanted to hide this dropdown list, would I have to create a
 specific template ?

 Regards,

 Mikael


 --
 You received this message because you are subscribed to the Google Groups
 symfony users group.
 To post to this group, send email to symfony-us...@googlegroups.com.
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.comsymfony-users%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en.






 --
 You received this message because you are subscribed to the Google Groups
 symfony users group.
 To post to this group, send email to symfony-us...@googlegroups.com.
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.comsymfony-users%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en.

 --
nat...@nathan.gs : http://nathan.gs : http://twitter.com/nathan_gs
-- 

You received this message because you are subscribed to the Google Groups "symfony users" group.

To post to this group, send email to symfony-us...@googlegroups.com.

To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.



Re: [symfony-users] symfony 1.4 installation

2010-01-07 Thread Nathan
It's actually quite easy if you have svn.

I always install Symfony to /usr/local/share/symfony/VERSION. And I create
symlinks in the /usr/local/bin to the symfony script with a meaningful name
like sf1.3, sf1.4.

It's as easy as:
sudo mkdir /usr/local/share/symfony
cd /usr/local/share/symfony
sudo svn co http://svn.symfony-project.com/branches/1.3/
sudo ln -s /usr/local/share/symfony/1.3/data/bin/symfony
/usr/local/bin/sf1.3

that's all.

---
nathan @ http://twitter.com/nathan_gs
nathan.gshttp://nathan.gs/?utm_source=mailing-listutm_medium=emailutm_campaign=blog


On Thu, Jan 7, 2010 at 12:46 AM, Stéphane stephane.er...@gmail.com wrote:

 And replace, in your $project/config/projectConfiguration.class.php the
 first requires which reference your other sf version.



 Before Printing, Think about Your Environmental Responsibility!
 Avant d'Imprimer, Pensez à Votre Responsabilitée Environnementale!


 On Wed, Jan 6, 2010 at 7:27 PM, Gábor Fási maerl...@gmail.com wrote:

 You can also download the zip/tgz archive from the website, and
 extract it to your project's lib/vendor/symfony folder.

 On Wed, Jan 6, 2010 at 11:41, karansoni kanu8...@gmail.com wrote:
  i am using Ubuntu Linux 9.10 and i have installed symfony1.2.9 on it
  through pear .
 
  is there any phenomenon through which i can install the both versions
  symfony 1.2.9 and 1.4 on my linux though PEAR don't support two
  instalations then
 
  Do i have to install 1.4 through SVN??? I want to keep both versions
  on my PC
 
  with regards,
 
  karan soni
 
  --
  You received this message because you are subscribed to the Google
 Groups symfony users group.
  To post to this group, send email to symfony-us...@googlegroups.com.
  To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.comsymfony-users%2bunsubscr...@googlegroups.com
 .
  For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en.
 
 
 
 

 --
 You received this message because you are subscribed to the Google Groups
 symfony users group.
 To post to this group, send email to symfony-us...@googlegroups.com.
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.comsymfony-users%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en.





 --
 You received this message because you are subscribed to the Google Groups
 symfony users group.
 To post to this group, send email to symfony-us...@googlegroups.com.
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.comsymfony-users%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en.


-- 

You received this message because you are subscribed to the Google Groups "symfony users" group.

To post to this group, send email to symfony-us...@googlegroups.com.

To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.



Re: [symfony-users] Re: sf_user in url

2010-01-07 Thread Nathan
Actually you do know the username. Just do a $this-getUser()-getUsername()
in your catch you could use this as key. You could put the generated menu at
the beginning of the login in the session.

It still feels a bit dirty. Isn't there a way to catch based on unique
combination of credentials? If users share the same set of credentials no
additional overhead is needed.

best regards,
  Nathan

---
nathan @ http://twitter.com/nathan_gs nathan.gs
http://nathan.gs/?utm_source=mailing-listutm_medium=emailutm_campaign=blog


On Thu, Jan 7, 2010 at 7:56 PM, Kevin kevinb...@gmail.com wrote:

 The reason I am looking to do this is so I can cache the drop-down
 menu, it requires quite a few db calls and is pretty slow.  Since
 different users see different options in the menu based on their
 credentials I need a user-based cache.  By incorporating the username
 in the url I could accomplish this but a way without having their name
 in the url would be better.

 On Jan 7, 1:41 pm, Kevin kevinb...@gmail.com wrote:
  I am building an intranet system and would like to have the user's
  username at the beginning of the url: example.com/username/foo/bar.
 
  I was able to accomplish this by creating a custom routing class but I
  am wondering if there is a better way, with filters or something... I
  don't want to have to set every route to the custom class.
 
  Any ideas?

 --
 You received this message because you are subscribed to the Google Groups
 symfony users group.
 To post to this group, send email to symfony-us...@googlegroups.com.
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.comsymfony-users%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en.




-- 

You received this message because you are subscribed to the Google Groups "symfony users" group.

To post to this group, send email to symfony-us...@googlegroups.com.

To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.



Re: [symfony-users] Any good reason to execute symfony with sudo?

2010-01-07 Thread Nathan
I would only give write permissions by the user running php (most of the
times www-data) to cache, log and the upload directory. All else should be
read only and preferable have another user, like the deployer (nathan in my
case).

Also it's considered very bad practice to give a file/directory 777
permissions, most of the time it's sufficient to chgrp the needed files and
do chmod g+rw.

Nathan

--
nathan @ http://twitter.com/nathan_gs nathan.gs
http://nathan.gs/?utm_source=mailing-listutm_medium=emailutm_campaign=blog


On Thu, Jan 7, 2010 at 10:32 PM, Stéphane stephane.er...@gmail.com wrote:

 Apache and Php needs write right to cache dir, this is why it is chmod'ed
 777 using project:permissions task.
 You probably want apache and php read rights to read .php and other stuff,
 and need them write rights for cache and other dynamic-related folders
 (upload, etc).


 Before Printing, Think about Your Environmental Responsibility!
 Avant d'Imprimer, Pensez à Votre Responsabilitée Environnementale!


 On Thu, Jan 7, 2010 at 9:47 PM, Jacob Coby jc...@portallabs.com wrote:

 I sometimes need to use sudo when clearing the cache or running fix-perms
 since apache usually runs as a different user than the owner of the
 directory.  For the normal generator related stuff, no.

 On Jan 7, 2010, at 3:40 PM, Alexandru-Emil Lupu wrote:

  not quite.
 
  Chown the sf_root folder to match your user and pass.
 
  Alecs
 
  On Thu, Jan 7, 2010 at 10:09 PM, Javier Garcia tirengar...@gmail.com
 wrote:
  Hi,
 
  im wondering if is there any good reason to execute symfony with sudo.
 
  Javi
 
  --
  You received this message because you are subscribed to the Google
 Groups symfony users group.
  To post to this group, send email to symfony-us...@googlegroups.com.
  To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.comsymfony-users%2bunsubscr...@googlegroups.com
 .
  For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en.
 
 
 
 
 
 
  --
  Have a nice day!
  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
 
  --
  You received this message because you are subscribed to the Google
 Groups symfony users group.
  To post to this group, send email to symfony-us...@googlegroups.com.
  To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.comsymfony-users%2bunsubscr...@googlegroups.com
 .
  For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en.

 --
 Jacob Coby







 --
 You received this message because you are subscribed to the Google Groups
 symfony users group.
 To post to this group, send email to symfony-us...@googlegroups.com.
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.comsymfony-users%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en.





 --
 You received this message because you are subscribed to the Google Groups
 symfony users group.
 To post to this group, send email to symfony-us...@googlegroups.com.
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.comsymfony-users%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en.


-- 

You received this message because you are subscribed to the Google Groups "symfony users" group.

To post to this group, send email to symfony-us...@googlegroups.com.

To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.



Re: [symfony-users] File size validation?

2010-01-07 Thread Nathan
This is actually a php limit. Not a Symfony one. There's not much you can do
besides increasing your php max_post_size value. (but I wouldn't do this).

Nathan

--
nathan @ http://twitter.com/nathan_gs nathan.gs
http://nathan.gs/?utm_source=mailing-listutm_medium=emailutm_campaign=blog


On Thu, Jan 7, 2010 at 11:11 AM, Mark Smith marksmith5...@jungle-monkey.com
 wrote:

 Hi,

 I am trying to implement file size validation for an upload field on a
 form.

 For security / performance the php.ini post_max_size config setting is
 set to 8 mb.

 Now I want to limit the file size upload to about 1 mb. I am using the
 built in sfValidatorFile:

 $this-setValidator(file, new sfValidatorFile(array('max_size' =
 100, 'mime_types' = array('text/plain'),'required'=false)));

 This works ok if the user uploads a 2 mb file, but if the
 post_max_size is exceeded by the user trying to upload a file of say
 10mb, a 500 error page is produced! This is not very friendly and it
 makes it look like the page is broken, when actually it is a simple
 validation error.

 A way to request the browser to limit the file size would be
 acceptable, and the 500 page would be reserved for bad requests
 But sadly after a quick google it doesn't look like that is possible.

 How should this problem be dealt with?

 Thanks

 --
 You received this message because you are subscribed to the Google Groups
 symfony users group.
 To post to this group, send email to symfony-us...@googlegroups.com.
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.comsymfony-users%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en.




-- 

You received this message because you are subscribed to the Google Groups "symfony users" group.

To post to this group, send email to symfony-us...@googlegroups.com.

To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.



Re: [symfony-users] default value in form extracted from session

2010-01-07 Thread Nathan
Wouldn't it be a lot better if you pass the pc_id to the new form like this
(in the controller):

$eth = new Eth()
$eth-pc_id = sfUser::getAttribute('pc');

$ethForm  = new EthForm($eth);

There should be a loose coupling between classes. This way it's a lot
cleaner.

As for the pc id storing in the session, I wouldn't. I would just after
creating a pc do a redirect to the Eth form with the pc id as a request
parameter (get/post).

Nathan

On Fri, Jan 8, 2010 at 1:02 AM, Mikael mikael.kermorg...@gmail.com wrote:

 Hi,

 My data model has a Pc table with a 1-n relation with an Eth  table.

 I'd like to configure the backend forms in order to :

 1 - Show 'New Pc form' with button 'save and add interface'
 2 - When pc is saved (processForm), Pcs new id is put in session
 3 - Then, the form for creating a new interface is shown

 At step 3, I want the form for the interface to avoid the selection of
 the Pc, which should be the one just created.

 I've tried to do this this way, but does not work :

 // lib/form/doctrine/EthForm.class.php
  class EthForm extends BaseEthForm
 {
  public function configure()
  {
$this-setDefault('id_obj', sfUser::getAttribute('pc'));
  }
 }

 Could someone help me to do this right ?

 Regards,

 Mikael

 --
 You received this message because you are subscribed to the Google Groups
 symfony users group.
 To post to this group, send email to symfony-us...@googlegroups.com.
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.comsymfony-users%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en.



 --
nat...@nathan.gs : http://nathan.gs : http://twitter.com/nathan_gs
-- 

You received this message because you are subscribed to the Google Groups "symfony users" group.

To post to this group, send email to symfony-us...@googlegroups.com.

To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.



Re: [symfony-users] symfony 1.2 + mssql 2005 + propel + wamp

2010-01-04 Thread Nathan Bijnens
Hello,

When you start a new project, use the 1.4 release. If you're not starting
from scratch upgrade to 1.3. Certainly because you're using php 5.3!

I have good experiences with Doctrine, more than with Propel. I suggest you
look at the documentation for both. If MSSql 2005 is a requirement, I guess
a database with data also exist. If this is the case doctrine can generate
it's schema based on a database instead of a schema.yml.

Both Doctrine and Propel do database abstraction, you won't really notice
the difference between Mssql 2005 and MySQL. However the doctrine mysql dbal
is a lot better tested than the doctrine mssql dbal.

For how to actually start: Just like any other Symfony project. Except in
databases.yml put in a suitable dsn. (google for pdo dsn mssql if you really
can't find anything).

Best regards,
  Nathan


On Mon, Jan 4, 2010 at 2:11 PM, Vikos make.webp...@gmail.com wrote:

 Hi!

 We are start a project that must use mssql 2005 and run on windows
 server.
 (vindows server 2003, apache2, mssql 2005, symfony 1.2...actual, php
 5.3.1)

 How can I connect to sql server on windows via propel?
 Witch do you advise  propel or doctrine?
 What problems can be?
 What experiences are?

 Thanks!

 Viktor

 --

 You received this message because you are subscribed to the Google Groups
 symfony users group.
 To post to this group, send email to symfony-us...@googlegroups.com.
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.comsymfony-users%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en.




--

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




Re: [symfony-users] How to disable some components like swiftmailer (sf1.4), how could I save more cpu resource?

2010-01-04 Thread Nathan Bijnens
See below:

On Mon, Jan 4, 2010 at 4:46 PM, chrisyue blizzch...@gmail.com wrote:

 When I finished the jobeet tutorial, I found the application load some
 files which shouldn't be loaded as I never used them at all (swifter
 mailer for example, 11 files of it were loaded each request)

 the same situation has happened in my prod server, there has been more
 than 100+ files to be loaded and parsed, even the action cache had
 already exists. It make my server slow and cpu has been crazily
 consumed(nearly 90% each cpu, total 4 cpus) by php-cgi(with
 eaccelerator), even there were only 20 requests per sec.

 I don't know what's the purpose of loading those component even I
 didn't mention them in my script, some one tell me why? if I am sure
 some components I won't use, how can i completely disable them?

 And if you guys know some way to save cpu resource, please please tell
 me.. i use cent-os + php-fpm + nginx + eaccelerator + memcache

Is the cpu the bottleneck? In most cases it's ram. If you don't have a lot
of ram, don't start a lot of php-fpm, it will only make it slower...
 I use most of the times apc. Be sure to enlarge the ram of your
eaccelerator and memcache.

Use the sfSupercache. It will sure speedup your pages. If you have pages
that don't update every second you can generate static files, then it's just
Nginx.



 --

 You received this message because you are subscribed to the Google Groups
 symfony users group.
 To post to this group, send email to symfony-us...@googlegroups.com.
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.comsymfony-users%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en.



Best regards,
  Nathan

--

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




Re: [symfony-users] How to disable some components like swiftmailer (sf1.4), how could I save more cpu resource?

2010-01-04 Thread Nathan Bijnens
On Mon, Jan 4, 2010 at 5:02 PM, Eno symb...@gmail.com wrote:

 On Mon, 4 Jan 2010, chrisyue wrote:

  When I finished the jobeet tutorial, I found the application load some
  files which shouldn't be loaded as I never used them at all (swifter
  mailer for example, 11 files of it were loaded each request)
 
  the same situation has happened in my prod server, there has been more
  than 100+ files to be loaded and parsed, even the action cache had
  already exists. It make my server slow and cpu has been crazily
  consumed(nearly 90% each cpu, total 4 cpus) by php-cgi(with
  eaccelerator), even there were only 20 requests per sec.
 
  I don't know what's the purpose of loading those component even I
  didn't mention them in my script, some one tell me why? if I am sure
  some components I won't use, how can i completely disable them?
 
  And if you guys know some way to save cpu resource, please please tell
  me.. i use cent-os + php-fpm + nginx + eaccelerator + memcache

 Im not familiar with php-fpm or using nginx. Unless you're using something
 like fastcgi, Im guessing that Apache+mod_php will usually outperform
 using php-cgi.


Php-fpm is php-fastcgi (but with process control). Nginx +
php-fastcgi/php-fpm WILL outperform apache any day.



 Do you use caching in your app?

 Yes, you can also disable components you're not using. You probably should
 read the performance chapter of the definitive guide:

 http://www.symfony-project.org/book/1_2/18-Performance



 --



 --

 You received this message because you are subscribed to the Google Groups
 symfony users group.
 To post to this group, send email to symfony-us...@googlegroups.com.
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.comsymfony-users%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en.




-- 
Servs BVBA | http://servs.eu

--

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




Re: [symfony-users] Re: Netbeans with symfony support: tasks without sudo

2009-12-28 Thread Nathan Bijnens
This is a very bad idea...! Never run a program with more permissions than
it needs to have.

You could maybe create a bash wrapper that calls sudo symfony? And put this
in the right path?

Nathan

On Mon, Dec 28, 2009 at 3:14 PM, Alexandru-Emil Lupu
gang.al...@gmail.comwrote:

 A stupid ideea: launch your nb using sudo. So, you do not need to exec your
 task using sudo :)
 Anyway, the chown is your friend.

 sent via htc magic

 On Dec 28, 2009 3:52 PM, mattsister matt...@gmail.com wrote:

 My question is:
 Why you have to be super user to deal with your own code? I think you
 should change the ownership of the project folder and make it
 yours!!! :)

 On 27 Dic, 19:51, tirengarfio tirengar...@gmail.com wrote:  Hi,   i
 have installed Netbeans wi...

  --
 You received this message because you are subscribed to the Google Groups
 symfony users group.
 To post to this group, send email to symfony-us...@googlegroups.com.
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.comsymfony-users%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en.


--

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




Re: [symfony-users] Re: Netbeans with symfony support: tasks without sudo

2009-12-28 Thread Nathan Bijnens
Hello Javi,

Rename your symfony script in the project dir to symfony.real

paste this to a new file called symfony
#!/bin/bash

sudo symfony.real $@


that's about it.

Warning this is not tested! This will not work in windows!

regards,
  Nathan

On Mon, Dec 28, 2009 at 9:41 PM, tirengarfio tirengar...@gmail.com wrote:

 Thanks!

 On Dec 28, 3:21 pm, Nathan Bijnens nbijn...@servs.eu wrote:

  You could maybe create a bash wrapper that calls sudo symfony? And put
 this
  in the right path?

 Could you more details ?

 Javi


 On Dec 28, 3:21 pm, Nathan Bijnens nbijn...@servs.eu wrote:
  This is a very bad idea...! Never run a program with more permissions
 than
  it needs to have.
 
  You could maybe create a bash wrapper that calls sudo symfony? And put
 this
  in the right path?
 
  Nathan
 
  On Mon, Dec 28, 2009 at 3:14 PM, Alexandru-Emil Lupu
  gang.al...@gmail.comwrote:
 
   A stupid ideea: launch your nb using sudo. So, you do not need to exec
 your
   task using sudo :)
   Anyway, the chown is your friend.
 
   sent via htc magic
 
   On Dec 28, 2009 3:52 PM, mattsister matt...@gmail.com wrote:
 
   My question is:
   Why you have to be super user to deal with your own code? I think you
   should change the ownership of the project folder and make it
   yours!!! :)
 
   On 27 Dic, 19:51, tirengarfio tirengar...@gmail.com wrote:  Hi,  
 i
   have installed Netbeans wi...
 
--
   You received this message because you are subscribed to the Google
 Groups
   symfony users group.
   To post to this group, send email to symfony-us...@googlegroups.com.
   To unsubscribe from this group, send email to
   symfony-users+unsubscr...@googlegroups.comsymfony-users%2bunsubscr...@googlegroups.com
 symfony-users%2bunsubscr...@googlegroups.comsymfony-users%252bunsubscr...@googlegroups.com
 
   .
   For more options, visit this group at
  http://groups.google.com/group/symfony-users?hl=en.

 --

 You received this message because you are subscribed to the Google Groups
 symfony users group.
 To post to this group, send email to symfony-us...@googlegroups.com.
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.comsymfony-users%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en.




--

You received this message because you are subscribed to the Google Groups 
symfony users group.
To post to this group, send email to symfony-us...@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: SETUP SERVER

2009-05-22 Thread Nathan Rzepecki
Is symfony actually installed on this new server or is your project frozen?

-
Nathan Rzepecki
http://www.lionslair.net.au



Frank He wrote:
 I also suspect the new server configuration does not support symfony's 
 minimum requirement, such as PDO, php 5 or whatever.

 On Fri, May 22, 2009 at 1:21 PM, Eno symb...@gmail.com 
 mailto:symb...@gmail.com wrote:


 On Thu, 21 May 2009, janlar...@gmail.com
 mailto:janlar...@gmail.com wrote:

  hi im trying to replicate my server to a new pc, i can now run
 it but
  my problem is that when i clear cache it delete all in the cache

 That's normal.

  and
  when im trying to access it does not work anymore i need to copy my
  cache from my old server and to my new one.

 Bizarre - you should never copy cache from one server to another
 since its
 generated by symfony itself. You should check permissions - yes
 there's a
 command for that too:

 
 http://www.symfony-project.org/book/1_2/16-Application-Management-Tools#chapter_16_sub_managing_a_production_application

  Also my new server keeps
  ponting to my old database what do I need to configure so that I can
  point it to may new lo database server???

 Edit your databases.yml - did you write this application?

 Might be useful for you to read the 'Application Management Tools'
 chapter
 in the book.

 http://www.symfony-project.org/book/1_2/16-Application-Management-Tools





 

--~--~-~--~~~---~--~~
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: jQuery + prototype problem

2009-03-27 Thread Nathan Rzepecki
You can not use JQuery and Prototype at the same time.  All the 
library's use one component of JS and they can not both use it at the 
same time.  Unfortunately you can only use one at a time

-
Nathan Rzepecki
http://www.lionslair.net.au



Sid Bachtiar wrote:
 Great tip!

 I encountered this problem too and in the end I gave up and either use
 one or the other.

 2009/3/28 Dean Farrell dfarr...@horizon-research.com:
   
 You probably need to use the jQuery.noConflict() function, as both libraries
 are trying to use $, and colliding with each other.  I put it in my page
 header.  Then you'll have to use jQuery() instead of $() for any jOuery
 based functions you run.



 Dean



 

 From: symfony-users@googlegroups.com [mailto:symfony-us...@googlegroups.com]
 On Behalf Of Guychmyrat Amanmyradov
 Sent: Friday, March 27, 2009 9:10 AM
 To: symfony-users@googlegroups.com
 Subject: [symfony-users] jQuery + prototype problem



 Hi.
 i have forum :

 ?php echo form_remote_tag(array(
 'update'   = 'wall',
 'url'  = 'wall/addcomment',
 'before'   = if(!\$F('comment')){return false;},
 'complete' = $('comment').value='';
 )) ?

 it was working fine. But after i install jQuery it is not working anymore as
 Ajax!

 Before, it brings result in ajax and updates wall div. But now, it goes to
 wall/addcomment not bringing result!



 

 Yahoo! Türkiye açýldý!
 Haber, Ekonomi, Videolar, Oyunlar hepsi Yahoo! Türkiye'de!
 www.yahoo.com.tr/font

 



   

--~--~-~--~~~---~--~~
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: schema.sql is empty. Anybody can a help???

2009-03-16 Thread Nathan Rzepecki
I use propel not doctrine

-
Nathan Rzepecki
http://www.lionslair.net.au



Schorsch wrote:
 Hey,

 do you have an non empty schema.yml file? Doctrine stores it's
 schema.yml in the config/doctrine folder. If the doctrine folder
 doesn't exist, you have to create manually before you start.



 On Mar 15, 6:22 pm, Carlos Henrique chasi...@gmail.com wrote:
   
  am following the tutorial for Jobeet/Doctrine on Day 3.
 After I created the schema.yml and run build-sql, the prompt is

 
 doctrine  generating sql for models
 doctrine  Generated SQL successfully for models
 
 But I cannot find mentioned sql file under data/sql. There is only
 one
 emply schema.sql residing.
 I am using Windows XAMPP distribution.

 Anybody can a help?
 
 

   

--~--~-~--~~~---~--~~
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 an embedded form that relies on the other form

2009-03-16 Thread Nathan Rzepecki
It is this line here that does it.

$entry-setServerId($this-getObject()-getId());

within

 public function saveEmbeddedForms($con = null, $forms = null)

Because by the time that is called the main object is then saved.


-
Nathan Rzepecki
http://www.lionslair.net.au



maestro wrote:
 Still stuck!

 Looking a the sfPropelForm save() it is clear that the call to
 saveEmbeddedForms comes after the main object is getting saved. I see
 it also happening in the log file. Could it be something to do with
 the begin and transaction calls that surrounding doSave and
 saveEmbeddedForms? I mean, maybe the id of the main object isn't
 available until the db transaction gets committed. But, then am doing
 the exact same thing else where and it is working fine.

 hmm, need to take a break..





 On Mar 16, 7:10 pm, lionslair webmas...@lionslair.net.au wrote:
   
 I finally cracked in.  These two functions in my ServerForm class

   public function bind(array $taintedValues = null, array
 $taintedFiles = null)
   {
 $ret = parent::bind($taintedValues, $taintedFiles);
 foreach ($this-embeddedForms as $name = $form) {
   $this-embeddedForms[$name]-isBound = true;
   $this-embeddedForms[$name]-values = $this-values[$name];
 }

 return $ret;
   }

   public function saveEmbeddedForms($con = null, $forms = null)
   {
 foreach($this-getEmbeddedForms() as $closeForm)
 {

   $entry=$closeForm-save();
   $entry-setServerId($this-getObject()-getId());
   //mail('nat...@lionslair.net.au', 'debug', print_r
 ($entry, true));
   $entry-save();
 }
   }

 On Mar 16, 12:42 am, justin_davis jdavis1...@gmail.com wrote:

 
 I'm doing something like this, and this is my solution:
   
 Let's say you have two forms, one is an sfGuardUser form (Form 1), the
 other is a Profile form (Form 2) (representing those two models).
 When a new user is created, a new profile must be also created that
 depends on that record (Profile depends on sfGuardUser):
   
 (this is sfGuardUserForm.class.php):
   
   $profileForm = new ProfileForm();
   $profileForm-getObject()-setsfGuardUserId($this-getObject());
   $this-embedForm('profile', $profileForm);
   
 You'll also want to unset the sfGuardUserId field: unset($profileForm
 ['sf_guard_user_id']);
   
 So, it's basically creating a ProfileForm, getting the object related
 to it, then telling symfony to set that object's sfUserGuardId to
 equal the sfGuardUser object that this class represents.
   
 Does that make sense?  Hope this helps.  I'm somewhat of a newb
 myself, so I may be telling you something that doesn't apply.
   
 Good luck!
   
 Justin
   
 On Feb 5, 4:25 pm, Timmy m...@timothybowler.com wrote:
   
 I have two forms form 1 and form 2. Form 2 is embedded into form 1. On
 save form1 must be saved as a new row and therefore recieving a
 primary key, Afterwards this foreign key needs to be injected into
 form 2 before it can save.
 
 The only way i have figured out at the mo is after the form is valid.
 Instantiate the two models, populate them, add form2 model to form 1
 model then save.
 
 Isn't there an easier way?
 
 Thanx
 
 
 

   

--~--~-~--~~~---~--~~
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 an embedded form that relies on the other form

2009-03-16 Thread Nathan Rzepecki
No problem.

-
Nathan Rzepecki
http://www.lionslair.net.au



maestro wrote:
 Oppps, this is embarrassing. I was missing the autoIncrement: true, in
 my message schema.yml.
 Nathan thanx for your time..

 On Mar 16, 10:53 pm, maestro mustafa...@gmail.com wrote:
   
 but it is! it is right there in the db.. isn't this interesting!

 On Mar 16, 10:29 pm, Nathan Rzepecki webmas...@lionslair.net.au
 wrote:

 
 That means it is not yet saved.
   
 -
 Nathan Rzepeckihttp://www.lionslair.net.au
   
 maestro wrote:
   
 sadly $this-getObject()-getId() is returning a null in my case...
 although the rest of the object values are there.
 
 On Mar 16, 8:13 pm, Nathan Rzepecki webmas...@lionslair.net.au
 wrote:
 
 It is this line here that does it.
   
 $entry-setServerId($this-getObject()-getId());
   
 within
   
  public function saveEmbeddedForms($con = null, $forms = null)
   
 Because by the time that is called the main object is then saved.
   
 -
 Nathan Rzepeckihttp://www.lionslair.net.au
   
 maestro wrote:
   
 Still stuck!
 
 Looking a the sfPropelForm save() it is clear that the call to
 saveEmbeddedForms comes after the main object is getting saved. I see
 it also happening in the log file. Could it be something to do with
 the begin and transaction calls that surrounding doSave and
 saveEmbeddedForms? I mean, maybe the id of the main object isn't
 available until the db transaction gets committed. But, then am doing
 the exact same thing else where and it is working fine.
 
 hmm, need to take a break..
 
 On Mar 16, 7:10 pm, lionslair webmas...@lionslair.net.au wrote:
 
 I finally cracked in.  These two functions in my ServerForm class
   
   public function bind(array $taintedValues = null, array
 $taintedFiles = null)
   {
 $ret = parent::bind($taintedValues, $taintedFiles);
 foreach ($this-embeddedForms as $name = $form) {
   $this-embeddedForms[$name]-isBound = true;
   $this-embeddedForms[$name]-values = $this-values[$name];
 }
   
 return $ret;
   }
   
   public function saveEmbeddedForms($con = null, $forms = null)
   {
 foreach($this-getEmbeddedForms() as $closeForm)
 {
   
   $entry=$closeForm-save();
   $entry-setServerId($this-getObject()-getId());
   //mail('nat...@lionslair.net.au', 'debug', print_r
 ($entry, true));
   $entry-save();
 }
   }
   
 On Mar 16, 12:42 am, justin_davis jdavis1...@gmail.com wrote:
   
 I'm doing something like this, and this is my solution:
 
 Let's say you have two forms, one is an sfGuardUser form (Form 1), the
 other is a Profile form (Form 2) (representing those two models).
 When a new user is created, a new profile must be also created that
 depends on that record (Profile depends on sfGuardUser):
 
 (this is sfGuardUserForm.class.php):
 
   $profileForm = new ProfileForm();
   
 $profileForm-getObject()-setsfGuardUserId($this-getObject());
   $this-embedForm('profile', $profileForm);
 
 You'll also want to unset the sfGuardUserId field: unset($profileForm
 ['sf_guard_user_id']);
 
 So, it's basically creating a ProfileForm, getting the object related
 to it, then telling symfony to set that object's sfUserGuardId to
 equal the sfGuardUser object that this class represents.
 
 Does that make sense?  Hope this helps.  I'm somewhat of a newb
 myself, so I may be telling you something that doesn't apply.
 
 Good luck!
 
 Justin
 
 On Feb 5, 4:25 pm, Timmy m...@timothybowler.com wrote:
 
 I have two forms form 1 and form 2. Form 2 is embedded into form 1. On
 save form1 must be saved as a new row and therefore recieving a
 primary key, Afterwards this foreign key needs to be injected into
 form 2 before it can save.
   
 The only way i have figured out at the mo is after the form is valid.
 Instantiate the two models, populate them, add form2 model to form 1
 model then save.
   
 Isn't there an easier way?
   
 Thanx
   
 
 

   

--~--~-~--~~~---~--~~
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: Please help on exclude template

2008-06-08 Thread Nathan Hawks

On Jun 7, 12:53 pm, Richtermeister [EMAIL PROTECTED] wrote:
 You can create a view.yml file in the appropriate module config
 directory, and in there make the following declaration:

 youractionSuccess:
   has_layout:  off

 replacing youraction by whatever you named your action.
 That should work.

 It's also in the manual..

Specifically, here:
http://www.symfony-project.org/book/1_0/07-Inside-the-View-Layer#View%20Configuration
--~--~-~--~~~---~--~~
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: Symfony doesn't like DateTime

2008-01-11 Thread Nathan Hawks

Aha!  I ran into this this week too, now I know why.  Thanks, all.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---