[symfony-users] Is there a way to refresh or reset csrf token if I unset some of the form's field?

2010-06-02 Thread chrisyue
I have asked in the symfony forum in 
http://forum.symfony-project.org/index.php/t/27855/
but get no answers.
Is it the reason that the csrf token can't be reset after
initialization?

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


[symfony-users] How can I get rendered partial content in a task(or cli)

2010-02-24 Thread chrisyue
Hi all,

I want to use cron to send email by using symfony task,

My email is i18n mail and should be rendered before sending.

To do the work, I have two thoughts in my mind but still not very
clear. So I need some help from you:

1. Is there a way to get rendered partial content by directly use
symfony's view component without knowing the action (not by using the
XXXaction-getPartial() method);

2. If there is not, how can I call an action method in the symfony
task? I have googled this artical( 
http://www.symfony-project.org/book/1_0/06-Inside-the-Contro
ller-Layer#Batch%20Files) but this article is about symfony1.0, and
symfony1.2/1.3/1.4 of this section is removed (and what is wrong with
the documentation of 1.3/1.4?)

-- 
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] Where are the whole page cache files in sf 1.4?

2010-02-08 Thread chrisyue
I set the view cache option's dir in %sf_view_cache_dir% and i can see
those cache files in the view cache folder when the cache's
with_layout option is false

but if I set the with_layout option to true the cache would never
appear in the view cache folder, so where are the with_layout cache
files stored in?

-- 
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: redirect method covert to amp;

2010-01-11 Thread chrisyue
no .. that is not the case, I've already raise a trac ticket to core
dev team http://trac.symfony-project.org/ticket/8083

ken wrote:
 you need to explicitly call ini_set('arg_separator.output', '');
 before ProjectConfigutation

 On Jan 8, 10:43 am, chrisyue blizzch...@gmail.com wrote:
  yes I've already know that, but I've also found that when I use a
  route name directly (put a '@' before the route name),  sf will always
  throw error the route not found if the route has parameters. I tried
  it in sf 1.4.
 
 
 
  Eno wrote:
   On Wed, 6 Jan 2010, chrisyue wrote:
 
in an action method
if I use
$this-redirect('a_route_name', array( 'a' = '1', 'b' = '2', 'c' =
'3'));
 
it will redirect to a url like /the_route?a=1amp;b=2amp;c=3, is it a
bug? or I just use it wrong?
 
   Route names usually have a @ in front:
 
  http://www.symfony-project.org/book/1_2/09-Links-and-the-Routing-Syst...
 
   --
-- 
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: Custom 500 error page

2010-01-07 Thread chrisyue
yes
you can custom 500 in apps/APPNAME/config/error/error.html.php

Mark Smith wrote:
 Hi,

 Is it possible to define a custom 500 error page for a specific
 action?

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




Re: [symfony-users] redirect method covert to amp;

2010-01-07 Thread chrisyue
yes I've already know that, but I've also found that when I use a
route name directly (put a '@' before the route name),  sf will always
throw error the route not found if the route has parameters. I tried
it in sf 1.4.

Eno wrote:
 On Wed, 6 Jan 2010, chrisyue wrote:

  in an action method
  if I use
  $this-redirect('a_route_name', array( 'a' = '1', 'b' = '2', 'c' =
  '3'));
 
  it will redirect to a url like /the_route?a=1amp;b=2amp;c=3, is it a
  bug? or I just use it wrong?
 

 Route names usually have a @ in front:

 http://www.symfony-project.org/book/1_2/09-Links-and-the-Routing-System#chapter_09_sub_speeding_up_routing_by_using_the_rule_name



 --
-- 
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] How can I disable swiftmail completely?

2010-01-06 Thread chrisyue
I don't use swiftmail in my current app

but I've found that sf always load swiftmail's php file which is a
waste of resource

can I disable it or some other components completely in the setting
files?
-- 
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: Accessing arrays from templates turns them into sfOutputEscaperArrayDecorator objects?

2010-01-06 Thread chrisyue
thank you ken :)

ken wrote:
 you can use $object-getRaw('property');

 On Jan 5, 6:34 pm, chrisyue blizzch...@gmail.com wrote:
  I also encountered a problem like that: when I pass a DOMDocument
  object $dom to view, I found that I can't treat $dom as array
  anymore,
  I put $dom in a foreach statement:
 
  foreach ($dom-getElementsByTagName('name') as $name ) ..
 
  It would always ouput names from a xml file untill I set escape option
  on in settings.yml
 
 
 
  Gábor Fási wrote:
   sfOutputEscaperArrayDecorator means you have output escaping enabled,
   and any data you send to the view gets escaped for safety. You can
   still use it as an array, like $content_tabs[key1], the only
   difference you'll see is that you need not use htmlspecialchars() or
   anything like that.
 
   On Tue, Jan 5, 2010 at 04:06, SB oce...@gmail.com wrote:
Hello,
 
I'm trying to do something really simple (I thought), send an array
from the controller to the template.
 
actions.class.php:
$this-content_tabs = array('key1' = 'value1', 'key2' = 'value2');
 
indexSuccess.php:
var_dump($content_tabs);
 
gives:
object(sfOutputEscaperArrayDecorator)[69]
 private 'count' = null
 protected 'value' =
   array
     'key1' = string 'value1' (length=6)
     'key2' = string 'value2' (length=6)
 protected 'escapingMethod' = string 'esc_specialchars' (length=16)
 
However, if I try to output a simple scalar variable, i.e.:
 
actions.class.php
$this-content_tabs = 'test';
 
indexSuccess.php
var_dump($content_tabs);
 
gives:
string 'test' (length=4)
 
I get the same result if I try to set a request parameter as an array
in a filter, i.e.
 
myFilter.php:
$this-getContext()-getRequest()-setParameter('content_tabs', array
('key1' = 'value1', 'key2' = 'value2'));
 
if i output this in myFilter.php:
var_dump($this-getContext()-getRequest()-getParameter
('content_tabs'));
 
gives:
array
 'key1' = string 'value1' (length=6)
 'key2' = string 'value2' (length=6)
 
but if i output in indexSuccess.php:
var_dump($sf_request-getParameter('content_tabs'));
 
gives:
object(sfOutputEscaperArrayDecorator)[69]
 private 'count' = null
 protected 'value' =
   array
     'key1' = string 'value1' (length=6)
     'key2' = string 'value2' (length=6)
 protected 'escapingMethod' = string 'esc_specialchars' (length=16)
 
Why is this happening?  Is there no way to send arrays to the view
layer?
 
thanks!
 
SB
 
--
 
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 
athttp://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 can I disable swiftmail completely?

2010-01-06 Thread chrisyue
Thank you Eno :)

Eno wrote:
 On Wed, 6 Jan 2010, chrisyue wrote:

  I don't use swiftmail in my current app
 
  but I've found that sf always load swiftmail's php file which is a
  waste of resource
 
  can I disable it or some other components completely in the setting
  files?
 

 http://www.symfony-project.org/reference/1_4/en/14-Other-Configuration-Files



 --
-- 
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: How can I disable swiftmail completely?

2010-01-06 Thread chrisyue
After reading that reference I still don't know where to start,
Can you please teach me how to disable swiftmail by these config
files ?

On Jan 6, 10:41 pm, Eno symb...@gmail.com wrote:
 On Wed, 6 Jan 2010, chrisyue wrote:
  I don't use swiftmail in my current app

  but I've found that sf always load swiftmail's php file which is a
  waste of resource

  can I disable it or some other components completely in the setting
  files?

 http://www.symfony-project.org/reference/1_4/en/14-Other-Configuratio...

 --
-- 
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: How can I disable swiftmail completely?

2010-01-06 Thread chrisyue
After reading that reference I still don't know where to start,
Can you please teach me how to disable swiftmail by these config
files ?

On Jan 6, 10:41 pm, Eno symb...@gmail.com wrote:
 On Wed, 6 Jan 2010, chrisyue wrote:
  I don't use swiftmail in my current app

  but I've found that sf always load swiftmail's php file which is a
  waste of resource

  can I disable it or some other components completely in the setting
  files?

 http://www.symfony-project.org/reference/1_4/en/14-Other-Configuratio...

 --
-- 
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] Why can not change default routing class to a self defined routing class?

2010-01-06 Thread chrisyue
I can't event switch sfPatternRouting to sfRequestRoute in
factories.yml

I myself has made DomainRouting which can pass a param from the
subdomain, I want to use it as my default routing class, how can i do
it ?
-- 
You received this message because you are subscribed to the Google Groups 
symfony users group.
To post to this group, send email to symfony-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] redirect method covert to amp;

2010-01-06 Thread chrisyue
in an action method
if I use
$this-redirect('a_route_name', array( 'a' = '1', 'b' = '2', 'c' =
'3'));

it will redirect to a url like /the_route?a=1amp;b=2amp;c=3, is it a
bug? or I just use it wrong?
-- 
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] Accessing arrays from templates turns them into sfOutputEscaperArrayDecorator objects?

2010-01-05 Thread chrisyue
I also encountered a problem like that: when I pass a DOMDocument
object $dom to view, I found that I can't treat $dom as array
anymore,
I put $dom in a foreach statement:

foreach ($dom-getElementsByTagName('name') as $name ) ..

It would always ouput names from a xml file untill I set escape option
on in settings.yml


Gábor Fási wrote:
 sfOutputEscaperArrayDecorator means you have output escaping enabled,
 and any data you send to the view gets escaped for safety. You can
 still use it as an array, like $content_tabs[key1], the only
 difference you'll see is that you need not use htmlspecialchars() or
 anything like that.

 On Tue, Jan 5, 2010 at 04:06, SB oce...@gmail.com wrote:
  Hello,
 
  I'm trying to do something really simple (I thought), send an array
  from the controller to the template.
 
  actions.class.php:
  $this-content_tabs = array('key1' = 'value1', 'key2' = 'value2');
 
  indexSuccess.php:
  var_dump($content_tabs);
 
  gives:
  object(sfOutputEscaperArrayDecorator)[69]
   private 'count' = null
   protected 'value' =
     array
       'key1' = string 'value1' (length=6)
       'key2' = string 'value2' (length=6)
   protected 'escapingMethod' = string 'esc_specialchars' (length=16)
 
  However, if I try to output a simple scalar variable, i.e.:
 
  actions.class.php
  $this-content_tabs = 'test';
 
  indexSuccess.php
  var_dump($content_tabs);
 
  gives:
  string 'test' (length=4)
 
  I get the same result if I try to set a request parameter as an array
  in a filter, i.e.
 
  myFilter.php:
  $this-getContext()-getRequest()-setParameter('content_tabs', array
  ('key1' = 'value1', 'key2' = 'value2'));
 
  if i output this in myFilter.php:
  var_dump($this-getContext()-getRequest()-getParameter
  ('content_tabs'));
 
  gives:
  array
   'key1' = string 'value1' (length=6)
   'key2' = string 'value2' (length=6)
 
  but if i output in indexSuccess.php:
  var_dump($sf_request-getParameter('content_tabs'));
 
  gives:
  object(sfOutputEscaperArrayDecorator)[69]
   private 'count' = null
   protected 'value' =
     array
       'key1' = string 'value1' (length=6)
       'key2' = string 'value2' (length=6)
   protected 'escapingMethod' = string 'esc_specialchars' (length=16)
 
  Why is this happening?  Is there no way to send arrays to the view
  layer?
 
  thanks!
 
  SB
 
 
  --
 
  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.
 
 
 

--

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] How to disable some components like swiftmailer (sf1.4), how could I save more cpu resource?

2010-01-04 Thread chrisyue
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

--

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: How to disable some components like swiftmailer (sf1.4), how could I save more cpu resource?

2010-01-04 Thread chrisyue
Thank you for your reply
I am pretty sure that ram is not the problem
I will try apc tomorrow

I don't think the supercache plugin is suitable for me, but i am
interesting in it.
But it seems supercache plugin is just for apache, isn't it?

On Jan 4, 11:54 pm, Nathan Bijnens nbijn...@servs.eu wrote:
 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.




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

2010-01-04 Thread chrisyue
Yes I have set cache on and i already see the cache info in dev mode.
When I set the cache on the amount of loaded files decreased a lot but
sure it is far from enough(i wish i could limit it to under at least
30 files)
I've already read the guide many times before post, but still thank
you for your advice and the guide actually help a little.

On Jan 5, 12:02 am, 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.

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




[symfony-users] Do you tried the new feature project:optimize ? how is it?

2010-01-04 Thread chrisyue
I just tried the new task project:optimize,
On my situation it shows no difference after execute it, the
eaccelerator debug log shows the same amount of file loaded after
running it.

I guess this task is only for the application which didn't use cache
because the description of the task is reduces the number of disk
reads performed during runtime by caching the location of your
application's template files. so I think maybe it's useless on a
cached application

So what you discover after running this task?

--

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] How to create mysql partitioning table with symfony?

2009-05-24 Thread chrisyue

I am a newbie in symfony, recently I am studying symfony by the jobeet
tutorials, but I am used to creating partitioning for large table to
improve performance. wish somebody would help me with this question,
thx a lot.

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



[symfony-users] Re: How to create mysql partitioning table with symfony?

2009-05-24 Thread chrisyue

Thanx for your reply.

So how about creating patition manually, I mean for example I split a
very large user table `my_users` to 100 tables called `my_users_00`,
`my_users_01`, ... `my_users_99`, the last 2 number of the user_id
decide which table it would belong to. I can easily define them in
schema.yml with some simple php, but as you already expected, that the
`build-all` task generate 100 model class file (also form, filter ...)
which I would like to expect just 1 in there. I may write a class
which can auto decide to use which model from the user_id, but i don't
think it is good enough. Is there a better way to do these kind of
stuff in symfony??

On May 24, 8:00 pm, Ian P. Christian poo...@pookey.co.uk wrote:
 2009/5/24 chrisyue blizzch...@gmail.com

  I am a newbie in symfony, recently I am studying symfony by the jobeet
  tutorials, but I am used to creating partitioning for large table to
  improve performance. wish somebody would help me with this question,
  thx a lot.

 No ORM I know can do this.
 I'd suggest creating an SQL script you can run to ALTER the tables as 
 required.

 --
 Blog:http://pookey.co.uk/blog
 Follow me on twitter:http://twitter.com/ipchristian
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---