[symfony-users] Re: R: Using memcache for session storage
I see, so there is no specific sfMemcacheSessionStorage class, but I can utilize sfMemcacheCache for sessions by changing my storage option to sfCacheSessionStorage in factories.yml and specifying the class? The only thing I could find on this is here: https://groups.google.com/d/topic/symfony-users/fSBK93k4Ld8/discussion, but if anyone has a link to docs for doing this or can post an example config that'd be great. Also, I noticed: " * sfCacheSessionStorage manages session storage via a signed cookie and cache backend. * * This class stores the session data in via sfCache instance and with an id issued in a * signed cookie. Useful when you don't want to store the session." What exactly does this mean? Is the data stored in memcached and it just uses a cookie for identifying the user as normal? Or are there differences I need to keep in mind when using sfUser? Cheers, Phil -- 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] Using memcache for session storage
With a previous sf1.0 project I used sfMemcachePlugin and it's sfMemcacheSessionStorage class for saving the session to memcache so we could share sessions across multiple hosts. I'd like to do the same thing with my current sf1.4 project but there doesn't appear to be a compatible plugin? Is anyone out there currently using memcache for sessions, and if so, do you have a sessionStorage class you're willing to share to save me having to port the sf1.0 version I have? Cheers. -- 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] Re: ysfDimensionsPlugin and cache:clear
I've added a ticket about this along with a possible patch... http://trac.symfony-project.org/ticket/9370 -- 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] Re: ysfDimensionsPlugin and cache:clear
Just to be clear it looks like this is throwing warnings on every CLI task that doesn't specify an app or env, not just cache-clear, which leads me to believe I must've missed something? Anyone else seeing this behaviour? -- 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] ysfDimensionsPlugin and cache:clear
I've been a user of the sf1.0 version of the ysfDimensionsPlugin for a couple of years, so I'm already a big fan. I've just tried adding it to our new sf1.4 project and every time I clear the cache I get PHP notices about undefined properties: 1. PHP Notice: Undefined property: ProjectConfiguration::$application in /path/to/proj/plugins/ysfDimensionsPlugin/lib/config/ysfProjectConfiguration.class.php on line 79 I'm guessing this is because the CLI doesn't always define an app or environment (which you wouldn't want to do for a global cache clear anyway), so have I missed something in the readme that will avoid these notices or is it something I have to work around / put up with? Cheers, Phil. -- 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] Removing previously set query params on a doctrine_query object
Hi, I have a Doctrine_Query that gets passed to some model filters for my search. Initially by default, the query should have a left join set to help hydrate related objects for a count column. However, one of the filters should limit results to ones that have existing records in the related table (i.e. an inner join instead). Is it possible to remove the leftJoin() (or any other DQL-added param)? If not, what approach would you use instead, bearing in mind that the query is instantiated and defaults added before being passed to the filters? -- 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] Saving m:n relations without a form (doctrine)
Hi, I have the following schema: Artist - ArtistSession - Session Artist: columns: id: primary: true type: integer notnull: true autoincrement: true ... relations: Sessions: class: Session refClass: ArtistSession local: artist_id foreign: session_id ArtistSession: columns: artist_id: primary: true type: integer notnull: true session_id: primary: true type: integer notnull: true relations: Artist: local: artist_id foreign: id Session: local: session_id foreign: id Session: columns: id: primary: true type: integer notnull: true ... I assumed I could do something like $sessions = Doctrine::getTable('Session')->findByFoo('bar'); $artist->setSessions($sessions); $artist->save(); which would automatically create the ArtistSession relation on the save, but it doesn't. What you actually have to do is $artist->getSessions()->merge($sessions); Which will then successfully create the join records. Why is this? Is there something merge() does that set() doesn't? -- 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] Re: sfDynamicFormPlugin
I have a need for this, I've got something similar but in an sf1.0 app that obviously doesn't use the form framework, but it'd be great to have a plugin to make this simple. On 19 Sep, 11:04, juro wrote: > Hi, > > I am thinking of developing a plugin that enables an "admin" to create > a form (without having to manipulate widget files) and to display the > form on the "frontend". Two questions: > > - Is there a plugin that does this already? > - Does anyone need something like this? > > Warm regards > juro -- 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] Re: Race condition with session data
The answer is: yes - $this->getUser()->shutdown() seems to work. If anyone knows of a particular reason why this might be a bad idea, please let me know. On 8 Sep, 09:10, Phil Moorhouse wrote: > The site needs to work with javascript disabled so unfortunately > that's not an option at present. > > Adding a delay seems a bit of an unreliable way to work around the > problem due to not being able to guarantee how long A1 will take to > finish sending content. > > Is there definitely no way to force a session write from an action? > Would calling $this->getUser()->shutdown() do it? > > On 7 Sep, 17:17, pghoratiu wrote: > > > The session is closed after all content is sent from A1. > > You should find a way to delay the load of the iframe (via Javascript > > maybe) to make sure that A1 has completed and that A2 can load the new > > content. > > > gabriel > > > On Sep 7, 6:04 pm, Phil Moorhouse wrote: > > > > Hi, I currently have an action (A1) that performs some manipulation of > > > objects saved in the session, and then loads a view containing an > > > iframe. > > > > The iframe loads another action (A2) from the same application which > > > relies on objects saved to the session in A1. Sometimes, particularly > > > when accessing remotely, the objects do not seem to be present in the > > > session and A2 throws a fatal error. > > > > After some discussion in IRC, it seems like A2 is probably loading the > > > session before A1 has finished writing to it. This seems counter- > > > intuitive, but I can't think of any other explanation. > > > > Is it possible to flush writes to the session from an action (A1) so > > > that I can be sure the data has been saved? > > > > This is on a symfony 1.0 site and using sfMemcacheSessionStorage > > > fromhttp://www.symfony-project.org/plugins/sfMemcachePlugin. -- 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] Re: Race condition with session data
The site needs to work with javascript disabled so unfortunately that's not an option at present. Adding a delay seems a bit of an unreliable way to work around the problem due to not being able to guarantee how long A1 will take to finish sending content. Is there definitely no way to force a session write from an action? Would calling $this->getUser()->shutdown() do it? On 7 Sep, 17:17, pghoratiu wrote: > The session is closed after all content is sent from A1. > You should find a way to delay the load of the iframe (via Javascript > maybe) to make sure that A1 has completed and that A2 can load the new > content. > > gabriel > > On Sep 7, 6:04 pm, Phil Moorhouse wrote: > > > Hi, I currently have an action (A1) that performs some manipulation of > > objects saved in the session, and then loads a view containing an > > iframe. > > > The iframe loads another action (A2) from the same application which > > relies on objects saved to the session in A1. Sometimes, particularly > > when accessing remotely, the objects do not seem to be present in the > > session and A2 throws a fatal error. > > > After some discussion in IRC, it seems like A2 is probably loading the > > session before A1 has finished writing to it. This seems counter- > > intuitive, but I can't think of any other explanation. > > > Is it possible to flush writes to the session from an action (A1) so > > that I can be sure the data has been saved? > > > This is on a symfony 1.0 site and using sfMemcacheSessionStorage > > fromhttp://www.symfony-project.org/plugins/sfMemcachePlugin. -- 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] Re: doctrine query help needed
Is your schema already fixed? If not, the normal way to do this would be to have m-m join tables: NewsImage [ news_id, image_id ] EducationImage [ education_id, image_id ] HealthImage [ health_id, image_id] and remove: content_id type from the ContentImage table. Then if you want all "news" images, something like: $q = Doctrine_Query::create() ->from('ContentImage ci') ->innerJoin('NewsImage'); $newsImages = $q->execute(); or images for a particular news item: $news->getImages(); On 7 Sep, 15:30, Shihab KB wrote: > dear friends, > > I have the following tables. > > News [id, title, …] > Education [id, title…..] > Health [id, title, ….] > ContentImage [id, contented (id of the News, Education, Health), type > (like News, Education, Health), path…] > > The News, Education, Health may or may not have images in the > ContentImage table. There is no relationship is set in between News, > Education, Health table with ContentImage table. But we can link the > programatically by using id=contentid and type = 'News'. I want to > write a Doctrine query the return the left outer join between News, > Education, Health tables and ContentImage table. > > Is it possible thru dotrine query? > > Or do I need to write the query like below, > > [code] $sql = "SELECT * FROM... "; > $pdo = Doctrine_Manager::connection()->getDbh(); > $data = $pdo->query($sql)->fetchAll(); [/code] > > Please reply. -- 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] Race condition with session data
Hi, I currently have an action (A1) that performs some manipulation of objects saved in the session, and then loads a view containing an iframe. The iframe loads another action (A2) from the same application which relies on objects saved to the session in A1. Sometimes, particularly when accessing remotely, the objects do not seem to be present in the session and A2 throws a fatal error. After some discussion in IRC, it seems like A2 is probably loading the session before A1 has finished writing to it. This seems counter- intuitive, but I can't think of any other explanation. Is it possible to flush writes to the session from an action (A1) so that I can be sure the data has been saved? This is on a symfony 1.0 site and using sfMemcacheSessionStorage from http://www.symfony-project.org/plugins/sfMemcachePlugin. -- 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] Re: a good IDE for Symfony
Aptana Studio v3 is now open source and currently in beta - it has reintroduced it's own PHP editor (i.e. not using PDT as in v2) as well as including excellent CSS / JS / HTML / Ruby editors. http://www.aptana.com/products/studio3 It's stable and mostly usable, there are a few small non-critical bugs now and again, but they're releasing a new build every week or two and so far it's pretty promising. You can get it as an Eclipse plugin or as a standalone, both based on Eclipse Helios (3.6) - so it is Java - but it certainly doesn't feel sluggish like PDT. Pros are: Fast Decent GIT integration (much better than EGIT) Properly themeable (light on dark themes - yay!) Quick turnaround on bug / feature requests from the devs still compatible with other eclipse plugins (subclipse, etc) Write your own bundles (in Ruby) Cons are: No yaml editor as yet (but it's coming soon) No goto declaration (F3 / ctrl-click) of function names yet (also coming) Anyways, give it a try. On Aug 4, 12:22 am, "Julian Reyes Escrigas" wrote: > Hi > > I need help for find a new editor for PHP, I'm using Netbeans 6.9 but I > don't know for what is slow, always start very well but when the project > grows it's turns unstable > > I need only 3 characteristics > > 1. Faster and lightweight > > 2. With autocomplete for all classes in a folder and include folders > > 3. Support for PHP, html, CSS, JavaScript and YAML (auto colored, > syntaxes and turn tabs into spaces ) > > Some one knows any similar NO JAVA editor. > > I use Windows 7 64bits, have AMD Phenom II X4 965 3.4Ghz, 6Gb DDRIII, and > SATAII HD -- 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] Re: Form helper on symfony 1.4
"A Gentle Introduction..." is meant to be current documentation though so this should be fixed. Gustavo, please report the issue here: http://trac.symfony-project.org/newticket with type=documentation and component=form and someone with commit access to the docs will hopefully remove the bad information. On Jun 15, 5:43 am, el-sid wrote: > Hi gustavo, i think you would be better served by reading these > manuals: > > http://www.symfony-project.org/forms/1_2/en/http://www.symfony-project.org/more-with-symfony/1_4/en/06-Advanced-F... > > The forms framework was revamped so these manuals should get you up > and going > On Jun 14, 11:46 pm, Gustavo Fonseca wrote: > > > hi, > > The book A gentle introduction do symfony[1] tells me that there is a > > helper called Form which can generate a element containig a > > country list, but this helper is deprecated [2]! Somebody know if this > > feature does not exists anymore on symfony 1.4? > > > [1]http://www.symfony-project.org/gentle-introduction/1_4/en/13-I18n-and... > > [2]http://www.symfony-project.org/tutorial/1_4/en/deprecated#chapter_460... -- 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] Appending string to sfDoctrineRoute path
Is it possible to append a string to the end of a URL when using sfDoctrineRoute? i.e. where "some-band-name" is the slug I'd like /artist/some-band-name-tickets here's my current routing: artist_show: url: /artist/:slug class: sfDoctrineRoute param: { module: artist, action: show } options: { model: Artist, type: object } requirements: sf_method: [get] -- 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] Re: subdomain-based affiliate programme for ecommerce site
This thread: http://groups.google.com/group/symfony-users/browse_thread/thread/6110d23b5879501a/9cf0c80fd94142fd appears to suggest that it works fine with all symfony 1.x versions. On Apr 12, 2:22 pm, Phil Moorhouse wrote: > We do something very similar using the fantastic ysfDimensionsPlugin > (http://www.symfony-project.org/plugins/ysfDimensionsPlugin) although > it only lists sf1.1 so I'm not sure if it's compatible with sf1.4. > > It gives you your own cascading config / templates / actions / etc > for each affiliate, i.e. you only have to override the bits you want > to, which in the case of a branded site could mean something as simple > as adding an additional view.yml that overrides the default css path. > > i.e. > > apps/appname/config/ > app.yml > view.yml > settings.yml > /affiliatename/ > #override your defaults here > view.yml > > Might be worth looking into before engineering it yourself. > > On Apr 8, 2:35 am, Tom Haskins-Vaughan > wrote: > > > Hi there, > > > I'm working on an ecommerce site that will eventually have an > > affiliates programme that will work like so: > > > * There will be several affiliates. > > > * Each affiliate will be able to 'skin' the site by adding their own > > css stylsheet. > > > * For each purchase on the website the affiliate will be recorded to > > allow us to pay a commission to the affiliate > > > * The affiliates will direct traffic to the site be giving out his > > subdomain: exampleaffiliate.maindomain.com > > > I started by following the advanced routing chapter in the more with > > symfony book. I have created a route class and I am setting a request > > parameter in a custom filter. But before I go any further I'm > > wondering if it wouldn't be better to store this information in the > > User classes and just bypass the routing all together. Does anyone > > have any suggestions? > > > TIA, > > > Tom -- 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 To unsubscribe, reply using "remove me" as the subject.
[symfony-users] Re: subdomain-based affiliate programme for ecommerce site
We do something very similar using the fantastic ysfDimensionsPlugin (http://www.symfony-project.org/plugins/ysfDimensionsPlugin) although it only lists sf1.1 so I'm not sure if it's compatible with sf1.4. It gives you your own cascading config / templates / actions / etc for each affiliate, i.e. you only have to override the bits you want to, which in the case of a branded site could mean something as simple as adding an additional view.yml that overrides the default css path. i.e. apps/appname/config/ app.yml view.yml settings.yml /affiliatename/ #override your defaults here view.yml Might be worth looking into before engineering it yourself. On Apr 8, 2:35 am, Tom Haskins-Vaughan wrote: > Hi there, > > I'm working on an ecommerce site that will eventually have an > affiliates programme that will work like so: > > * There will be several affiliates. > > * Each affiliate will be able to 'skin' the site by adding their own > css stylsheet. > > * For each purchase on the website the affiliate will be recorded to > allow us to pay a commission to the affiliate > > * The affiliates will direct traffic to the site be giving out his > subdomain: exampleaffiliate.maindomain.com > > I started by following the advanced routing chapter in the more with > symfony book. I have created a route class and I am setting a request > parameter in a custom filter. But before I go any further I'm > wondering if it wouldn't be better to store this information in the > User classes and just bypass the routing all together. Does anyone > have any suggestions? > > TIA, > > Tom -- 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 To unsubscribe, reply using "remove me" as the subject.
[symfony-users] Re: How to set variables In the Global template?
This is a perfect use-case for the Dimensions plugin: http://www.symfony-project.org/plugins/ysfDimensionsPlugin It allows you to configure different stylesheets / templates for each "dimension" which could easily map to your clients. On Dec 17, 2:44 pm, ajit wrote: > Hi all, > > I have an application where I need to customize the look(Color Scheme > which matches the client site) for each client using the single > codebase...So what I am doing is I am storing the values in the yml > file and from that I am fetching the values. > > I am doing something like this in the global template: > > $file = strtolower($sf_request->getParameter('symbol')) . ".yml"; > $filepath = sfConfig::get('app_file_path') . 'web/uploads/settings/' . > $file; > if (file_exists($filepath)) > { > $test = sfYaml::load( sfConfig::get('app_file_path') . 'web/uploads/ > settings/' .$file);} > > else > { > $test = sfYaml::load(sfConfig::get('app_file_path') . 'web/uploads/ > settings/default.yml');} > > foreach ($test as $a) > { > $topbar = "#" . $a['color']['topbar']; > $footerbar = "#" . $a['color']['footerbar']; > $inactivetab = "#" . $a['color']['inactivetab']; > > $activetab = "#" . $a['color']['activetab']; > $activetabtext = "#" . $a['color']['activetabtext']; > $menuline = "#" . $a['color']['menuline']; > $textcolor = "#" . $a['color']['textcolor']; > > $postedByBox = "#" . $a['color']['postedByBox']; > $questionBox = "#" . $a['color']['questionBox']; > $contextBox = "#" . $a['color']['contextBox']; > $answerBox = "#" . $a['color']['answerBox']; > > } > > Whatever variables I am setting here, I need to access them in the > module's templates also... > > The problem here is I can't access the variables set here in the > modules template( in for ex: modulename/indexSuccess.php) > > Pls help me how to do that? > > P.S: I am storing Colors in the variables. > > Thanks in Advance! > > Ajit -- 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: Day 1 - Jobeet tutorial
Just to be clear: 1. Make sure you commit the completely empty cache / log dirs to your svn repo (best as part of your initial import of the project) - this will mean when you check out a new working copy in future that those directories definitely get created. 2. You then set an svn property on the cache / log dirs called svn:ignore with a single * wildcard (i.e. ignore everything in this dir). 3. Commit the cache / log dirs again to make sure svn repo knows about the svn:ignore property --~--~-~--~~~---~--~~ 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: Call For Information Re-organization [opinions needed]
It's not just code examples though, it's more the "gotchas" or misunderstandings that other people have had but can then comment on to say "actually, you might think this does x but it does y instead". The mod up / mod down is also a good idea so that bad examples can get buried or removed completely. The PHP docs have official "examples" directly in the API docs - I know there are plenty of examples in the symfony book but when you're after a specific usage of a particular function it's harder to wade through. Maybe the best examples in the comments can get "promoted" to the official API directly above them with enough votes? The "Definitive Guide" / "Practical Symfony" should be the "how to write Symfony apps" docs and the API should be a quick reference - there's bound to be some overlap but that's not really a bad thing as long as it's consistent info. On Sep 28, 8:42 pm, Fabian Lange wrote: > Hi Bruno > > On Mon, Sep 28, 2009 at 4:32 PM, Bruno Reis wrote: > > For me, there is one major reason for the popularity and spread of the php > > in the word: comments on the manual pages! > > For me the popularity and spread of really bad and crappy code are the > comments on the manpages. so many people think it is actually good > code to copy, but frankly, i cannot remember a single god quality > piece of code. > > Similar bad code examples exist also for other languages (like the > stuff on kickjava) but nowhere they are promoted like in the php.net > manual. > If you are using code from php.net you are putting your applications at risk > > Yes I have an extreme position. > So I challenge you to show me a good code example from php.net that we > then can discuss. (preferrably on a different thread) > > Fabian --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Symfony has definitely become too complicated framework
Ghost3D, Firstly, the reason for the move to OO forms has already been covered - it's to promote re-use and greater flexibility. This unavoidably comes with the cost of increased complexity, and I think from the answers above most people here are willing to make that trade-off. Secondly, Symfony is not meant to be an application generator in the way that Drupal or Joomla will build most of your app for you. It's a foundation and structure for you to build your app on top of. The admin generator can quickly give you a simple back-end and in some cases people have bent and shaped it to make entire sites, but there is no explicit claim that you can wave a magic wand and Symfony will write your entire codebase. If you want that then Symfony is not for you. Thirdly, the directory structure is not complex - it follows a convention that is well named and repeated throughout the framework, which makes naming decisions and finding old code easy. The empty classes are there so that you can extend the base classes without changing them, which means you can update your Symfony version or rebuild your model without fear of overwriting your own custom code. The CRUD is a quickly producible (and completely optional) starting point for you to modify, and that's all it's meant to be. The configuration has well chosen defaults from the start - the only thing you need to provide to get an app up and running are your database connection details, so it's hardly "painstaking". You seem to be of the impression all frameworks should fulfil the same needs and take the same approach. If you have a preferred approach, then use a framework that implements it, there is no point in arguing that Symfony does things the wrong way. Phil lazymanc on #symfony / #symfony-off On Sep 23, 12:29 pm, bghost wrote: > Hi Fabien, > > You say that I write nonsense and stupid e-mails? Well, seems that > you did not understand me. So, I'll be here a little more detailed and > specific: > > First: > > No offense Fabien, this is a well-meaning criticism. I know that you > invested so much effort into Symfony. However, you are a little > exaggerated forcing object model and object-oriented programming > where it is necessary - and where it is not (as is the case with WEB > Forms), in the language which already has a very bad and sloppy > object model. So you complicate some tasks in the Symfony > framework that already was simple and good. > > Second: > > Almost 90% of the code that generates the Symfony framework > developer need to modify or re-write, because the generated > code "does not follow best practice" (per your words) in programming. > What is the point and what the benefits of the code generated if 90% > of the code must be re-written on the completely different way? > > Third: > > The result of all this is a complex directory structure, many empty > classes that only contain a skeleton and just inherits one of the base > classes, and finally the CRUD code that always must be re-written. > And to get all that, the programmer must learn a bunch of different > configuration and command line options. > And when a programmer, after a painstaking setup and configuration > of various options and parameters, finally gets the generated code, > he must re-write 90% of the generated code. > > WBR, > Ghost3D > > On Sep 23, 9:19 am, Fabien Potencier > project.com> wrote: > > Ok, I think we get the point. No need to be rude. Please, go away, use > > whatever framework you want, and stop writing nonsense emails. > > > Thanks, > > Fabien > > > -- > > Fabien Potencier > > Sensio CEO - symfony lead developer > > sensiolabs.com | symfony-project.org | fabien.potencier.org > > Tél: +33 1 40 99 80 80 > > > bghost wrote: > > > As I said at the beginning: > > > > Symfony has become too complicated. Also, Symfony folder structure > > > has become too complicated. Definitely, the learning of principles on > > > which Symfony working is painful and unprofitable. If you really want > > > to > > > see, which means fast, easy and effective PHP framework, then take a > > > look on the following link: > > > >http://www.yiiframework.com/ > > > > WBR, > > > Ghost3D > > > > On Sep 21, 3:31 pm, Sid Bachtiar wrote: > > >> XD > > > >> On Tue, Sep 22, 2009 at 1:28 AM, dziobacz > > >> wrote: > > > >>> I would like to say that Symfony is very, very good and future > > >>> framework. Thx Symfony I could learn very fast ASP.NET MVC (not > > >>> ASP.NET but ASP.NET MVC) - these two frameworks have got many similar > > >>> things. > > >>> While Zend Framework is far, far away Symfony and ASP.NET MVS. In Zend > > >>> you must almost everything creat by yourself !! For example you must > > >>> modify Bootstrap file and write there strange code to enable > > >>> layout !!! Symfony is the best !! :) > > >>> On 21 Wrz, 10:58, CaffeineInc wrote: > > I think symfony is brilliant, If you need a framework which can scale > > to enterprise level websites with fast p
[symfony-users] Re: Symfony has definitely become too complicated framework
Because Zend's framework is named "Zend Framework" whereas the Symfony framework is just known as "Symfony". On Sep 23, 10:26 am, dziobacz wrote: > http://www.google.com/trends?q=Zend+Framework%2C+CakePHP%2C+CodeIgnit... > Why if I write in google trends: Zend Framework, Symfony - the results > are almost the > same:http://www.google.com/trends?q=Zend+Framework%2C+Symfony&ctab=0&geo=a... > And when I write Zend Framework, symfony Framework - Symfony has very > bad > result:http://www.google.com/trends?q=Zend+Framework%2C+Symfony+Framework&ct... > > how is it possible ? > > On 23 Wrz, 10:46, Kieu Anh Tuan wrote: > > > Yes. And somehow censorship is neccesary for those kinds of people. Please > > dont spam our mailboxes anymore. > > > On Sep 23, 2009 9:19 AM, "Fabien Potencier" < > > > fabien.potenc...@symfony-project.com> wrote: > > > Ok, I think we get the point. No need to be rude. Please, go away, use > > whatever framework you want, and stop writing nonsense emails. > > > Thanks, Fabien -- Fabien Potencier Sensio CEO - symfony lead developer > > sensiolabs.com | symfony-pr... --~--~-~--~~~---~--~~ 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: Performance optimization!HELP!!
Make sure you've read http://www.symfony-project.org/book/1_2/18-Performance - lots of good advice there. http://www.symfony-check.org/ is another useful site. In order of the biggest improvement for the least amount of effort, I'd say: 1. Install a PHP accelerator 2. Make sure your db tables are properly indexed 3. Minimise the number of queries with joins Anything after that starts to get increasingly more time consuming to implement for smaller and smaller gains. If you're using multiple web servers, look at using memcached for session storage and for the view cache. Do not be tempted to share via NFS as it will kill your performance. On Sep 17, 4:40 am, Shi Zhuguo wrote: > Hi there, > > We've just finished a product using Symfony 1.2.7 and it is going to > be online. But after test we got a critical performance problem. We > use Doctrine as database interface layer. > > So far we haven't do many optimizations so I am here for some > practical, effective and quick ways to do optimizations with Symfony > and Doctrine. Any suggestions are welcome! > > Help me and thanks in advance~ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Caching per-user pages and security
Just to be clear, I'm not using the passed user_id GET var in the URL for finding the data on a non-cached page, it is retrieved using a user_id which is stored in the session when the user first logs in - this way I can be sure that the logged in user can only see their data if the page is generated on each request. The XML API itself is a proprietary format, and is called using sfWebBrowser and some custom request building / parsing libs. My problem starts because the cache bypasses the auth checks in the action and just uses the URL as a direct path to the cached results. Using a random key would negate the likelyhood of someone guessing the right userid or username to try in the URL, but it still feels a bit hacky. I'm thinking of maybe moving the history-retrieving code into a component and caching that, and then having an extra check against the GET param in the un-cached action which decides if the component is displayed, but I'd like to hear how other people have solved this issue, as I'm sure it must be fairly common? On 15 June, 17:16, François CONSTANT wrote: > Hi, > > This is juste an idea : > > In your table user add one field "alternative_key" which will be for > instance md5("blabla" . $user->getId()); > > Use this alternative key instead of the user id to find the user > record in the database. > > "blabla" is here to make sure nobody will fool this system by trying > to get md5(34) to see user 34 historic. > > Hope it helps. > > On 15 juin, 17:53, Phil Moorhouse > wrote: > > > Hi, I've just recently developed an order-history section for my > > users, and I want to cache the action as it's quite a hefty process > > (xml api call to a booking server that takes a while to generate the > > results). > > > Obviously I need something unique like say the user_id in the url to > > make sure the cache is unique to that user. > > > However, it seems that although the user has to be logged in to view > > the order-history, there is nothing to stop them substituting their > > user_id for someone elses to load another user's history if they've > > happened to cache it recently. > > > i.e. > > 1. User1 logs in, views order history which is then cached for 30 > > mins. > > 2. 10 mins later, User2 logs in, views the order history page, but > > then changes the userid to User1's, and gets his/her cached history > > displayed instead. > > > How do people prevent this from happening? > > > This is on symfony 1.0.20, using the standard symfony file cache. --~--~-~--~~~---~--~~ 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] Caching per-user pages and security
Hi, I've just recently developed an order-history section for my users, and I want to cache the action as it's quite a hefty process (xml api call to a booking server that takes a while to generate the results). Obviously I need something unique like say the user_id in the url to make sure the cache is unique to that user. However, it seems that although the user has to be logged in to view the order-history, there is nothing to stop them substituting their user_id for someone elses to load another user's history if they've happened to cache it recently. i.e. 1. User1 logs in, views order history which is then cached for 30 mins. 2. 10 mins later, User2 logs in, views the order history page, but then changes the userid to User1's, and gets his/her cached history displayed instead. How do people prevent this from happening? This is on symfony 1.0.20, using the standard symfony file cache. --~--~-~--~~~---~--~~ 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: DbFinder returning too many columns when orderBy non-PK column
Using an alias fixed it, cheers. Interestingly this prevents it returning the extra column. $this->eventTypes = DbFinder::from('EventType') ->select(array('EventType.EventTypeId')) ->withColumn('EventType.Name', 'eventTypeName') ->withColumn('EventTypePerNewsItem.NewsItemId', 'selected') ->join('EventTypePerNewsItem') ->where('EventTypePerNewsItem.NewsItemId', $this->newsItem- >getNewsItemId()) ->orderBy('eventTypeName') ->find(); returns: Array ( [0] => Array ( [eventTypeName] => Highlights [selected] => 882 [EventType.EventTypeId] => 101 ) [1] => Array ( [eventTypeName] => Rock [selected] => 882 [EventType.EventTypeId] => 13002 ) [2] => Array ( [eventTypeName] => Special Interest [selected] => 882 [EventType.EventTypeId] => 15002 ) ) So was the extra column "by design" even though it's causing an error in that instance, or should I create a ticket? On 13 May, 11:56, "David Ashwood" wrote: > Try using an alias with the column and then ordering by the alias. > The reason for the uppercase version is to allow for a case-insensitive > sort. > > -Original Message- > From: symfony-users@googlegroups.com [mailto:symfony-us...@googlegroups.com] > > On Behalf Of Phil Moorhouse > Sent: 13 May 2009 12:39 > To: symfony users > Subject: [symfony-users] DbFinder returning too many columns when orderBy > non-PK column > > I seem to have found what looks like a bug in DbFinder, although it's > possible I'm not using it correctly so I thought i'd ask here first > before submitting a ticket. > > When I attempt to order by a non-PK column, it adds that column a > second time to the returned assoc array as an uppercase value with no > defined key. > > e.g. > > Using a PK column to order by: > $this->eventTypes = DbFinder::from('EventType') > ->select(array('EventType.EventTypeId', 'EventType.Name', > 'EventTypePerNewsItem.NewsItemId')) > ->leftJoin('EventType.EventTypeId', > 'EventTypePerNewsItem.EventTypeId') > ->where('EventTypePerNewsItem.NewsItemId', $this->newsItem- > >getNewsItemId()) > ->orderBy('EventType.EventTypeId') > ->find(); > > returns: > Array > ( > [0] => Array > ( > [EventType.EventTypeId] => 101 > [EventType.Name] => Highlights > [EventTypePerNewsItem.NewsItemId] => 882 > ) > > [1] => Array > ( > [EventType.EventTypeId] => 13002 > [EventType.Name] => Rock > [EventTypePerNewsItem.NewsItemId] => 882 > ) > > [2] => Array > ( > [EventType.EventTypeId] => 15002 > [EventType.Name] => Special Interest > [EventTypePerNewsItem.NewsItemId] => 882 > ) > > ) > > which is normal, > > whereas: > $this->eventTypes = DbFinder::from('EventType') > ->select(array('EventType.EventTypeId', 'EventType.Name', > 'EventTypePerNewsItem.NewsItemId')) > ->leftJoin('EventType.EventTypeId', > 'EventTypePerNewsItem.EventTypeId') > ->where('EventTypePerNewsItem.NewsItemId', $this->newsItem- > >getNewsItemId()) > ->orderBy('EventType.Name') > ->find(); > > returns: > Array > ( > [0] => Array > ( > [EventType.EventTypeId] => 101 > [EventType.Name] => Highlights > [EventTypePerNewsItem.NewsItemId] => 882 > [] => HIGHLIGHTS > ) > > [1] => Array > ( > [EventType.EventTypeId] => 13002 > [EventType.Name] => Rock > [EventTypePerNewsItem.NewsItemId] => 882 > [] => ROCK > ) > > [2] => Array > ( > [EventType.EventTypeId] => 15002 > [EventType.Name] => Special Interest > [EventTypePerNewsItem.NewsItemId] => 882 > [] => SPECIAL INTEREST > ) > > ) > > which throws a notice: > Notice: Undefined offset: 3 in /path/to/plugins/DbFinderPlugin/lib/ > propel/sfPropelFinder.php on line 905 > because there are more columns returned than I requested initially. > > This is with Symfony 1.0.20 / Propel 1.2 / DbFinder 1.2.2, not sure if > it does the same on other combinations. --~--~-~--~~~---~--~~ 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] DbFinder, how to leftJoin with Where clause
I need to reproduce the following query with DbFinder. i'm using the results to build a list of checkboxes that will already be checked if they have a row in the relations table. SELECT et.event_type_id, et.name, etpni.news_item_id AS selected FROM event_types et LEFT JOIN event_types_per_news_item etpni ON (et.event_type_id = etpni.event_type_id AND etpni.news_item_id = 621) GROUP BY et.event_type_id ORDER BY et.name The bit i'm strugging with is the "AND etpni.news_item_id = 621" in the ON clause. I can't use a WHERE after the LEFT JOIN because I want event types returning even if there is no matching row in the relations table so that I can still show an empty checkbox. I'm using sf1.0.20 / propel 1.2 / DbFinder 1.2.2 --~--~-~--~~~---~--~~ 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] DbFinder returning too many columns when orderBy non-PK column
I seem to have found what looks like a bug in DbFinder, although it's possible I'm not using it correctly so I thought i'd ask here first before submitting a ticket. When I attempt to order by a non-PK column, it adds that column a second time to the returned assoc array as an uppercase value with no defined key. e.g. Using a PK column to order by: $this->eventTypes = DbFinder::from('EventType') ->select(array('EventType.EventTypeId', 'EventType.Name', 'EventTypePerNewsItem.NewsItemId')) ->leftJoin('EventType.EventTypeId', 'EventTypePerNewsItem.EventTypeId') ->where('EventTypePerNewsItem.NewsItemId', $this->newsItem- >getNewsItemId()) ->orderBy('EventType.EventTypeId') ->find(); returns: Array ( [0] => Array ( [EventType.EventTypeId] => 101 [EventType.Name] => Highlights [EventTypePerNewsItem.NewsItemId] => 882 ) [1] => Array ( [EventType.EventTypeId] => 13002 [EventType.Name] => Rock [EventTypePerNewsItem.NewsItemId] => 882 ) [2] => Array ( [EventType.EventTypeId] => 15002 [EventType.Name] => Special Interest [EventTypePerNewsItem.NewsItemId] => 882 ) ) which is normal, whereas: $this->eventTypes = DbFinder::from('EventType') ->select(array('EventType.EventTypeId', 'EventType.Name', 'EventTypePerNewsItem.NewsItemId')) ->leftJoin('EventType.EventTypeId', 'EventTypePerNewsItem.EventTypeId') ->where('EventTypePerNewsItem.NewsItemId', $this->newsItem- >getNewsItemId()) ->orderBy('EventType.Name') ->find(); returns: Array ( [0] => Array ( [EventType.EventTypeId] => 101 [EventType.Name] => Highlights [EventTypePerNewsItem.NewsItemId] => 882 [] => HIGHLIGHTS ) [1] => Array ( [EventType.EventTypeId] => 13002 [EventType.Name] => Rock [EventTypePerNewsItem.NewsItemId] => 882 [] => ROCK ) [2] => Array ( [EventType.EventTypeId] => 15002 [EventType.Name] => Special Interest [EventTypePerNewsItem.NewsItemId] => 882 [] => SPECIAL INTEREST ) ) which throws a notice: Notice: Undefined offset: 3 in /path/to/plugins/DbFinderPlugin/lib/ propel/sfPropelFinder.php on line 905 because there are more columns returned than I requested initially. This is with Symfony 1.0.20 / Propel 1.2 / DbFinder 1.2.2, not sure if it does the same on other combinations. --~--~-~--~~~---~--~~ 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: composite unique indices
Thanks, I thought i'd checked that section but obviously not. On 15 Apr, 08:20, naholyr wrote: > Add a _uniques property to your table : > > table: > ... > _uniques: > unq_username_affiliate: [username, affiliate_id] > > Note : I could have honestly said "RTFM" > =>http://www.symfony-project.org/book/1_2/08-Inside-the-Model-Layerand > look for "Indexes". > > On 14 avr, 17:09, Phil Moorhouse > wrote: > > > Hi, I have a table with the fields "username" and "affiliate_id" > > > I need to specify the pairing as unique, i.e. > > > username | affiliate_id > > bob_smith, 1 > > bob_smith, 2 > > frank_thomas, 3 > > jessica_murphy, 2 > > > are allowed, but a second > > > bob_smith, 2 > > > would not be. > > > How do I format this in schema.yml? (for Propel) --~--~-~--~~~---~--~~ 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] composite unique indices
Hi, I have a table with the fields "username" and "affiliate_id" I need to specify the pairing as unique, i.e. username | affiliate_id bob_smith, 1 bob_smith, 2 frank_thomas, 3 jessica_murphy, 2 are allowed, but a second bob_smith, 2 would not be. How do I format this in schema.yml? (for Propel) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---